Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions PathPlanning/ReedsSheppPath/reeds_shepp_path_planning.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ def plot_arrow(x, y, yaw, length=1.0, width=0.5, fc="r", ec="k"):


def mod2pi(x):
v = np.mod(x, 2.0 * math.pi)
# Be consistent with fmod in cplusplus here.
v = np.mod(x, np.copysign(2.0 * math.pi, x))
if v < -math.pi:
v += 2.0 * math.pi
else:
Expand Down Expand Up @@ -76,7 +77,7 @@ def set_path(paths, lengths, ctypes):
for tpath in paths:
typeissame = (tpath.ctypes == path.ctypes)
if typeissame:
if sum(tpath.lengths) - sum(path.lengths) <= 0.01:
if sum(np.abs(tpath.lengths)) - sum(np.abs(path.lengths)) <= 0.01:
return paths # not insert path

path.L = sum([abs(i) for i in lengths])
Expand Down