Skip to content

test: check Pure Pursuit and Stanley steering on a straight course - #287

Open
abedinm wants to merge 1 commit into
ShisatoYano:mainfrom
abedinm:test/path-tracking-steering
Open

abedinm wants to merge 1 commit into
ShisatoYano:mainfrom
abedinm:test/path-tracking-steering

Conversation

@abedinm

@abedinm abedinm commented Nov 24, 2026

Copy link
Copy Markdown

Summary

Adds unit tests for the steering of PurePursuitController and StanleyController on a straight CubicSplineCourse along the x axis. Each test places the vehicle at a known position, calls update() once and checks get_target_steer_rad():

  • On the course and heading along it: steering is zero
  • Left of the course (y > 0): steers right (negative angle)
  • Right of the course (y < 0): steers left (positive angle)
  • The same offset on the two sides gives mirrored steering
  • A larger offset gives larger steering

Tests only, no src/ change. Closes #273, part of #103.

How I checked it works

pytest test/test_path_tracking_steering.py passes (10 tests). It fails when I flip the sign of the Pure Pursuit steering (2 fail), flip the sign of the Stanley steering (2 fail) or remove Stanley's cross-track term (3 fail). . run_test_suites.sh passes (148 passed).

Images

Tests only, not needed.

Book

  • This PR doesn't change code that the book describes, or I updated those pages

AI disclosure: I wrote this with the help of Claude Code.

🤖 Generated with Claude Code

Part of ShisatoYano#103. Closes ShisatoYano#273.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

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.

Unit tests: Pure Pursuit and Stanley steering on a straight course

1 participant