mirror of
https://github.com/AtsushiSakai/PythonRobotics.git
synced 2026-02-12 17:15:02 -05:00
Replaced sqrt(x**2+y**2) with hypot in PathTracking/rear_wheel_feedback/rear_wheel_feedback.py
This commit is contained in:
@@ -136,7 +136,7 @@ def closed_loop_prediction(cx, cy, cyaw, ck, speed_profile, goal):
|
|||||||
# check goal
|
# check goal
|
||||||
dx = state.x - goal[0]
|
dx = state.x - goal[0]
|
||||||
dy = state.y - goal[1]
|
dy = state.y - goal[1]
|
||||||
if math.sqrt(dx ** 2 + dy ** 2) <= goal_dis:
|
if math.hypot(dx, dy) <= goal_dis:
|
||||||
print("Goal")
|
print("Goal")
|
||||||
goal_flag = True
|
goal_flag = True
|
||||||
break
|
break
|
||||||
|
|||||||
Reference in New Issue
Block a user