From 67177b2ca393f51a45a97fcdac14be454b224c8c Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Tue, 29 Aug 2023 01:58:43 -0400 Subject: [PATCH] Hyundai CAN-FD HDA2: specify signals to suppress LFA (#29658) * Hyundai CAN-FD HDA2: specify signals to suppress LFA * bump opendbc * Fix * Update comment * fix * closer to original * preserve behavior * Revert "preserve behavior" This reverts commit 6549c085ab6bdd093f7668e7df79cd85350bc028. * preserve behavior --------- Co-authored-by: Shane Smiskol --- opendbc | 2 +- selfdrive/car/hyundai/carcontroller.py | 2 +- selfdrive/car/hyundai/hyundaicanfd.py | 9 ++++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/opendbc b/opendbc index 25dd2b50fc..814763889d 160000 --- a/opendbc +++ b/opendbc @@ -1 +1 @@ -Subproject commit 25dd2b50fc93ff6a25b99b72c664b9c37413097d +Subproject commit 814763889df3d1f19112a9628dfb4d1f17c0c533 diff --git a/selfdrive/car/hyundai/carcontroller.py b/selfdrive/car/hyundai/carcontroller.py index 8dcf89c4d5..b66deb5239 100644 --- a/selfdrive/car/hyundai/carcontroller.py +++ b/selfdrive/car/hyundai/carcontroller.py @@ -110,7 +110,7 @@ class CarController: # 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 + # prevent LFA from activating on HDA2 by sending "no lane lines detected" to ADAS ECU if self.frame % 5 == 0 and hda2: can_sends.append(hyundaicanfd.create_cam_0x2a4(self.packer, self.CAN, CS.cam_0x2a4)) diff --git a/selfdrive/car/hyundai/hyundaicanfd.py b/selfdrive/car/hyundai/hyundaicanfd.py index 1ad0963024..b70486b99f 100644 --- a/selfdrive/car/hyundai/hyundaicanfd.py +++ b/selfdrive/car/hyundai/hyundaicanfd.py @@ -61,9 +61,12 @@ def create_steering_messages(packer, CP, CAN, enabled, lat_active, apply_steer): return ret def create_cam_0x2a4(packer, CAN, cam_0x2a4): - values = {f"BYTE{i}": cam_0x2a4[f"BYTE{i}"] for i in range(3, 24)} - values['COUNTER'] = cam_0x2a4['COUNTER'] - values["BYTE7"] = 0 + values = {f"BYTE{i}": cam_0x2a4[f"BYTE{i}"] for i in range(3, 24) if i != 7} + values["COUNTER"] = cam_0x2a4["COUNTER"] + values["SET_ME_0"] = 0 + values["SET_ME_0_2"] = 0 + values["LEFT_LANE_LINE"] = 0 + values["RIGHT_LANE_LINE"] = 0 return packer.make_can_msg("CAM_0x2a4", CAN.ACAN, values) def create_buttons(packer, CP, CAN, cnt, btn):