Hyundai: CAN-FD blindspot signals (#26229)

* Hyundai: CAN-FD blindspot signals

* fix that

* update refs
pull/26228/head
Adeeb Shihadeh 3 years ago committed by GitHub
parent 6d30b1ee83
commit 339253bc05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      opendbc
  2. 12
      selfdrive/car/hyundai/carstate.py
  3. 9
      selfdrive/car/hyundai/interface.py
  4. 2
      selfdrive/test/process_replay/ref_commit

@ -1 +1 @@
Subproject commit 7bd94e3ff4a2890eb69118f0dfadb64f9d32d618
Subproject commit a95b0ae8a5244a9d6311bf72aa2a7d63d41b4a9f

@ -187,6 +187,9 @@ class CarState(CarStateBase):
ret.leftBlinker, ret.rightBlinker = self.update_blinker_from_lamp(50, cp.vl["BLINKERS"]["LEFT_LAMP"],
cp.vl["BLINKERS"]["RIGHT_LAMP"])
if self.CP.enableBsm:
ret.leftBlindspot = cp.vl["BLINDSPOTS_REAR_CORNERS"]["FL_INDICATOR"] != 0
ret.rightBlindspot = cp.vl["BLINDSPOTS_REAR_CORNERS"]["FR_INDICATOR"] != 0
ret.cruiseState.available = True
self.is_metric = cp.vl["CLUSTER_INFO"]["DISTANCE_UNIT"] != 1
@ -450,6 +453,15 @@ class CarState(CarStateBase):
("DOORS_SEATBELTS", 4),
]
if CP.enableBsm:
signals += [
("FL_INDICATOR", "BLINDSPOTS_REAR_CORNERS"),
("FR_INDICATOR", "BLINDSPOTS_REAR_CORNERS"),
]
checks += [
("BLINDSPOTS_REAR_CORNERS", 20),
]
if CP.flags & HyundaiFlags.CANFD_HDA2 and not CP.openpilotLongitudinalControl:
signals += [
("CRUISE_STATUS", "CRUISE_INFO"),

@ -311,6 +311,13 @@ class CarInterface(CarInterfaceBase):
ret.vEgoStarting = 0.1
ret.startAccel = 2.0
# *** feature detection ***
if candidate in CANFD_CAR:
bus = 5 if ret.flags & HyundaiFlags.CANFD_HDA2 else 4
ret.enableBsm = 0x1e5 in fingerprint[bus]
else:
ret.enableBsm = 0x58b in fingerprint[0]
# *** panda safety config ***
if candidate in CANFD_CAR:
ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.noOutput),
@ -321,8 +328,6 @@ class CarInterface(CarInterfaceBase):
if ret.flags & HyundaiFlags.CANFD_ALT_BUTTONS:
ret.safetyConfigs[1].safetyParam |= Panda.FLAG_HYUNDAI_CANFD_ALT_BUTTONS
else:
ret.enableBsm = 0x58b in fingerprint[0]
if candidate in LEGACY_SAFETY_MODE_CAR:
# these cars require a special panda safety mode due to missing counters and checksums in the messages
ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.hyundaiLegacy)]

@ -1 +1 @@
9d042d06f61c8f48e8c7a4e30001630c14712272
68457035e9223fcbd70bd40966d5a1d9fe4f1567
Loading…
Cancel
Save