honda: keep Bosch-A radard timing Honda-scoped

Keep the Bosch-A lead probability filter cadence change limited to the verified Honda Bosch-A path. Preserve the existing radar timestep for every other platform and add regression coverage for the gate and both timing paths.

Co-authored-by: JamesL787 <jamezelle1@gmail.com>
This commit is contained in:
firestar5683
2026-08-25 19:20:38 -05:00
parent 31f00eaff7
commit 145bf39587
2 changed files with 19 additions and 1 deletions
+2 -1
View File
@@ -430,7 +430,8 @@ class RadarD:
kf_dt = HONDA_BOSCH_A_RADAR_TS if self.honda_bosch_a_radar else radar_ts
self.kalman_params = KalmanParams(kf_dt)
self.g90_radar_filter = g90_radar_filter
self.lead_prob_filters = [FirstOrderFilter(0.0, 0.2, DT_MDL) for _ in range(2)]
lead_prob_dt = DT_MDL if self.honda_bosch_a_radar else radar_ts
self.lead_prob_filters = [FirstOrderFilter(0.0, 0.2, lead_prob_dt) for _ in range(2)]
self.prev_lead_track_ids = [-1, -1]
self.preferred_stale_track_ids = [-1, -1]
self.preferred_challenger_stale_counts = [0, 0]
+17
View File
@@ -6,10 +6,15 @@ from cereal import log
import pytest
from opendbc.car.toyota.values import CAR as TOYOTA
from opendbc.car.honda.values import CAR as HONDA
from openpilot.selfdrive.test.process_replay import replay_process_with_name
from openpilot.selfdrive.controls.radard import (
DT_MDL,
HONDA_BOSCH_A_RADAR_TS,
RadarD,
g90_low_speed_radar_lead_sane,
g90_radar_lead_lateral_sane,
is_bosch_a_radar_car,
match_vision_to_track,
)
@@ -79,6 +84,18 @@ class TestLeads:
assert track is None
def test_bosch_a_radard_path_is_gated_to_verified_honda_radar(self):
assert is_bosch_a_radar_car(SimpleNamespace(brand="honda", carFingerprint=HONDA.HONDA_CIVIC_BOSCH, radarUnavailable=False))
assert not is_bosch_a_radar_car(SimpleNamespace(brand="toyota", carFingerprint=HONDA.HONDA_CIVIC_BOSCH, radarUnavailable=False))
assert not is_bosch_a_radar_car(SimpleNamespace(brand="honda", carFingerprint=HONDA.HONDA_CIVIC_BOSCH, radarUnavailable=True))
def test_bosch_a_and_legacy_lead_filter_timesteps_are_scoped(self):
legacy = RadarD(radar_ts=0.06)
bosch_a = RadarD(radar_ts=0.06, honda_bosch_a_radar=True)
assert legacy.lead_prob_filters[0].dt == pytest.approx(0.06)
assert bosch_a.lead_prob_filters[0].dt == pytest.approx(DT_MDL)
assert bosch_a.kalman_params.A[0][1] == pytest.approx(HONDA_BOSCH_A_RADAR_TS)
@pytest.mark.skipif(platform.system() == "Darwin", reason="SocketEventHandle requires eventfd")
def test_radar_fault(self):
# if there's no radar-related can traffic, radard should either not respond or respond with an error