diff --git a/PathTracking/lqr_steer_control/lqr_steer_control.py b/PathTracking/lqr_steer_control/lqr_steer_control.py index f977cdc2..b69577d3 100644 --- a/PathTracking/lqr_steer_control/lqr_steer_control.py +++ b/PathTracking/lqr_steer_control/lqr_steer_control.py @@ -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