Replaced sqrt(x**2+y**2) with hypot in SLAM/GraphBasedSLAM/graph_based_slam.py

This commit is contained in:
Guillaume Jacquenot
2019-12-07 22:10:53 +01:00
parent 190a28e0a8
commit 652c32fba9

View File

@@ -216,7 +216,7 @@ def observation(xTrue, xd, u, RFID):
dx = RFID[i, 0] - xTrue[0, 0]
dy = RFID[i, 1] - xTrue[1, 0]
d = math.sqrt(dx**2 + dy**2)
d = math.hypot(dx, dy)
angle = pi_2_pi(math.atan2(dy, dx)) - xTrue[2, 0]
phi = pi_2_pi(math.atan2(dy, dx))
if d <= MAX_RANGE: