Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug in path.py #1198

Merged
merged 1 commit into from
Sep 15, 2024
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
8 changes: 4 additions & 4 deletions donkeycar/parts/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,17 +364,17 @@ def nearest_waypoints(self, path, x, y, look_ahead=1, look_behind=1, from_pt=0,
"""
if path is None or len(path) < 2:
logging.error("path is none; cannot calculate nearest points")
return None, None
return None, None, None

if look_ahead < 0:
logging.error("look_ahead must be a non-negative number")
return None, None
return None, None, None
if look_behind < 0:
logging.error("look_behind must be a non-negative number")
return None, None
return None, None, None
if (look_ahead + look_behind) > len(path):
logging.error("the path is not long enough to supply the waypoints")
return None, None
return None, None, None

_pt, i, _distance = self.nearest_pt(path, x, y, from_pt, num_pts)

Expand Down
Loading