Replaced sqrt(x**2+y**2) with hypot in Localization/histogram_filter/histogram_filter.py

This commit is contained in:
Guillaume Jacquenot
2019-12-07 22:53:07 +01:00
parent d26eb04ae2
commit e467f4fad1

View File

@@ -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))