Skip to content

Commit cf53875

Browse files
committed
Replaced sqrt(x**2+y**2) with hypot in PathPlanning/ClosedLoopRRTStar/pure_pursuit.py
1 parent ed9b84d commit cf53875

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

PathPlanning/ClosedLoopRRTStar/pure_pursuit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def set_stop_point(target_speed, cx, cy, cyaw):
161161
for i in range(len(cx) - 1):
162162
dx = cx[i + 1] - cx[i]
163163
dy = cy[i + 1] - cy[i]
164-
d.append(math.sqrt(dx ** 2.0 + dy ** 2.0))
164+
d.append(math.hypot(dx, dy))
165165
iyaw = cyaw[i]
166166
move_direction = math.atan2(dy, dx)
167167
is_back = abs(move_direction - iyaw) >= math.pi / 2.0

0 commit comments

Comments
 (0)