mirror of
https://github.com/AtsushiSakai/PythonRobotics.git
synced 2026-04-22 03:00:22 -04:00
Replaced sqrt(x**2+y**2) with hypot in PathTracking/model_predictive_speed_and_steer_control/model_predictive_speed_and_steer_control.py
This commit is contained in:
@@ -348,7 +348,7 @@ def check_goal(state, goal, tind, nind):
|
||||
# check goal
|
||||
dx = state.x - goal[0]
|
||||
dy = state.y - goal[1]
|
||||
d = math.sqrt(dx ** 2 + dy ** 2)
|
||||
d = math.hypot(dx, dy)
|
||||
|
||||
isgoal = (d <= GOAL_DIS)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user