Replaced sqrt(x**2+y**2) with hypot in PathPlanning/DynamicWindowApproach/dynamic_window_approach.py

This commit is contained in:
Guillaume Jacquenot
2019-12-07 22:22:47 +01:00
parent 06cbcc3ee5
commit 1eb3ebbf26

View File

@@ -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]