mirror of
https://github.com/AtsushiSakai/PythonRobotics.git
synced 2026-04-22 03:00:41 -04:00
Replaced sqrt(x**2+y**2) with hypot in Localization/histogram_filter/histogram_filter.py
This commit is contained in:
@@ -68,7 +68,7 @@ def calc_gaussian_observation_pdf(gmap, z, iz, ix, iy, std):
|
||||
# predicted range
|
||||
x = ix * gmap.xy_reso + gmap.minx
|
||||
y = iy * gmap.xy_reso + gmap.miny
|
||||
d = math.sqrt((x - z[iz, 1]) ** 2 + (y - z[iz, 2]) ** 2)
|
||||
d = math.hypot(x - z[iz, 1], y - z[iz, 2])
|
||||
|
||||
# likelihood
|
||||
pdf = (1.0 - norm.cdf(abs(d - z[iz, 0]), 0.0, std))
|
||||
|
||||
Reference in New Issue
Block a user