From bc2b7c969cd37b572372c5cdaa36b680a02f7c56 Mon Sep 17 00:00:00 2001 From: Guillaume Jacquenot Date: Sat, 7 Dec 2019 22:20:12 +0100 Subject: [PATCH] Replaced sqrt(x**2+y**2) with hypot in PathTracking/lqr_speed_steer_control/lqr_speed_steer_control.py --- PathTracking/lqr_speed_steer_control/lqr_speed_steer_control.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PathTracking/lqr_speed_steer_control/lqr_speed_steer_control.py b/PathTracking/lqr_speed_steer_control/lqr_speed_steer_control.py index 6dec12bd..c7c8e0dd 100644 --- a/PathTracking/lqr_speed_steer_control/lqr_speed_steer_control.py +++ b/PathTracking/lqr_speed_steer_control/lqr_speed_steer_control.py @@ -212,7 +212,7 @@ def do_simulation(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