mirror of
https://github.com/AtsushiSakai/PythonRobotics.git
synced 2026-01-13 17:57:55 -05:00
Replaced sqrt(x**2+y**2) with hypot in PathPlanning/DynamicWindowApproach/dynamic_window_approach.py
This commit is contained in:
@@ -164,7 +164,7 @@ def calc_obstacle_cost(trajectory, ob, config):
|
||||
oy = ob[:, 1]
|
||||
dx = trajectory[:, 0] - ox[:, None]
|
||||
dy = trajectory[:, 1] - oy[:, None]
|
||||
r = np.sqrt(np.square(dx) + np.square(dy))
|
||||
r = np.hypot(dx, dy)
|
||||
|
||||
if config.robot_type == RobotType.rectangle:
|
||||
yaw = trajectory[:, 2]
|
||||
|
||||
Reference in New Issue
Block a user