Skip to content

Auto planner: wheel slip, vision noise, 20 matches, and a 20 second period - #16

Merged
MBimrose merged 4 commits into
mainfrom
claude/jolly-wright-vz5il0
Nov 2, 2026
Merged

MBimrose merged 4 commits into
mainfrom
claude/jolly-wright-vz5il0

Conversation

@MBimrose

@MBimrose MBimrose commented Nov 2, 2026

Copy link
Copy Markdown
Member

The planner on How to Plan an Auto used to treat the plan as what the robot does, so the best answer was always the highest max speed and acceleration. Now each run simulates the robot on carpet, with ideas from maple-sim, and students have to find limits that are fast enough but still reliable.

The physics (assets/js/interactive/auto-core.js)

  • Grip: the wheels grip the carpet up to about 8.8 m/s² (Colsons, coefficient 0.9 from maple-sim). Speeding up, slowing down and turning share that budget. Ask for more and the wheels slip, the robot slides wide, and odometry drifts.
  • Motors: they top out at 4.75 m/s and lose acceleration near it. A plan faster than that leaves the robot behind, cutting corners and still moving when it shoots.
  • Odometry and vision: odometry counts wheel turns, so slipping wheels make it drift. AprilTag readings correct it the way WPILib's pose estimator does. Readings get noisier with distance and blur with speed.
  • Aiming: the path follower steers by the estimate and the shooter aims from it. A moving robot carries its shot off line.
  • 20 matches: each match has its own grip (±5%) and camera noise, and the routine must work in 18 of 20.

The task

The autonomous period is now 20 seconds, as in the real game. With two pieces, gentle limits fit in 20 seconds and there was no balance left to find, so the task is now three pieces: the preload plus two trips to the LOAD zone. The LOAD zone moves to (4.4, 4.8), still in our alliance area, and the goal moves to x 12.8. The barriers leave wider corridors.

node tools/validate-auto-task.js --grid shows the balance with the three-piece route:

Limits Result
3 m/s² or less too slow at any max speed
about 3–5 m/s with 5–6 m/s² works in 18–20 of 20 matches, 16.3–19 s
4.5 m/s and up with 7 m/s² and up fails in most or all matches
4 m/s, 7 m/s² the fastest setting that works: 15.9 s, 1.7 s faster than 4 m/s, 5 m/s²

The widget

  • The field shows the real path (red where the wheels slipped), a dashed outline for where the robot thinks it is, a dot for where the plan wants it, and the AprilTags with a line when the camera reads one.
  • A chart shows speed, grip used and pose error. It can be dragged to scrub through the match.
  • 20 match squares can each be clicked to watch that match.
  • The checks count failures across the 20 matches and suggest what to change.
  • Max acceleration now goes up to 10 m/s², and the page starts at 3 m/s and 3 m/s².
  • On phones the chips sit under the field instead of covering it.

The page has a new section on slip, odometry, vision and the balance, plus an updated display guide, limits and references.

Testing

  • node tools/validate-auto-task.js passes. It checks that moderate limits work with 2.4 s of margin, actions run in series miss the period, a straight line hits barrier A, gentle limits are too slow, pushing fails, and fast plans rarely work.
  • tools/e2e planner tests (6) and the page-load check pass in Chromium. Two console errors from the cloud sandbox blocking the mermaid CDN were filtered locally. They also happen on main, and the test helper is unchanged.
  • I checked the layout at 1280 px and 390 px.

The branch includes a merge of the old claude/jolly-wright-vz5il0 history (already in main as #13), which changes no files.


Generated by Claude Code

The five cards were shown in the order STEPS is written in, and that order
scores. A student could tap straight along the row and solve the exercise
without reading a single step, which is the whole point of the tutorial.

Shuffle the cards instead. Four of the 120 orders score, because the intake
keeps running once it starts and the robot can collect the game piece as it
drives through, so the shuffle rejects any arrangement that is one of those
four. Reading order is now never the answer.

Keep one student on one shuffle. The routine is already saved across visits,
so a bank that rearranged itself each time would not agree with the routine
under it. A saved order left over from an older list of steps is thrown away.

Add tools/validate-sequence.js. The guarantee rests on the list of working
orders being exact, so it replays all 120 orders through the real robot and
checks the list is still the whole set. The rules a step finishes by live in
a closure with no module to load, so the tool holds a copy and fails loudly
when that copy and the widget have parted.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CtC4MMv9XLZrAGLv712dF6
The planner used to treat the plan as what the robot does, so the best
answer was always the highest max speed and acceleration. Now each match
is simulated with ideas from maple-sim:

- The wheels grip up to about 8.8 m/s² (Colsons on carpet), shared
  between speeding up, slowing down and turning. Ask for more and they
  slip: the robot slides wide and odometry drifts.
- The drive motors top out at 4.75 m/s and lose acceleration near it.
  A plan faster than that leaves the robot behind, cutting corners and
  still moving when it shoots.
- AprilTag readings correct the estimate the way WPILib's pose
  estimator does, noisier with distance and motion blur.
- The follower steers, and the shooter aims, by the estimate.

The routine runs as 20 matches, each with its own grip and camera noise,
and must work in 18. Moderate limits work with time to spare, gentle ones
run out of time, and pushing hard fails in more and more matches.

The widget draws the real path (red where slipping), where the robot
thinks it is, the plan's position, the tags, a speed / grip / pose error
chart, and the 20 matches to click through. The checks explain failures.
Barriers leave wider corridors and the goal is closer, so balanced limits
fit. The validator and browser tests prove the balance.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CtC4MMv9XLZrAGLv712dF6
…-forwards

Its content is already in main as c3e5ea9, so this merge changes no files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CtC4MMv9XLZrAGLv712dF6
The autonomous period is 20 seconds, not 15. With two pieces, gentle
limits fit in 20 seconds, so there was no balance left to find. The task
is now three pieces: the preload, then two trips to the LOAD zone. The
LOAD zone moves to (4.4, 4.8), still in our alliance area, and the goal
to x = 12.8, so balanced limits fit with time to spare:

- 3 m/s², or less, is too slow at any max speed
- about 3 to 5 m/s with 5 to 6 m/s² works in 17.4 to 19 s
- 4.5 m/s and up with 7 m/s² or more fails in most matches
- the fastest setting that still works saves about 1.7 s

The validator's grid scales its "fast" line with the period, and prints
every setting with --grid.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CtC4MMv9XLZrAGLv712dF6
@MBimrose
MBimrose merged commit 764fa9a into main Nov 2, 2026
1 check passed
MBimrose pushed a commit that referenced this pull request Nov 2, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CtC4MMv9XLZrAGLv712dF6
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.

2 participants