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

This commit is contained in:
Guillaume Jacquenot
2019-12-07 22:53:08 +01:00
parent 60387ee5f8
commit 077120201b

View File

@@ -230,7 +230,7 @@ def calc_global_paths(fplist, csp):
dx = fp.x[i + 1] - fp.x[i]
dy = fp.y[i + 1] - fp.y[i]
fp.yaw.append(math.atan2(dy, dx))
fp.ds.append(math.sqrt(dx**2 + dy**2))
fp.ds.append(math.hypot(dx, dy))
fp.yaw.append(fp.yaw[-1])
fp.ds.append(fp.ds[-1])