Skip to content

honda: port Bosch-A-aware radard lead tracking - #17

Closed
JamesL787 wants to merge 1 commit into
nrdr:nrdr-barefrom
JamesL787:honda-bosch-a-radard-lead-tracking-nrdr
Closed

JamesL787 wants to merge 1 commit into
nrdr:nrdr-barefrom
JamesL787:honda-bosch-a-radard-lead-tracking-nrdr

Conversation

@JamesL787

Copy link
Copy Markdown

Summary

  • `is_bosch_a_radar_car()` and its downstream handling in `radard.py` never landed alongside the Bosch-A radar decoder (from honda: port Bosch-A 16-slot radar decoder, enable for full HONDA_BOSCH_A harness #16, pending merge into nrdr/opendbc). Without it, decoded Bosch-A radar points feed into radard's generic path, which assumes the wrong Kalman filter timestep and has no real staleness/freshness gate for this radar's actual cadence.
  • Ports the following (renamed to `HONDA_BOSCH_A` naming, not "civic_bosch"):
    • Kalman filter dt selected from the radar's real ~15Hz cadence (`HONDA_BOSCH_A_RADAR_TS`), not the ~20Hz model-cycle default
    • `measurement_update` gating so a duplicate `radarTracks` payload (radar runs slower than the model loop) isn't absorbed twice by the KF
    • a "preferred track" continuity path: a previously-selected lead stays selected through ordinary model-probability fluctuations as long as it's still coherent, instead of re-arbitrating from scratch every cycle
    • staleness detection with two independent triggers (a better-scoring challenger track sustained over several cycles, or gross absolute-range disagreement with the model sustained over several cycles) that drops a stale preferred track rather than holding it indefinitely
    • `honda_bosch_a_low_speed_radar_lead_sane()`, requiring a few real sweeps before a radar-only low-speed takeover
  • Purely additive relative to this file's current content -- all other car behavior is untouched.
  • Mechanical, unmodified transplant of behavior already tested on the branch this was developed on (109/109 relevant tests passing there) onto this repo's current `radard.py`.

Test plan

🤖 Generated with Claude Code

is_bosch_a_radar_car() and its downstream handling in radard.py never
landed alongside the Bosch-A radar decoder (from #16, pending merge into
nrdr/opendbc) -- without it, the newly-decoded Bosch-A radar points feed
into radard's generic path, which assumes the wrong Kalman filter timestep
and is missing a real staleness/freshness gate this radar's actual cadence
needs.

Ports (unmodified in behavior, renamed to this repo's HONDA_BOSCH_A
naming instead of "civic_bosch"):
- Kalman filter dt selected from the radar's real ~15Hz cadence
  (HONDA_BOSCH_A_RADAR_TS), not the ~20Hz model-cycle default
- measurement_update gating so a duplicate radarTracks payload (radar runs
  slower than the model loop) isn't absorbed twice by the KF
- a "preferred track" continuity path: a previously-selected lead stays
  selected through ordinary model-probability fluctuations as long as it's
  still coherent, instead of re-arbitrating from scratch every cycle
- staleness detection with two independent triggers (a better-scoring
  challenger track sustained over several cycles, or gross absolute-range
  disagreement with the model sustained over several cycles) that drops a
  stale preferred track rather than holding it indefinitely
- honda_bosch_a_low_speed_radar_lead_sane(), requiring a few real sweeps
  before a radar-only low-speed takeover

Purely additive relative to this file's current content -- all other car
behavior is untouched. Tested on the branch this was developed on
(109/109 relevant tests pass); this port is a mechanical, unmodified
transplant -- worth a run through this repo's own test suite before merge.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@JamesL787 JamesL787 closed this Aug 26, 2026
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.

1 participant