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

This commit is contained in:
Guillaume Jacquenot
2019-12-07 22:22:14 +01:00
parent 5221a9df2a
commit 06cbcc3ee5

View File

@@ -118,7 +118,7 @@ def find_sweep_direction_and_start_posi(ox, oy):
for i in range(len(ox) - 1):
dx = ox[i + 1] - ox[i]
dy = oy[i + 1] - oy[i]
d = np.sqrt(dx ** 2 + dy ** 2)
d = np.hypot(dx, dy)
if d > max_dist:
max_dist = d