Skip to content

Commit 652c32f

Browse files
committed
Replaced sqrt(x**2+y**2) with hypot in SLAM/GraphBasedSLAM/graph_based_slam.py
1 parent 190a28e commit 652c32f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

SLAM/GraphBasedSLAM/graph_based_slam.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ def observation(xTrue, xd, u, RFID):
216216

217217
dx = RFID[i, 0] - xTrue[0, 0]
218218
dy = RFID[i, 1] - xTrue[1, 0]
219-
d = math.sqrt(dx**2 + dy**2)
219+
d = math.hypot(dx, dy)
220220
angle = pi_2_pi(math.atan2(dy, dx)) - xTrue[2, 0]
221221
phi = pi_2_pi(math.atan2(dy, dx))
222222
if d <= MAX_RANGE:

0 commit comments

Comments
 (0)