Honda Bosch: detect alternate brake signal (#31500)

* Do Accord

* add comment

* good test

* this catches the accord/accordh issue!

* as expected, only if both radar&camera have in common FW does the test fail

* cmt

* clean up

* better

* Use HondaFlags

* detect alt brake

* for test

* hypothesis isn't installed

* test failure

* works

* Revert " works"

This reverts commit bfc0d808ab.

* Revert "test failure"

This reverts commit 10ab6eb63c.

* Revert "hypothesis isn't installed"

This reverts commit d474cc3f0e.

* Revert "for test"

This reverts commit 98e039f4fc.

* this is important too

* clean up

* more clean up

* Update ref_commit
pull/31502/head
Shane Smiskol 1 year ago committed by GitHub
parent 62f4eecf16
commit 2e8c62358c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      selfdrive/car/car_helpers.py
  2. 8
      selfdrive/car/honda/carstate.py
  3. 6
      selfdrive/car/honda/interface.py
  4. 2
      selfdrive/car/honda/values.py
  5. 2
      selfdrive/test/process_replay/ref_commit

@ -162,7 +162,7 @@ def fingerprint(logcan, sendcan, num_pandas):
cloudlog.warning("VIN %s", vin)
params.put("CarVin", vin)
# disable OBD multiplexing for potential ECU knockouts
# disable OBD multiplexing for CAN fingerprinting and potential ECU knockouts
set_obd_multiplexing(params, False)
params.put_bool("FirmwareQueryDone", True)

@ -7,8 +7,8 @@ from opendbc.can.can_define import CANDefine
from opendbc.can.parser import CANParser
from openpilot.selfdrive.car.honda.hondacan import get_cruise_speed_conversion, get_pt_bus
from openpilot.selfdrive.car.honda.values import CAR, DBC, STEER_THRESHOLD, HONDA_BOSCH, \
HONDA_NIDEC_ALT_SCM_MESSAGES, HONDA_BOSCH_ALT_BRAKE_SIGNAL, \
HONDA_BOSCH_RADARLESS
HONDA_NIDEC_ALT_SCM_MESSAGES, HONDA_BOSCH_RADARLESS, \
HondaFlags
from openpilot.selfdrive.car.interfaces import CarStateBase
TransmissionType = car.CarParams.TransmissionType
@ -44,7 +44,7 @@ def get_can_messages(CP, gearbox_msg):
else:
messages.append((gearbox_msg, 100))
if CP.carFingerprint in HONDA_BOSCH_ALT_BRAKE_SIGNAL:
if CP.flags & HondaFlags.BOSCH_ALT_BRAKE:
messages.append(("BRAKE_MODULE", 50))
if CP.carFingerprint in (HONDA_BOSCH | {CAR.CIVIC, CAR.ODYSSEY, CAR.ODYSSEY_CHN}):
@ -217,7 +217,7 @@ class CarState(CarStateBase):
else:
ret.cruiseState.speed = cp.vl["CRUISE"]["CRUISE_SPEED_PCM"] * CV.KPH_TO_MS
if self.CP.carFingerprint in HONDA_BOSCH_ALT_BRAKE_SIGNAL:
if self.CP.flags & HondaFlags.BOSCH_ALT_BRAKE:
ret.brakePressed = cp.vl["BRAKE_MODULE"]["BRAKE_PRESSED"] != 0
else:
# brake switch has shown some single time step noise, so only considered when

@ -3,8 +3,9 @@ from cereal import car
from panda import Panda
from openpilot.common.conversions import Conversions as CV
from openpilot.common.numpy_fast import interp
from openpilot.selfdrive.car.honda.hondacan import get_pt_bus
from openpilot.selfdrive.car.honda.values import CarControllerParams, CruiseButtons, HondaFlags, CAR, HONDA_BOSCH, HONDA_NIDEC_ALT_SCM_MESSAGES, \
HONDA_BOSCH_ALT_BRAKE_SIGNAL, HONDA_BOSCH_RADARLESS
HONDA_BOSCH_RADARLESS
from openpilot.selfdrive.car import create_button_events, get_safety_config
from openpilot.selfdrive.car.interfaces import CarInterfaceBase
from openpilot.selfdrive.car.disable_ecu import disable_ecu
@ -275,7 +276,8 @@ class CarInterface(CarInterfaceBase):
raise ValueError(f"unsupported car {candidate}")
# These cars use alternate user brake msg (0x1BE)
if candidate in HONDA_BOSCH_ALT_BRAKE_SIGNAL:
if 0x1BE in fingerprint[get_pt_bus(candidate)] and candidate in HONDA_BOSCH:
ret.flags |= HondaFlags.BOSCH_ALT_BRAKE.value
ret.safetyConfigs[0].safetyParam |= Panda.FLAG_HONDA_ALT_BRAKE
# These cars use alternate SCM messages (SCM_FEEDBACK AND SCM_BUTTON)

@ -49,6 +49,7 @@ class CarControllerParams:
class HondaFlags(IntFlag):
# Bosch models with alternate set of LKAS_HUD messages
BOSCH_EXT_HUD = 1
BOSCH_ALT_BRAKE = 2
# Car button codes
@ -252,5 +253,4 @@ HONDA_NIDEC_ALT_SCM_MESSAGES = {CAR.ACURA_ILX, CAR.ACURA_RDX, CAR.CRV, CAR.CRV_E
CAR.PILOT, CAR.RIDGELINE}
HONDA_BOSCH = {CAR.ACCORD, CAR.ACCORDH, CAR.CIVIC_BOSCH, CAR.CIVIC_BOSCH_DIESEL, CAR.CRV_5G,
CAR.CRV_HYBRID, CAR.INSIGHT, CAR.ACURA_RDX_3G, CAR.HONDA_E, CAR.CIVIC_2022, CAR.HRV_3G}
HONDA_BOSCH_ALT_BRAKE_SIGNAL = {CAR.ACCORD, CAR.CRV_5G, CAR.ACURA_RDX_3G, CAR.HRV_3G}
HONDA_BOSCH_RADARLESS = {CAR.CIVIC_2022, CAR.HRV_3G}

@ -1 +1 @@
7d25b1f7d0bd3b506fa4e72ff893728894eb1a45
1b16593e2d0c9ff2dae2916293ae5fbc7d6f26df

Loading…
Cancel
Save