Skip to content

Commit

Permalink
Update path.py
Browse files Browse the repository at this point in the history
  • Loading branch information
zlite committed Sep 14, 2024
1 parent e475b4a commit ca9e303
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit ca9e303

Please sign in to comment.