diff --git a/opendbc b/opendbc index a1582f5e28..9a743d5081 160000 --- a/opendbc +++ b/opendbc @@ -1 +1 @@ -Subproject commit a1582f5e28fe0df23b6821c907188be477aac11c +Subproject commit 9a743d50815fcc3be738c4a87e8a526f50bef237 diff --git a/panda b/panda index aed103d537..b0b0f3c76d 160000 --- a/panda +++ b/panda @@ -1 +1 @@ -Subproject commit aed103d5372d1e5b3fb686d2aa8f111081b37fd0 +Subproject commit b0b0f3c76d1c39d6c4764291cf2209e7f29448f2 diff --git a/selfdrive/car/hyundai/carcontroller.py b/selfdrive/car/hyundai/carcontroller.py index 6af5f572da..6edb95e3e2 100644 --- a/selfdrive/car/hyundai/carcontroller.py +++ b/selfdrive/car/hyundai/carcontroller.py @@ -106,12 +106,13 @@ class CarController: if self.CP.carFingerprint in CANFD_CAR: hda2 = self.CP.flags & HyundaiFlags.CANFD_HDA2 hda2_long = hda2 and self.CP.openpilotLongitudinalControl + hda2_alt_steering = self.CP.flags & HyundaiFlags.CANFD_HDA2_ALT_STEERING # steering control can_sends.extend(hyundaicanfd.create_steering_messages(self.packer, self.CP, self.CAN, CC.enabled, apply_steer_req, apply_steer)) # disable LFA on HDA2 - if self.frame % 5 == 0 and hda2: + if self.frame % 5 == 0 and hda2 and not hda2_alt_steering: can_sends.append(hyundaicanfd.create_cam_0x2a4(self.packer, self.CAN, CS.cam_0x2a4)) # LFA and HDA icons diff --git a/selfdrive/car/hyundai/carstate.py b/selfdrive/car/hyundai/carstate.py index 2e3801c319..c3faec5740 100644 --- a/selfdrive/car/hyundai/carstate.py +++ b/selfdrive/car/hyundai/carstate.py @@ -227,7 +227,7 @@ class CarState(CarStateBase): self.buttons_counter = cp.vl[self.cruise_btns_msg_canfd]["COUNTER"] ret.accFaulted = cp.vl["TCS"]["ACCEnable"] != 0 # 0 ACC CONTROL ENABLED, 1-3 ACC CONTROL DISABLED - if self.CP.flags & HyundaiFlags.CANFD_HDA2: + if self.CP.flags & HyundaiFlags.CANFD_HDA2 and not self.CP.flags & HyundaiFlags.CANFD_HDA2_ALT_STEERING: self.cam_0x2a4 = copy.copy(cp_cam.vl["CAM_0x2a4"]) return ret @@ -330,7 +330,7 @@ class CarState(CarStateBase): @staticmethod def get_cam_can_parser_canfd(CP): messages = [] - if CP.flags & HyundaiFlags.CANFD_HDA2: + if CP.flags & HyundaiFlags.CANFD_HDA2 and not CP.flags & HyundaiFlags.CANFD_HDA2_ALT_STEERING: messages += [("CAM_0x2a4", 20)] elif CP.flags & HyundaiFlags.CANFD_CAMERA_SCC: messages += [ diff --git a/selfdrive/car/hyundai/hyundaicanfd.py b/selfdrive/car/hyundai/hyundaicanfd.py index e78e02ae50..7ebb8b52c3 100644 --- a/selfdrive/car/hyundai/hyundaicanfd.py +++ b/selfdrive/car/hyundai/hyundaicanfd.py @@ -52,9 +52,10 @@ def create_steering_messages(packer, CP, CAN, enabled, lat_active, apply_steer): } if CP.flags & HyundaiFlags.CANFD_HDA2: + hda2_steering_msg = "LKAS_ALT" if CP.flags & HyundaiFlags.CANFD_HDA2_ALT_STEERING else "LKAS" if CP.openpilotLongitudinalControl: ret.append(packer.make_can_msg("LFA", CAN.ECAN, values)) - ret.append(packer.make_can_msg("LKAS", CAN.ACAN, values)) + ret.append(packer.make_can_msg(hda2_steering_msg, CAN.ACAN, values)) else: ret.append(packer.make_can_msg("LFA", CAN.ECAN, values)) diff --git a/selfdrive/car/hyundai/interface.py b/selfdrive/car/hyundai/interface.py index 3e25863f46..76399181bf 100644 --- a/selfdrive/car/hyundai/interface.py +++ b/selfdrive/car/hyundai/interface.py @@ -28,7 +28,7 @@ class CarInterface(CarInterfaceBase): # These cars have been put into dashcam only due to both a lack of users and test coverage. # These cars likely still work fine. Once a user confirms each car works and a test route is # added to selfdrive/car/tests/routes.py, we can remove it from this list. - ret.dashcamOnly = candidate in {CAR.KIA_OPTIMA_H, CAR.IONIQ_6} + ret.dashcamOnly = candidate in {CAR.KIA_OPTIMA_H, } hda2 = Ecu.adas in [fw.ecu for fw in car_fw] CAN = CanBus(None, hda2, fingerprint) @@ -37,6 +37,8 @@ class CarInterface(CarInterfaceBase): # detect HDA2 with ADAS Driving ECU if hda2: ret.flags |= HyundaiFlags.CANFD_HDA2.value + if 0x50 not in fingerprint[CAN.CAM]: + ret.flags |= HyundaiFlags.CANFD_HDA2_ALT_STEERING.value else: # non-HDA2 if 0x1cf not in fingerprint[CAN.ECAN]: @@ -274,6 +276,8 @@ class CarInterface(CarInterfaceBase): if ret.flags & HyundaiFlags.CANFD_HDA2: ret.safetyConfigs[-1].safetyParam |= Panda.FLAG_HYUNDAI_CANFD_HDA2 + if ret.flags & HyundaiFlags.CANFD_HDA2_ALT_STEERING: + ret.safetyConfigs[-1].safetyParam |= Panda.FLAG_HYUNDAI_CANFD_HDA2_ALT_STEERING if ret.flags & HyundaiFlags.CANFD_ALT_BUTTONS: ret.safetyConfigs[-1].safetyParam |= Panda.FLAG_HYUNDAI_CANFD_ALT_BUTTONS if ret.flags & HyundaiFlags.CANFD_CAMERA_SCC: diff --git a/selfdrive/car/hyundai/values.py b/selfdrive/car/hyundai/values.py index 5a137267ad..e6e6f8668b 100644 --- a/selfdrive/car/hyundai/values.py +++ b/selfdrive/car/hyundai/values.py @@ -64,6 +64,7 @@ class HyundaiFlags(IntFlag): CANFD_ALT_GEARS_2 = 64 SEND_LFA = 128 USE_FCA = 256 + CANFD_HDA2_ALT_STEERING = 512 class CAR: