Skip to content

Commit 1eb3ebb

Browse files
committed
Replaced sqrt(x**2+y**2) with hypot in PathPlanning/DynamicWindowApproach/dynamic_window_approach.py
1 parent 06cbcc3 commit 1eb3ebb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

PathPlanning/DynamicWindowApproach/dynamic_window_approach.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def calc_obstacle_cost(trajectory, ob, config):
164164
oy = ob[:, 1]
165165
dx = trajectory[:, 0] - ox[:, None]
166166
dy = trajectory[:, 1] - oy[:, None]
167-
r = np.sqrt(np.square(dx) + np.square(dy))
167+
r = np.hypot(dx, dy)
168168

169169
if config.robot_type == RobotType.rectangle:
170170
yaw = trajectory[:, 2]

0 commit comments

Comments
 (0)