Skip to content

Fix Pure Pursuit target search at course endpoint - #1491

Open
autrin wants to merge 1 commit into
AtsushiSakai:masterfrom
autrin:fix-pure-pursuit-endpoint
Open

autrin wants to merge 1 commit into
AtsushiSakai:masterfrom
autrin:fix-pure-pursuit-endpoint

Conversation

@autrin

@autrin autrin commented Nov 2, 2026 •

Copy link
Copy Markdown

Great repo, Thanks!

Reference issue

Fixes #1490

What does this implement/fix?

Repeated target searches raise IndexError when the cached nearest waypoint
is the final course waypoint. The nearest-point search accesses ind + 1
before checking whether another waypoint exists.

Check the boundary before accessing the next waypoint and retain the final
index when the search reaches the course endpoint.

Add regression tests covering a single-waypoint course, repeated searches
at the final waypoint, progression to and beyond the endpoint, and repeated
searches at an interior waypoint. Document the endpoint behavior.

Additional information

Validation on Windows with Python 3.14.4:

  • New regression tests against the original method: 3 failed, 1 passed.
Screenshot 2026-11-01 172615 Screenshot 2026-11-01 172647 Screenshot 2026-11-01 172706 Screenshot 2026-11-01 172730
  • Updated Pure Pursuit tests: 6 passed.
Screenshot 2026-11-01 172800
  • Full suite with MPLBACKEND=Agg:
    python -m pytest tests -l -Werror --durations=0
    160 passed, including the repository's code-style and mypy checks.
image
  • Ruff on both changed Python files: passed.
  • git diff --check: passed.

CheckList

  • Did you add an unittest for your new example or defect fix?
  • Did you add documents for your new example?
  • All CIs are green?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pure Pursuit target search raises IndexError at the final waypoint

1 participant