plan 0011: Drag mode — distance runs without a track - #148
Open
TheAngryRaven wants to merge 1 commit into
Open
Conversation
Main menu -> Drag -> pick 1/8 Mile / 1000 ft / 1/4 Mile / 1/2 Mile /
1 Mile and the session starts: no track file, no detection. Stage at a
standstill, rollout-style launch (11.25 in past a re-latching standstill
anchor, ET start interpolated between 25 Hz fixes), run ends at the
target distance with interpolated ET + trap speed and a 0-60 split, then
re-arms automatically for the next pass. All passes land in one DOVEX
session with race_mode=DRAG (laps line = run ETs, same trailing-column
scheme as SPRINT).
- New host-tested pure unit drag_timer.{h,cpp}: the whole run state
machine (ARMED/STAGED/LAUNCHED), the distance table, silent aborts
(mid-run standstill, >=2 s fix gap — also how queue-creep phantom
launches self-cancel), 14 doctest cases.
- Sketch glue mirrors sprint: dragTimer != nullptr IS drag mode, drag
branch first in every activeTimer*() helper, run capture on the
run-count edge, trackDetected latched, idle-grace re-arm on each run
AND each fresh STAGED latch.
- UI: Drag main-menu row, PAGE_DRAG_DISTANCE picker (scrolling window),
drag branches on the lap-time/pace/best pages (live ET, *staged*,
trap/0-60 subtext, live 0-60 readout), LED pace pip suppressed between
runs like sprint.
- Sim: golden walk updated for the new menu row + a picker fixture;
goldens regenerated; soak/determinism/goldens/oracles all pass.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BKa62h4fhn61pKn1LygrMK
Coverage — host-testable units📂 Overall coverage
📄 File coverage
|
This was referenced Aug 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Drag mode: main menu → Drag → pick a distance (1/8 Mile, 1000 ft, 1/4 Mile, 1/2 Mile, 1 Mile) and the session starts — no track file, no detection. The device stages at a standstill, starts the clock rollout-style (11.25 in of movement past a re-latching standstill anchor, ET start interpolated between 25 Hz fixes), and ends the run at the target distance with an interpolated ET + trap speed and a 0-60 mph split. It re-arms automatically when the car stops, so a whole day of passes lands in one DOVEX session (
race_mode=DRAG, laps line = run ETs — same backwards-compatible trailing-column scheme as SPRINT; trap/0-60 stay out of the frozen header since the 25 Hz rows carry speed).The run state machine is a new host-tested pure unit,
drag_timer.{h,cpp}: staging (≤1 mph held 1 s, anchor = re-latching running mean so staging-lane GPS drift can't fake a launch), launch, chord-distance accumulation, and silent aborts (3 s mid-run standstill, ≥2 s fix gap) — which is also how queue-creep phantom launches self-cancel. The sketch keeps only sprint-style glue:dragTimer != nullptrIS drag mode, drag branch first in everyactiveTimer*()helper, run capture on the run-count edge, and the auto-idle grace re-arms on each completed run and each fresh stage so a staging queue never idles the session out. Design record indocs/plans/0011-drag-mode.md.UI: new Drag main-menu row +
PAGE_DRAG_DISTANCEpicker (scrolling 3-row window, Back row); the Current Lap / Pace / Best Lap pages branch for drag (live ET,*staged*/*waiting*, trap/0-60 subtext, live 0-60 readout); the LED pace pip is suppressed between runs like sprint.Follow-up outside this repo: the webapp will want a
DRAGcase in its race_mode loader (old viewers degrade gracefully to "unknown mode with a runs line").Type of change
How it was verified
ctest --test-dir tests/build) — 523 cases including 14 newdrag_timercases (analytic launch/ET/trap/0-60 interpolation, anchor-drift and jitter immunity, abort paths, re-arm cycles, distance-table goldens)clang-tidyclean — left to CIChecklist
CHANGELOG.mdupdated under[Unreleased](if user-visible)ARCHITECTURE.md/CLAUDE.mdupdated (if a module or interface changed)tests/Related issues
None — design record:
docs/plans/0011-drag-mode.md.🤖 Generated with Claude Code
https://claude.ai/code/session_01BKa62h4fhn61pKn1LygrMK
Generated by Claude Code