Skip to content

honda: port the current Bosch-A radar parser from Honda-PTM-Testing - #3

Merged
nrdr merged 1 commit into
nrdr:nrdr-developmentfrom
trung791997:bosch-a-parser-port
Nov 8, 2026
Merged

nrdr merged 1 commit into
nrdr:nrdr-developmentfrom
trung791997:bosch-a-parser-port

Conversation

@trung791997

Copy link
Copy Markdown

Brings nrdr's Bosch-A radar parser up to the current one from Biscuit-Labs/openpilot Honda-PTM-Testing. The decoder moves into its own module, opendbc/car/honda/bosch_a_radar.py. That file is a byte-for-byte copy of Testing's, except that the constructor takes (CP, CP_SP). radar_interface.py now only picks Nidec or Bosch-A and hands off. nrdr's gate (the honda_bosch_a_radar DBC, radarUnavailable) and the Nidec path are unchanged.

What changes against nrdr's current parser:

Change Before Now
Range offset -3.0 m for every car Per-car offset read from the radar ROM: Civic -346/128 (-2.70 m), CR-V -341/128
Direct relative speed (U11) scale 1/64 m/s 1/72 m/s (range ±12.0 m/s)
Frame rate 15 Hz 14.35 Hz, measured
Stale velocity Point dropped Point kept with the last vRel, marked measured = False. A degraded point is safer than a deleted one.
New since nrdr's port – Life-counter saturation, lateral rail interval, coast and reversing-speed bounds, track re-anchor, vrel-rate check, F0 status per point (point_statuses)

The settings that were toggles on Testing are fixed on here, with no Params reads: rail interval on, range-derived coast on, newborn leads not published, U11 floor marked unmeasured. The DBC is unchanged: Testing's DBC still has a stale 0.05712 range factor, and nrdr's 0.0625 is the right one.

RadarInterface gains a settable v_ego, used by the reversing bound, and point_statuses. Both are optional for callers. The openpilot side (radard at 14.35 Hz, v_ego from card, Bosch-A longitudinal) follows in a separate PR to nrdr/openpilot.

Tests

  • Static only. Nothing in this PR is replay- or road-validated on nrdr.
  • Added test_bosch_a_decoder.py, 139 tests from Testing, and test_bosch_a_radar_interface.py, 14 tests. nrdr's own test_bosch_a_radar.py is kept; its expectations are updated for the 1/72 scale, 14.35 Hz, the per-car offset and held stale points. No test was deleted.
  • opendbc/car/honda/tests: 1209 passed, 43 failed. Before this change: 1045 passed, the same 43 failed (42 in test_mvl_priority.py, 1 in test_mvl_sync.py).
  • opendbc/car/tests: 805 passed, 384 skipped, unchanged.
  • ruff is clean on the changed files.

🤖 Generated with Claude Code

…M-Testing

Moves the Bosch-A decoding into a new bosch_a_radar.py (BoschARadar), copied from
Biscuit-Labs Honda-PTM-Testing. RadarInterface(CP, CP_SP) now delegates the Bosch-A
path to it and keeps only the Nidec path and nrdr's selection (DBC name plus
radarUnavailable). The old inline Bosch-A code is deleted. point_statuses and a
settable v_ego are exposed on the wrapper.

Behavior now matches Testing: per-car ROM range offset, U11 at 1/72 m/s, 14.35 Hz,
life-counter saturation, rail bounds, coast bounds including reversing coast,
re-anchor/innovation, vrel-rate check, raw U11 0 = unmeasured. Testing's former
toggles are hard-coded to its current defaults; no Params reads, no DBC changes.

Tests: ported Testing's decoder tests (139) and radar-interface tests (the portable
ones, 14 incl. parametrized); nrdr's 82 tests kept with expectations updated where
Testing intentionally changed them (1/72 U11, 14.35 Hz, -346/128 offset, stale
velocity no longer deletes the point).

Evidence is static tests only; nothing here is road- or replay-validated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing to opendbc! In order for us to review your PR as quickly as possible, check the following:

  • Convert your PR to a draft unless it's ready to review
  • Read the contributing docs
  • Before marking as "ready for review", ensure:
    • the goal is clearly stated in the description
    • all the tests are passing
    • include a route or your device' dongle ID if relevant

@nrdr
nrdr merged commit 461f81c into nrdr:nrdr-development Nov 8, 2026
1 check passed
@nrdr

nrdr commented Nov 8, 2026

Copy link
Copy Markdown
Owner

Verified included in the current development line through #4: 461f81cddfa96be4fbf2b9c01e821790f8110f27 is the direct parent of 427f1986ed241f111d106cc72cdefbda5efe5f7f.

Fast-forwarded opendbc's nrdr-development from 9ea07f465206f378555bc4cb550affad82dfa70a to that exact two-commit stack, matching the submodule revision already selected by merged nrdr/openpilot#27. The original commits are preserved; no cherry-pick, replacement implementation, or conflict-resolution changes were needed.

Closing any remaining open PR bookkeeping as included via #4. This is an inclusion/history audit, not additional replay or road validation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants