Replaced sqrt(x**2+y**2) with hypot in PathTracking/lqr_steer_control/lqr_steer_control.py

This commit is contained in:
Guillaume Jacquenot
2019-12-07 22:19:41 +01:00
parent 9f5b0a25cc
commit db78f07c0b

View File

@@ -191,7 +191,7 @@ def closed_loop_prediction(cx, cy, cyaw, ck, speed_profile, goal):
# check goal
dx = state.x - goal[0]
dy = state.y - goal[1]
if math.sqrt(dx ** 2 + dy ** 2) <= goal_dis:
if math.hypot(dx, dy) <= goal_dis:
print("Goal")
break