diff --git a/opendbc b/opendbc index 7bd94e3ff4..a95b0ae8a5 160000 --- a/opendbc +++ b/opendbc @@ -1 +1 @@ -Subproject commit 7bd94e3ff4a2890eb69118f0dfadb64f9d32d618 +Subproject commit a95b0ae8a5244a9d6311bf72aa2a7d63d41b4a9f diff --git a/selfdrive/car/hyundai/carstate.py b/selfdrive/car/hyundai/carstate.py index e27432e23b..ec2b3059a3 100644 --- a/selfdrive/car/hyundai/carstate.py +++ b/selfdrive/car/hyundai/carstate.py @@ -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"), diff --git a/selfdrive/car/hyundai/interface.py b/selfdrive/car/hyundai/interface.py index 114d124a38..147c766008 100644 --- a/selfdrive/car/hyundai/interface.py +++ b/selfdrive/car/hyundai/interface.py @@ -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)] diff --git a/selfdrive/test/process_replay/ref_commit b/selfdrive/test/process_replay/ref_commit index 604abd666c..44eed18493 100644 --- a/selfdrive/test/process_replay/ref_commit +++ b/selfdrive/test/process_replay/ref_commit @@ -1 +1 @@ -9d042d06f61c8f48e8c7a4e30001630c14712272 \ No newline at end of file +68457035e9223fcbd70bd40966d5a1d9fe4f1567 \ No newline at end of file