Ford angle-mode lateral: on-device auto-calibration gauges - #172
Draft
ghbarker wants to merge 3 commits into
Draft
Ford angle-mode lateral: on-device auto-calibration gauges#172ghbarker wants to merge 3 commits into
ghbarker wants to merge 3 commits into
Conversation
…ctors A pure estimator (angle_autocal.py) fits the two gain anchors from clean cornering evidence — steady curve segments and matched command/measured apexes — and nudges the applied factors toward the fit in small damped steps, verifying each step against fresh evidence before the next. Evidence is only taken while the loop is quietly tracking (hunting can never read as gain) and while the actuation delay is estimated, aligned against the command from lateral_delay ago so a moving command on winding roads still counts. Lifecycle (arm/disarm, persistence, nudge writes, lock) lives in a controller; the same estimator runs offline against logged drives. The sub-knee small-signal lift rides the FordHighSpeedDampening_ang knob merged in BluePilotDev#166 (mechanically the same multiplier); no duplicate param is added. Settings are on the on-device menus (comma 3X + comma four) and sunnylink. Menu neutral values leave steering bit-identical to today.
Five input-side filters (angle_smoothing.py) that damp the rhythmic straight-road weave: an asymmetric filter on |kappa| feeding the gain schedule (the primary fix), a low-pass on the model prediction, a slew on the exit blend, hysteresis on the curve-entering boolean, and a 1-LSB wire hold on the outgoing path_angle. A strength dial where 1.0 is bit-identical stock; no output-side lag by construction. Held wire frames are zero-ROC and cannot trip the panda path_angle checks. Toggle + strength on both device menus and sunnylink. Stacked on the auto-calibration PR (shares the lateral_angle_ext wiring).
Battery-style gauges on the lateral debug view showing each anchor's calibration progress (evidence fill that stays monotonic, lock icon when the calibration freezes), fed by the ground-truth auto-cal telemetry the controller publishes. Display only; no control-path changes. Stacked on the auto-calibration PR (reads its bmsAngleAutoCalState telemetry).
ghbarker
marked this pull request as draft
July 31, 2026 03:27
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.
The evidence that motivated this
Why the fix is shaped this way
bmsAngleAutoCalState) — the same source the logs carry, so what the screen shows is what the calibrator believes.The evidence afterwards
What each change is
bluepilot/ui/widgets/debug/autocal_bars.py(+ its test): the gauge widget.selfdrive/ui/bp/mici/onroad/lateral_debug_mici.py: +14 lines wiring the gauges into the debug overlay.Test it yourself
Risks / limits