From ff3baa6e38dc07c199c143bbef6856a33fa0ac40 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Fri, 8 Jul 2022 21:40:34 -0700 Subject: [PATCH 1/2] EV6: supress LFA --- opendbc | 2 +- panda | 2 +- selfdrive/car/hyundai/carcontroller.py | 3 +++ selfdrive/car/hyundai/carstate.py | 5 ++++- selfdrive/car/hyundai/hda2can.py | 5 +++++ 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/opendbc b/opendbc index 1e9693ce0916b8..9fc90a9f5816ed 160000 --- a/opendbc +++ b/opendbc @@ -1 +1 @@ -Subproject commit 1e9693ce0916b896568dcd5558a670e67843c299 +Subproject commit 9fc90a9f5816ed82e0f25f2eaf7ad4af3d45733e diff --git a/panda b/panda index 53466f09344c8f..f8f0f97ae21717 160000 --- a/panda +++ b/panda @@ -1 +1 @@ -Subproject commit 53466f09344c8ff6cdce3b19df76b5bca79e1327 +Subproject commit f8f0f97ae21717b327549ca4c71d84800d398c65 diff --git a/selfdrive/car/hyundai/carcontroller.py b/selfdrive/car/hyundai/carcontroller.py index 73635375ad5810..a878ad3274c694 100644 --- a/selfdrive/car/hyundai/carcontroller.py +++ b/selfdrive/car/hyundai/carcontroller.py @@ -75,6 +75,9 @@ def update(self, CC, CS): # steering control can_sends.append(hda2can.create_lkas(self.packer, CC.enabled, self.frame, CC.latActive, apply_steer)) + if self.frame % 5 == 0: + can_sends.append(hda2can.create_cam_0x2a4(self.packer, self.frame, CS.cam_0x2a4)) + # cruise cancel if (self.frame - self.last_button_frame) * DT_CTRL > 0.25: if CC.cruiseControl.cancel: diff --git a/selfdrive/car/hyundai/carstate.py b/selfdrive/car/hyundai/carstate.py index 6c82c3385686c4..a10cdadbca75d6 100644 --- a/selfdrive/car/hyundai/carstate.py +++ b/selfdrive/car/hyundai/carstate.py @@ -172,6 +172,7 @@ def update_hda2(self, cp, cp_cam): ret.cruiseState.speed = cp.vl["CRUISE_INFO"]["SET_SPEED"] * speed_factor self.buttons_counter = cp.vl["CRUISE_BUTTONS"]["_COUNTER"] + self.cam_0x2a4 = copy.copy(cp_cam.vl["CAM_0x2a4"]) return ret @@ -313,7 +314,9 @@ def get_can_parser(CP): @staticmethod def get_cam_can_parser(CP): if CP.carFingerprint in HDA2_CAR: - return None + signals = [(f"BYTE{i}", "CAM_0x2a4") for i in range(3, 24)] + checks = [("CAM_0x2a4", 20)] + return CANParser(DBC[CP.carFingerprint]["pt"], signals, checks, 6) signals = [ # signal_name, signal_address diff --git a/selfdrive/car/hyundai/hda2can.py b/selfdrive/car/hyundai/hda2can.py index e4c658c1a9f133..437f5cf5388334 100644 --- a/selfdrive/car/hyundai/hda2can.py +++ b/selfdrive/car/hyundai/hda2can.py @@ -12,6 +12,11 @@ def create_lkas(packer, enabled, frame, lat_active, apply_steer): } return packer.make_can_msg("LKAS", 4, values, frame % 255) +def create_cam_0x2a4(packer, frame, camera_values): + camera_values.update({ + "BYTE7": 0, + }) + return packer.make_can_msg("CAM_0x2a4", 4, camera_values, frame % 255) def create_buttons(packer, cnt, cancel, resume): values = { From 09e64c952b4ce49bc172a954bb0ea58b6648eca9 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Fri, 8 Jul 2022 22:09:17 -0700 Subject: [PATCH 2/2] bump panda --- panda | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panda b/panda index f8f0f97ae21717..ca927fe9312651 160000 --- a/panda +++ b/panda @@ -1 +1 @@ -Subproject commit f8f0f97ae21717b327549ca4c71d84800d398c65 +Subproject commit ca927fe9312651a16f13aaddca8b46af5315ede6