From 54b7f5961c2e108bdff2385fcef59c55f903b4e9 Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 22 Oct 2024 11:29:57 -0400 Subject: [PATCH 001/316] init --- opendbc/car/hyundai/carstate.py | 2 +- opendbc/car/hyundai/fingerprints.py | 8 ++++++++ opendbc/car/hyundai/values.py | 6 ++++++ opendbc/car/torque_data/override.toml | 1 + 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index 9406d858fba..cc74796b8c7 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -218,7 +218,7 @@ def update_canfd(self, cp, cp_cam) -> structs.CarState: # TODO: alt signal usage may be described by cp.vl['BLINKERS']['USE_ALT_LAMP'] left_blinker_sig, right_blinker_sig = "LEFT_LAMP", "RIGHT_LAMP" - if self.CP.carFingerprint == CAR.HYUNDAI_KONA_EV_2ND_GEN: + if self.CP.carFingerprint in (CAR.HYUNDAI_KONA_EV_2ND_GEN, CAR.HYUNDAI_SONATA_2024): left_blinker_sig, right_blinker_sig = "LEFT_LAMP_ALT", "RIGHT_LAMP_ALT" ret.leftBlinker, ret.rightBlinker = self.update_blinker_from_lamp(50, cp.vl["BLINKERS"][left_blinker_sig], cp.vl["BLINKERS"][right_blinker_sig]) diff --git a/opendbc/car/hyundai/fingerprints.py b/opendbc/car/hyundai/fingerprints.py index 7496e2bff01..59384c0b60b 100644 --- a/opendbc/car/hyundai/fingerprints.py +++ b/opendbc/car/hyundai/fingerprints.py @@ -196,6 +196,14 @@ b'\xf1\x00DN8 MFC AT USA LHD 1.00 1.07 99211-L1000 211223', ], }, + CAR.HYUNDAI_SONATA_2024: { + (Ecu.fwdRadar, 0x7d0, None): [ + b'\xf1\x00DN8_ RDR ----- 1.00 1.00 99110-L1800 ', + ], + (Ecu.fwdCamera, 0x7c4, None): [ + b'\xf1\x00DN8 MFC AT USA LHD 1.00 1.01 99211-L1800 230512' + ], + }, CAR.HYUNDAI_SONATA_LF: { (Ecu.fwdRadar, 0x7d0, None): [ b'\xf1\x00LF__ SCC F-CUP 1.00 1.00 96401-C2200 ', diff --git a/opendbc/car/hyundai/values.py b/opendbc/car/hyundai/values.py index 2eeb3376361..0b5b609eaa3 100644 --- a/opendbc/car/hyundai/values.py +++ b/opendbc/car/hyundai/values.py @@ -271,6 +271,12 @@ class CAR(Platforms): CarSpecs(mass=1513, wheelbase=2.84, steerRatio=13.27 * 1.15, tireStiffnessFactor=0.65), # 15% higher at the center seems reasonable flags=HyundaiFlags.MANDO_RADAR | HyundaiFlags.CHECKSUM_CRC8, ) + HYUNDAI_SONATA_2024 = HyundaiCanFDPlatformConfig( + [HyundaiCarDocs("Hyundai Sonata 2024", "All", car_parts=CarParts.common([CarHarness.hyundai_a]))], + CarSpecs(mass=1556, wheelbase=2.84, steerRatio=12.81 * 1.15, tireStiffnessFactor=0.65), + # TODO: confirm steerRatio increase + # TODO: confirm tireStiffnessFactor + ) HYUNDAI_SONATA_LF = HyundaiPlatformConfig( [HyundaiCarDocs("Hyundai Sonata 2018-19", car_parts=CarParts.common([CarHarness.hyundai_e]))], CarSpecs(mass=1536, wheelbase=2.804, steerRatio=13.27 * 1.15), # 15% higher at the center seems reasonable diff --git a/opendbc/car/torque_data/override.toml b/opendbc/car/torque_data/override.toml index aad06e8e3e5..936bb69fb28 100644 --- a/opendbc/car/torque_data/override.toml +++ b/opendbc/car/torque_data/override.toml @@ -72,6 +72,7 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"] "HYUNDAI_STARIA_4TH_GEN" = [1.8, 2.0, 0.15] "GENESIS_GV70_ELECTRIFIED_1ST_GEN" = [1.9, 1.9, 0.09] "GENESIS_G80_2ND_GEN_FL" = [2.5819356441497803, 2.5, 0.11244568973779678] +"HYUNDAI_SONATA_2024" = [2.5, 2.5, 0.1] # Dashcam or fallback configured as ideal car "MOCK" = [10.0, 10, 0.0] From 7a276a63691d010746a1acd99f0d7f3de21c8ca9 Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 12 Nov 2024 14:11:07 -0500 Subject: [PATCH 002/316] Update routes.py --- opendbc/car/tests/routes.py | 1 + 1 file changed, 1 insertion(+) diff --git a/opendbc/car/tests/routes.py b/opendbc/car/tests/routes.py index 2e1eca29a0d..3252b22bfbb 100644 --- a/opendbc/car/tests/routes.py +++ b/opendbc/car/tests/routes.py @@ -130,6 +130,7 @@ class CarTestRoute(NamedTuple): CarTestRoute("6a42c1197b2a8179|2023-09-21--10-23-44", HYUNDAI.KIA_OPTIMA_H_G4_FL), CarTestRoute("c75a59efa0ecd502|2021-03-11--20-52-55", HYUNDAI.KIA_SELTOS), CarTestRoute("5b7c365c50084530|2020-04-15--16-13-24", HYUNDAI.HYUNDAI_SONATA), + CarTestRoute("4267ea8a353cdb36/00000262--8a427003c7", HYUNDAI.HYUNDAI_SONATA_2024), CarTestRoute("b2a38c712dcf90bd|2020-05-18--18-12-48", HYUNDAI.HYUNDAI_SONATA_LF), CarTestRoute("c344fd2492c7a9d2|2023-12-11--09-03-23", HYUNDAI.HYUNDAI_STARIA_4TH_GEN), CarTestRoute("fb3fd42f0baaa2f8|2022-03-30--15-25-05", HYUNDAI.HYUNDAI_TUCSON), From f6f32d6e940c122630ef029704076cb03be32919 Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 21 Nov 2024 17:51:19 -0500 Subject: [PATCH 003/316] remove todo --- opendbc/car/hyundai/values.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/opendbc/car/hyundai/values.py b/opendbc/car/hyundai/values.py index 213c50ebfbc..d4ff1f2c53d 100644 --- a/opendbc/car/hyundai/values.py +++ b/opendbc/car/hyundai/values.py @@ -274,8 +274,6 @@ class CAR(Platforms): HYUNDAI_SONATA_2024 = HyundaiCanFDPlatformConfig( [HyundaiCarDocs("Hyundai Sonata 2024", "All", car_parts=CarParts.common([CarHarness.hyundai_a]))], CarSpecs(mass=1556, wheelbase=2.84, steerRatio=12.81 * 1.15, tireStiffnessFactor=0.65), - # TODO: confirm steerRatio increase - # TODO: confirm tireStiffnessFactor ) HYUNDAI_SONATA_LF = HyundaiPlatformConfig( [HyundaiCarDocs("Hyundai Sonata 2018-19", car_parts=CarParts.common([CarHarness.hyundai_e]))], From e87ae0190cc9e6d822dfe17b6bdc6d4c82e84df5 Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 21 Nov 2024 17:51:46 -0500 Subject: [PATCH 004/316] use default tireStiffnessFactor --- opendbc/car/hyundai/values.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/values.py b/opendbc/car/hyundai/values.py index d4ff1f2c53d..1f39d133065 100644 --- a/opendbc/car/hyundai/values.py +++ b/opendbc/car/hyundai/values.py @@ -273,7 +273,7 @@ class CAR(Platforms): ) HYUNDAI_SONATA_2024 = HyundaiCanFDPlatformConfig( [HyundaiCarDocs("Hyundai Sonata 2024", "All", car_parts=CarParts.common([CarHarness.hyundai_a]))], - CarSpecs(mass=1556, wheelbase=2.84, steerRatio=12.81 * 1.15, tireStiffnessFactor=0.65), + CarSpecs(mass=1556, wheelbase=2.84, steerRatio=12.81 * 1.15), ) HYUNDAI_SONATA_LF = HyundaiPlatformConfig( [HyundaiCarDocs("Hyundai Sonata 2018-19", car_parts=CarParts.common([CarHarness.hyundai_e]))], From 062d866e09acef0e2f86ab4ebd6d3d5eb988d6b9 Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 21 Nov 2024 17:52:00 -0500 Subject: [PATCH 005/316] remove steerRatio factor --- opendbc/car/hyundai/values.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/values.py b/opendbc/car/hyundai/values.py index 1f39d133065..4b726757d32 100644 --- a/opendbc/car/hyundai/values.py +++ b/opendbc/car/hyundai/values.py @@ -273,7 +273,7 @@ class CAR(Platforms): ) HYUNDAI_SONATA_2024 = HyundaiCanFDPlatformConfig( [HyundaiCarDocs("Hyundai Sonata 2024", "All", car_parts=CarParts.common([CarHarness.hyundai_a]))], - CarSpecs(mass=1556, wheelbase=2.84, steerRatio=12.81 * 1.15), + CarSpecs(mass=1556, wheelbase=2.84, steerRatio=12.81), ) HYUNDAI_SONATA_LF = HyundaiPlatformConfig( [HyundaiCarDocs("Hyundai Sonata 2018-19", car_parts=CarParts.common([CarHarness.hyundai_e]))], From 6344abc79b2e823b09a0b40ed7e29e4627aa06b1 Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 28 Nov 2024 18:06:34 -0500 Subject: [PATCH 006/316] add new messages --- opendbc/dbc/hyundai_canfd.dbc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/opendbc/dbc/hyundai_canfd.dbc b/opendbc/dbc/hyundai_canfd.dbc index 1ef67c044a9..1802ef92f67 100644 --- a/opendbc/dbc/hyundai_canfd.dbc +++ b/opendbc/dbc/hyundai_canfd.dbc @@ -658,6 +658,19 @@ BO_ 1264 LOCAL_TIME: 8 XXX SG_ MINUTES : 21|6@0+ (1,0) [0|63] "" XXX SG_ SECONDS : 31|8@0+ (1,0) [0|59] "" XXX +BO_ 353 NEW_MSG_161: 32 XXX + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ LKA_ICON : 30|2@1+ (1,0) [0|3] "" XXX + SG_ SSC_CONDITIONS_NOT_MET : 154|1@0+ (1,0) [0|1] "" XXX + SG_ LFA_ICON : 224|1@0+ (1,0) [0|1] "" XXX + +BO_ 354 NEW_MSG_162: 32 XXX + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ FAULT_1 : 219|1@0+ (1,0) [0|1] "" XXX + SG_ FAULT_2 : 246|1@0+ (1,0) [0|1] "" XXX + CM_ 272 "Alternative LKAS message, used on cars such as 2023 Ioniq 6, 2nd gen Kona. Matches LKAS except size is 32 bytes"; CM_ 676 "Contains signals with detailed lane line information. Used by ADAS ECU on HDA 2 vehicles to operate LFA."; CM_ 866 "Contains signals with detailed lane line information. Used by ADAS ECU on HDA 2 vehicles to operate LFA. Used on cars that use message 272."; From 3743da824d60556d2acae7a401662732326149c6 Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 28 Nov 2024 18:11:50 -0500 Subject: [PATCH 007/316] block faults --- opendbc/car/hyundai/carcontroller.py | 1 + opendbc/car/hyundai/carstate.py | 8 +++++++- opendbc/car/hyundai/hyundaicanfd.py | 8 ++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/carcontroller.py b/opendbc/car/hyundai/carcontroller.py index b0ef691edcd..c66379051e2 100644 --- a/opendbc/car/hyundai/carcontroller.py +++ b/opendbc/car/hyundai/carcontroller.py @@ -117,6 +117,7 @@ def update(self, CC, CS, now_nanos): # LFA and HDA icons if self.frame % 5 == 0 and (not hda2 or hda2_long): can_sends.append(hyundaicanfd.create_lfahda_cluster(self.packer, self.CAN, CC.enabled)) + can_sends.append(hyundaicanfd.block_faults(self.packer, self.CAN, CC.enabled, CS.block_faults)) # blinkers if hda2 and self.CP.flags & HyundaiFlags.ENABLE_BLINKERS: diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index e436c872d05..8dfffc30b21 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -50,6 +50,7 @@ def __init__(self, CP): self.buttons_counter = 0 self.cruise_info = {} + self.block_faults = {} # On some cars, CLU15->CF_Clu_VehicleSpeed can oscillate faster than the dash updates. Sample at 5 Hz self.cluster_speed = 0 @@ -267,6 +268,8 @@ def update_canfd(self, can_parsers) -> structs.CarState: ret.buttonEvents = [*create_button_events(self.cruise_buttons[-1], prev_cruise_buttons, BUTTONS_DICT), *create_button_events(self.main_buttons[-1], prev_main_buttons, {1: ButtonType.mainCruise})] + self.block_faults = copy.copy(cp_cam.vl["NEW_MSG_162"]) + return ret def get_can_parsers_canfd(self, CP): @@ -314,7 +317,10 @@ def get_can_parsers_canfd(self, CP): cam_messages += [ ("SCC_CONTROL", 50), ] - + cam_messages += [ + ("NEW_MSG_162", 20), + ] + return { Bus.pt: CANParser(DBC[CP.carFingerprint][Bus.pt], pt_messages, CanBus(CP).ECAN), Bus.cam: CANParser(DBC[CP.carFingerprint][Bus.pt], cam_messages, CanBus(CP).CAM), diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index d3488ff5313..cc3db250701 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -119,6 +119,14 @@ def create_lfahda_cluster(packer, CAN, enabled): } return packer.make_can_msg("LFAHDA_CLUSTER", CAN.ECAN, values) +def block_faults(packer, CAN, enabled, block_faults): + values = {s: block_faults[s] for s in block_faults.keys()} + values.update({ + "FAULT_1": 0, + "FAULT_2": 0, + }) + return packer.make_can_msg("NEW_MSG_162", CAN.ECAN, values) + def create_acc_control(packer, CAN, enabled, accel_last, accel, stopping, gas_override, set_speed, hud_control): jerk = 5 From 480c475d176fa7c048a7b1cc0de0556fd7ff4645 Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 28 Nov 2024 18:38:12 -0500 Subject: [PATCH 008/316] fix whitespace --- opendbc/car/hyundai/carstate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index 8dfffc30b21..9425debe790 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -320,7 +320,7 @@ def get_can_parsers_canfd(self, CP): cam_messages += [ ("NEW_MSG_162", 20), ] - + return { Bus.pt: CANParser(DBC[CP.carFingerprint][Bus.pt], pt_messages, CanBus(CP).ECAN), Bus.cam: CANParser(DBC[CP.carFingerprint][Bus.pt], cam_messages, CanBus(CP).CAM), From 264c08db9fe9f1bab1d704863e8f474362f2ec2f Mon Sep 17 00:00:00 2001 From: royjr Date: Sun, 1 Dec 2024 17:21:20 -0500 Subject: [PATCH 009/316] fix fp --- opendbc/car/hyundai/fingerprints.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/opendbc/car/hyundai/fingerprints.py b/opendbc/car/hyundai/fingerprints.py index 4a050cbadc2..df8cd21f46c 100644 --- a/opendbc/car/hyundai/fingerprints.py +++ b/opendbc/car/hyundai/fingerprints.py @@ -199,10 +199,11 @@ }, CAR.HYUNDAI_SONATA_2024: { (Ecu.fwdRadar, 0x7d0, None): [ - b'\xf1\x00DN8_ RDR ----- 1.00 1.00 99110-L1800 ', + b'\xf1\x00DN8_ RDR ----- 1.00 1.00 99110-L1800 ', ], (Ecu.fwdCamera, 0x7c4, None): [ - b'\xf1\x00DN8 MFC AT USA LHD 1.00 1.01 99211-L1800 230512' + b'\xf1\x00DN8 MFC AT USA LHD 1.00 1.01 99211-L1800 230512', + b'\xf1\x00DN8 MFC AT KOR LHD 1.00 1.01 99211-L1800 230512', ], }, CAR.HYUNDAI_SONATA_LF: { From 029cf05951c9027930b604d4ce83f7d815af788b Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 7 Dec 2024 16:11:30 -0500 Subject: [PATCH 010/316] Update carcontroller.py --- opendbc/car/hyundai/carcontroller.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/opendbc/car/hyundai/carcontroller.py b/opendbc/car/hyundai/carcontroller.py index c66379051e2..aab3122be03 100644 --- a/opendbc/car/hyundai/carcontroller.py +++ b/opendbc/car/hyundai/carcontroller.py @@ -115,9 +115,11 @@ def update(self, CC, CS, now_nanos): self.CP.flags & HyundaiFlags.CANFD_HDA2_ALT_STEERING)) # LFA and HDA icons - if self.frame % 5 == 0 and (not hda2 or hda2_long): + if self.frame % 5 == 0 and (not hda2 or hda2_long) and self.car_fingerprint not in (CAR.HYUNDAI_SONATA_2024,): can_sends.append(hyundaicanfd.create_lfahda_cluster(self.packer, self.CAN, CC.enabled)) - can_sends.append(hyundaicanfd.block_faults(self.packer, self.CAN, CC.enabled, CS.block_faults)) + if self.frame % 5 == 0 and (not hda2 or hda2_long) and self.car_fingerprint in (CAR.HYUNDAI_SONATA_2024,): + can_sends.append(hyundaicanfd.create_msg_161(self.packer, self.CAN, CC.enabled, CS.msg_161)) + can_sends.append(hyundaicanfd.create_msg_162(self.packer, self.CAN, CC.enabled, CS.msg_162)) # blinkers if hda2 and self.CP.flags & HyundaiFlags.ENABLE_BLINKERS: From 205c6a489636a6a3d2c4f45ac478267d6ab5a17f Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 7 Dec 2024 16:12:49 -0500 Subject: [PATCH 011/316] Update carstate.py --- opendbc/car/hyundai/carstate.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index 9425debe790..06fd94214e4 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -50,7 +50,8 @@ def __init__(self, CP): self.buttons_counter = 0 self.cruise_info = {} - self.block_faults = {} + self.msg_161 = {} + self.msg_162 = {} # On some cars, CLU15->CF_Clu_VehicleSpeed can oscillate faster than the dash updates. Sample at 5 Hz self.cluster_speed = 0 @@ -230,8 +231,9 @@ def update_canfd(self, can_parsers) -> structs.CarState: ret.leftBlinker, ret.rightBlinker = self.update_blinker_from_lamp(50, cp.vl["BLINKERS"][left_blinker_sig], cp.vl["BLINKERS"][right_blinker_sig]) if self.CP.enableBsm: - ret.leftBlindspot = cp.vl["BLINDSPOTS_REAR_CORNERS"]["FL_INDICATOR"] != 0 - ret.rightBlindspot = cp.vl["BLINDSPOTS_REAR_CORNERS"]["FR_INDICATOR"] != 0 + alt = "_ALT" if self.CP.carFingerprint == CAR.HYUNDAI_SONATA_2024 else "" + ret.leftBlindspot = cp.vl["BLINDSPOTS_REAR_CORNERS"][f"FL_INDICATOR{alt}"] != 0 + ret.rightBlindspot = cp.vl["BLINDSPOTS_REAR_CORNERS"][f"FR_INDICATOR{alt}"] != 0 # cruise state # CAN FD cars enable on main button press, set available if no TCS faults preventing engagement @@ -268,7 +270,9 @@ def update_canfd(self, can_parsers) -> structs.CarState: ret.buttonEvents = [*create_button_events(self.cruise_buttons[-1], prev_cruise_buttons, BUTTONS_DICT), *create_button_events(self.main_buttons[-1], prev_main_buttons, {1: ButtonType.mainCruise})] - self.block_faults = copy.copy(cp_cam.vl["NEW_MSG_162"]) + if self.CP.carFingerprint in (CAR.HYUNDAI_SONATA_2024,): + self.msg_161 = copy.copy(cp_cam.vl["MSG_161"]) + self.msg_162 = copy.copy(cp_cam.vl["MSG_162"]) return ret @@ -317,9 +321,11 @@ def get_can_parsers_canfd(self, CP): cam_messages += [ ("SCC_CONTROL", 50), ] - cam_messages += [ - ("NEW_MSG_162", 20), - ] + if self.CP.carFingerprint in (CAR.HYUNDAI_SONATA_2024,): + cam_messages += [ + ("MSG_161", 20), + ("MSG_162", 20), + ] return { Bus.pt: CANParser(DBC[CP.carFingerprint][Bus.pt], pt_messages, CanBus(CP).ECAN), From adc668f4964f7f7a5cac6bc471108949ce40e3e9 Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 7 Dec 2024 16:13:35 -0500 Subject: [PATCH 012/316] Update hyundaicanfd.py --- opendbc/car/hyundai/hyundaicanfd.py | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index cc3db250701..62d8f1694bf 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -119,14 +119,30 @@ def create_lfahda_cluster(packer, CAN, enabled): } return packer.make_can_msg("LFAHDA_CLUSTER", CAN.ECAN, values) -def block_faults(packer, CAN, enabled, block_faults): - values = {s: block_faults[s] for s in block_faults.keys()} +def create_msg_161(packer, CAN, enabled, msg_161): + values = msg_161.copy() values.update({ - "FAULT_1": 0, - "FAULT_2": 0, + "LFA_ICON": 2 if enabled else 0, + "LKA_ICON": 4 if enabled else 0, + "LANELINE_LEFT": 2 if enabled else 0, + "LANELINE_RIGHT": 2 if enabled else 0, + "CENTERLINE": 1 if enabled else 0, + "DAW_ICON": 0, }) - return packer.make_can_msg("NEW_MSG_162", CAN.ECAN, values) - + if values.get("ALERTS_5") == 5: # use_switch_or_pedal_to_accelerate + values["ALERTS_5"] = 0 + if values.get("ALERTS_2") == 5: # coffee + values.update({"ALERTS_2": 0, "SOUNDS_2": 0}) + return packer.make_can_msg("MSG_161", CAN.ECAN, values) + +def create_msg_162(packer, CAN, enabled, msg_162): + values = msg_162.copy() + values.update({ + "FAULT_LSS": 0, + "FAULT_HDA": 0, + "FAULT_DAS": 0, + }) + return packer.make_can_msg("MSG_162", CAN.ECAN, values) def create_acc_control(packer, CAN, enabled, accel_last, accel, stopping, gas_override, set_speed, hud_control): jerk = 5 From d8c0c389e7f1d8bdabe80b7fd4091dd7fbdf0c53 Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 7 Dec 2024 16:14:10 -0500 Subject: [PATCH 013/316] Update hyundai_canfd.dbc --- opendbc/dbc/hyundai_canfd.dbc | 123 ++++++++++++++++++++++++++++++---- 1 file changed, 111 insertions(+), 12 deletions(-) diff --git a/opendbc/dbc/hyundai_canfd.dbc b/opendbc/dbc/hyundai_canfd.dbc index 1802ef92f67..9d28bc84c4f 100644 --- a/opendbc/dbc/hyundai_canfd.dbc +++ b/opendbc/dbc/hyundai_canfd.dbc @@ -599,6 +599,8 @@ BO_ 442 BLINDSPOTS_REAR_CORNERS: 24 XXX SG_ FL_INDICATOR : 46|6@0+ (1,0) [0|1] "" XXX SG_ FR_INDICATOR : 54|6@0+ (1,0) [0|63] "" XXX SG_ RIGHT_BLOCKED : 64|1@0+ (1,0) [0|1] "" XXX + SG_ FL_INDICATOR_ALT : 138|1@0+ (1,0) [0|1] "" XXX + SG_ FR_INDICATOR_ALT : 141|1@0+ (1,0) [0|1] "" XXX BO_ 874 BLINDSPOTS_FRONT_CORNER_2: 16 XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX @@ -658,18 +660,115 @@ BO_ 1264 LOCAL_TIME: 8 XXX SG_ MINUTES : 21|6@0+ (1,0) [0|63] "" XXX SG_ SECONDS : 31|8@0+ (1,0) [0|59] "" XXX -BO_ 353 NEW_MSG_161: 32 XXX - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ LKA_ICON : 30|2@1+ (1,0) [0|3] "" XXX - SG_ SSC_CONDITIONS_NOT_MET : 154|1@0+ (1,0) [0|1] "" XXX - SG_ LFA_ICON : 224|1@0+ (1,0) [0|1] "" XXX - -BO_ 354 NEW_MSG_162: 32 XXX - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ FAULT_1 : 219|1@0+ (1,0) [0|1] "" XXX - SG_ FAULT_2 : 246|1@0+ (1,0) [0|1] "" XXX +BO_ 353 MSG_161: 32 CCNC + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ FCA_ICON : 24|3@1+ (1,0) [0|7] "" XXX + SG_ FCA_ALT_ICON : 27|3@1+ (1,0) [0|7] "" XXX + SG_ LKA_ICON : 30|3@1+ (1,0) [0|3] "" XXX + SG_ HBA_ICON : 33|3@1+ (1,0) [0|7] "" XXX + SG_ ZEROS_1 : 36|4@1+ (1,0) [0|15] "" XXX + SG_ ZEROS_2 : 40|2@1+ (1,0) [0|3] "" XXX + SG_ FCA_IMAGE : 42|3@1+ (1,0) [0|7] "" XXX + SG_ ZEROS_3 : 45|3@1+ (1,0) [0|7] "" XXX + SG_ ZEROS_4 : 48|3@1+ (1,0) [0|7] "" XXX + SG_ BCA_LEFT : 51|3@1+ (1,0) [0|7] "" XXX + SG_ BCA_RIGHT : 54|3@1+ (1,0) [0|7] "" XXX + SG_ LCA_LEFT_ARROW : 57|3@1+ (1,0) [0|7] "" XXX + SG_ LCA_RIGHT_ARROW : 60|3@1+ (1,0) [0|7] "" XXX + SG_ ZEROS_5 : 63|1@0+ (1,0) [0|1] "" XXX + SG_ CENTERLINE : 64|2@1+ (1,0) [0|3] "" XXX + SG_ TARGET : 66|3@1+ (1,0) [0|7] "" XXX + SG_ TARGET_POSITION : 69|11@1+ (1,0) [0|7] "" XXX + SG_ LANELINE_LEFT : 80|4@1+ (1,0) [0|15] "" XXX + SG_ LANELINE_LEFT_POSITION : 84|6@1+ (1,0) [0|15] "" XXX + SG_ LANELINE_RIGHT : 90|4@1+ (1,0) [0|15] "" XXX + SG_ LANELINE_RIGHT_POSITION : 94|6@1+ (1,0) [0|3] "" XXX + SG_ LANELINE_CURVATURE : 100|5@1- (1,15) [0|31] "" XXX + SG_ LANE_HIGHLIGHT : 105|4@1+ (1,0) [0|15] "" XXX + SG_ LANE_HIGHLIGHT_DISTANCE : 109|11@1+ (1,0) [0|7] "" XXX + SG_ LANE_LEFT : 120|3@1+ (1,0) [0|7] "" XXX + SG_ LANE_RIGHT : 123|3@1+ (1,0) [0|7] "" XXX + SG_ LANE_ZOOM : 126|2@1+ (1,0) [0|3] "" XXX + SG_ ALERTS_1 : 128|6@1+ (1,0) [0|63] "" XXX + SG_ ALERTS_2 : 134|5@1+ (1,0) [0|3] "" XXX + SG_ ALERTS_3 : 139|4@1+ (1,0) [0|15] "" XXX + SG_ ALERTS_4 : 143|9@1+ (1,0) [0|511] "" XXX + SG_ ALERTS_5 : 152|5@1+ (1,0) [0|7] "" XXX + SG_ MUTE : 157|3@1+ (1,0) [0|7] "" XXX + SG_ SOUNDS_1 : 160|4@1+ (1,0) [0|3] "" XXX + SG_ SOUNDS_2 : 164|4@1+ (1,0) [0|3] "" XXX + SG_ SOUNDS_3 : 168|4@1+ (1,0) [0|15] "" XXX + SG_ SOUNDS_4 : 172|3@1+ (1,0) [0|7] "" XXX + SG_ ZEROS_6 : 175|1@0+ (1,0) [0|1] "" XXX + SG_ ZEROS_7 : 176|5@1+ (1,0) [0|31] "" XXX + SG_ SETSPEED_HUD : 181|3@1+ (1,0) [0|3] "" XXX + SG_ DISTANCE_LEAD : 184|5@1+ (1,0) [0|31] "" XXX + SG_ DISTANCE_CAR : 189|3@1+ (1,0) [0|7] "" XXX + SG_ DISTANCE_SPACING : 192|4@1+ (1,0) [0|15] "" XXX + SG_ DISTANCE : 196|4@1+ (1,0) [0|7] "" XXX + SG_ SETSPEED_SPEED : 200|8@1+ (1,0) [0|255] "" XXX + SG_ SETSPEED : 208|4@1+ (1,0) [0|3] "" XXX + SG_ HDA_ICON : 212|4@1+ (1,0) [0|3] "" XXX + SG_ SLA_ICON : 216|4@1+ (1,0) [0|15] "" XXX + SG_ NAV_ICON : 220|4@1+ (1,0) [0|3] "" XXX + SG_ LFA_ICON : 224|4@1+ (1,0) [0|3] "" XXX + SG_ LCA_LEFT_ICON : 228|4@1+ (1,0) [0|15] "" XXX + SG_ LCA_RIGHT_ICON : 232|4@1+ (1,0) [0|15] "" XXX + SG_ BACKGROUND : 236|4@1+ (1,0) [0|15] "" XXX + SG_ DAW_ICON : 240|3@1+ (1,0) [0|7] "" XXX + SG_ CAR_CIRCLE : 243|3@1+ (1,0) [0|7] "" XXX + SG_ ZEROS_8 : 246|2@1+ (1,0) [0|3] "" XXX + SG_ ZEROS_9 : 248|8@1+ (1,0) [0|255] "" XXX + +BO_ 354 MSG_162: 32 CCNC + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ SPEEDLIMIT_STYLE : 24|4@1+ (1,0) [0|7] "" XXX + SG_ SPEEDLIMIT_FLASH : 28|4@1+ (1,0) [0|15] "" XXX + SG_ SPEEDLIMIT : 32|8@1+ (1,0) [0|255] "" XXX + SG_ SIGNS : 40|8@1+ (1,0) [0|15] "" XXX + SG_ SPEEDLIMIT_WEATHER : 48|4@1+ (1,0) [0|15] "" XXX + SG_ VIBRATE : 52|3@1+ (1,0) [0|7] "" XXX + SG_ ZEROS_1 : 55|1@0+ (1,0) [0|1] "" XXX + SG_ ZEROS_2 : 56|8@1+ (1,0) [0|255] "" XXX + SG_ LEAD : 64|5@1+ (1,0) [0|31] "" XXX + SG_ LEAD_DISTANCE : 69|11@1+ (1,0) [0|2047] "" XXX + SG_ LEAD_LATERAL : 80|7@1+ (1,0) [0|127] "" XXX + SG_ ZEROS_3 : 87|1@0+ (1,0) [0|1] "" XXX + SG_ LEAD_ALT : 88|5@1+ (1,0) [0|31] "" XXX + SG_ LEAD_ALT_DISTANCE : 93|11@1+ (1,0) [0|2047] "" XXX + SG_ LEAD_ALT_LATERAL : 104|7@1+ (1,0) [0|127] "" XXX + SG_ ZEROS_4 : 111|1@0+ (1,0) [0|1] "" XXX + SG_ LEAD_LEFT : 112|5@1+ (1,0) [0|31] "" XXX + SG_ LEAD_LEFT_DISTANCE : 117|11@1+ (1,0) [0|2047] "" XXX + SG_ LEAD_LEFT_LATERAL : 128|7@1+ (1,0) [0|127] "" XXX + SG_ ZEROS_5 : 135|1@0+ (1,0) [0|1] "" XXX + SG_ LEAD_RIGHT : 136|5@1+ (1,0) [0|31] "" XXX + SG_ LEAD_RIGHT_DISTANCE : 141|11@1+ (1,0) [0|2047] "" XXX + SG_ LEAD_RIGHT_LATERAL : 152|7@1+ (1,0) [0|127] "" XXX + SG_ ZEROS_6 : 159|1@0+ (1,0) [0|1] "" XXX + SG_ ZEROS_7 : 160|8@1+ (1,0) [0|255] "" XXX + SG_ ZEROS_8 : 168|8@1+ (1,0) [0|255] "" XXX + SG_ ZEROS_9 : 176|8@1+ (1,0) [0|255] "" XXX + SG_ ZEROS_10 : 184|8@1+ (1,0) [0|255] "" XXX + SG_ ZEROS_11 : 192|8@1+ (1,0) [0|255] "" XXX + SG_ ZEROS_12 : 200|8@1+ (1,0) [0|255] "" XXX + SG_ ZEROS_13 : 208|5@1+ (1,0) [0|31] "" XXX + SG_ FAULT_FSS : 213|3@1+ (1,0) [0|7] "" XXX + SG_ FAULT_FCA : 216|3@1+ (1,0) [0|7] "" XXX + SG_ FAULT_LSS : 219|3@1+ (1,0) [0|7] "" XXX + SG_ FAULT_SLA : 222|3@1+ (1,0) [0|7] "" XXX + SG_ FAULT_DAW : 225|3@1+ (1,0) [0|7] "" XXX + SG_ FAULT_HBA : 228|3@1+ (1,0) [0|7] "" XXX + SG_ FAULT_SCC : 231|3@1+ (1,0) [0|7] "" XXX + SG_ FAULT_LFA : 234|3@1+ (1,0) [0|7] "" XXX + SG_ FAULT_HDA : 237|3@1+ (1,0) [0|7] "" XXX + SG_ FAULT_LCA : 240|3@1+ (1,0) [0|7] "" XXX + SG_ FAULT_HDP : 243|3@1+ (1,0) [0|7] "" XXX + SG_ FAULT_DAS : 246|3@1+ (1,0) [0|7] "" XXX + SG_ FAULT_ESS : 249|3@1+ (1,0) [0|7] "" XXX + SG_ ZEROS_14 : 252|4@1+ (1,0) [0|15] "" XXX CM_ 272 "Alternative LKAS message, used on cars such as 2023 Ioniq 6, 2nd gen Kona. Matches LKAS except size is 32 bytes"; CM_ 676 "Contains signals with detailed lane line information. Used by ADAS ECU on HDA 2 vehicles to operate LFA."; From 446b0c4b0d03b594bb5e37a26ee4e46458f5326d Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 10 Dec 2024 08:17:56 -0500 Subject: [PATCH 014/316] new --- opendbc/car/hyundai/carcontroller.py | 4 +- opendbc/car/hyundai/hyundaicanfd.py | 83 +++++++++++++++++++++++++--- 2 files changed, 78 insertions(+), 9 deletions(-) diff --git a/opendbc/car/hyundai/carcontroller.py b/opendbc/car/hyundai/carcontroller.py index aab3122be03..e25cd09f10e 100644 --- a/opendbc/car/hyundai/carcontroller.py +++ b/opendbc/car/hyundai/carcontroller.py @@ -118,8 +118,8 @@ def update(self, CC, CS, now_nanos): if self.frame % 5 == 0 and (not hda2 or hda2_long) and self.car_fingerprint not in (CAR.HYUNDAI_SONATA_2024,): can_sends.append(hyundaicanfd.create_lfahda_cluster(self.packer, self.CAN, CC.enabled)) if self.frame % 5 == 0 and (not hda2 or hda2_long) and self.car_fingerprint in (CAR.HYUNDAI_SONATA_2024,): - can_sends.append(hyundaicanfd.create_msg_161(self.packer, self.CAN, CC.enabled, CS.msg_161)) - can_sends.append(hyundaicanfd.create_msg_162(self.packer, self.CAN, CC.enabled, CS.msg_162)) + can_sends.append(hyundaicanfd.create_msg_161(self.packer, self.CAN, CC.enabled, CS.msg_161, self.CP, hud_control, CS, CC, self.frame)) + can_sends.append(hyundaicanfd.create_msg_162(self.packer, self.CAN, CC.enabled, CS.msg_162, self.CP, hud_control)) # blinkers if hda2 and self.CP.flags & HyundaiFlags.ENABLE_BLINKERS: diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 62d8f1694bf..bdc1c626fb6 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -1,4 +1,5 @@ from opendbc.car import CanBusBase +from opendbc.car.common.conversions import Conversions as CV from opendbc.car.common.numpy_fast import clip from opendbc.car.hyundai.values import HyundaiFlags @@ -119,29 +120,97 @@ def create_lfahda_cluster(packer, CAN, enabled): } return packer.make_can_msg("LFAHDA_CLUSTER", CAN.ECAN, values) -def create_msg_161(packer, CAN, enabled, msg_161): +def create_msg_161(packer, CAN, enabled, msg_161, car_params, hud_control, car_state, car_control, frame): values = msg_161.copy() + + # HIDE ALERTS + if values.get("ALERTS_5") == 5: # USE SWITCH OR PEDAL TO ACCELERATE + values["ALERTS_5"] = 0 + if values.get("ALERTS_2") == 5: # CONSIDER TAKING A BREAK + values.update({"ALERTS_2": 0, "SOUNDS_2": 0, "DAW_ICON": 0}) + + # LANELINES + curvature = { + i: (31 if i == -1 else 13 - abs(i + 15)) if i < 0 else 15 + i + for i in range(-15, 16) + } values.update({ + "LANELINE_CURVATURE": curvature.get(max(-15, min(int(car_state.out.steeringAngleDeg / 3), 15)), 14) if enabled else 15, "LFA_ICON": 2 if enabled else 0, "LKA_ICON": 4 if enabled else 0, "LANELINE_LEFT": 2 if enabled else 0, "LANELINE_RIGHT": 2 if enabled else 0, "CENTERLINE": 1 if enabled else 0, - "DAW_ICON": 0, }) - if values.get("ALERTS_5") == 5: # use_switch_or_pedal_to_accelerate - values["ALERTS_5"] = 0 - if values.get("ALERTS_2") == 5: # coffee - values.update({"ALERTS_2": 0, "SOUNDS_2": 0}) + + # LCA + if enabled: + speed_below_threshold = car_state.out.vEgo < 8.94 + values.update({ + "LCA_LEFT_ICON": 0 if car_state.out.leftBlindspot or speed_below_threshold else 2 if car_control.leftBlinker else 1, + "LCA_RIGHT_ICON": 0 if car_state.out.rightBlindspot or speed_below_threshold else 2 if car_control.rightBlinker else 1, + "LCA_LEFT_ARROW": 2 if car_control.leftBlinker else 0, + "LCA_RIGHT_ARROW": 2 if car_control.rightBlinker else 0, + }) + + # LANE DEPARTURE + if hud_control.leftLaneDepart: + values["LANELINE_LEFT"] = 4 if (frame // 50) % 2 == 0 else 1 + if hud_control.rightLaneDepart: + values["LANELINE_RIGHT"] = 4 if (frame // 50) % 2 == 0 else 1 + + if car_params.openpilotLongitudinalControl: + # HIDE ALERTS + if values.get("ALERTS_5") == 4: # SMART CRUISE CONTROL CONDITIONS NOT MET + values["ALERTS_5"] = 0 + + # SETSPEED + values["SETSPEED"] = 3 if enabled else 1 + values["SETSPEED_HUD"] = 2 if enabled else 1 + values["SETSPEED_SPEED"] = 25 if (s := round(car_state.out.vCruiseCluster * CV.KPH_TO_MPH)) > 100 else s + + # DISTANCE + if 1 <= hud_control.leadDistanceBars <= 3: + values["DISTANCE"] = hud_control.leadDistanceBars + values["DISTANCE_SPACING"] = 1 if enabled else 0 + values["DISTANCE_LEAD"] = 2 if enabled and hud_control.leadVisible else 1 if enabled else 0 + values["DISTANCE_CAR"] = 2 if enabled else 1 + values["ALERTS_3"] = hud_control.leadDistanceBars + 6 + else: + values["DISTANCE"] = 0 + values["DISTANCE_SPACING"] = 0 + values["DISTANCE_LEAD"] = 0 + values["DISTANCE_CAR"] = 0 + + # BACKGROUND + values["BACKGROUND"] = 1 if enabled else 7 + return packer.make_can_msg("MSG_161", CAN.ECAN, values) -def create_msg_162(packer, CAN, enabled, msg_162): +def create_msg_162(packer, CAN, enabled, msg_162, car_params, hud_control): values = msg_162.copy() + + # HIDE FAULTS values.update({ "FAULT_LSS": 0, "FAULT_HDA": 0, "FAULT_DAS": 0, }) + + # LANE DEPARTURE + if hud_control.leftLaneDepart or hud_control.rightLaneDepart: + values["VIBRATE"] = 1 + + if car_params.openpilotLongitudinalControl: + # *** TODO *** LEAD_DISTANCE/LEAD_LATERAL + # LEAD + if hud_control.leadVisible: + values["LEAD"] = 2 if enabled else 1 + values["LEAD_DISTANCE"] = 100 + else: + values["LEAD"] = 0 + values["LEAD_DISTANCE"] = 0 + return packer.make_can_msg("MSG_162", CAN.ECAN, values) def create_acc_control(packer, CAN, enabled, accel_last, accel, stopping, gas_override, set_speed, hud_control): From 26787f8b49abccf4c7b94ca11ca519874bc106f3 Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 14 Dec 2024 00:51:35 -0500 Subject: [PATCH 015/316] combine --- opendbc/car/hyundai/carcontroller.py | 10 +-- opendbc/car/hyundai/carstate.py | 22 +++--- opendbc/car/hyundai/hyundaicanfd.py | 104 +++++++++++++-------------- 3 files changed, 67 insertions(+), 69 deletions(-) diff --git a/opendbc/car/hyundai/carcontroller.py b/opendbc/car/hyundai/carcontroller.py index e25cd09f10e..235ffa047ba 100644 --- a/opendbc/car/hyundai/carcontroller.py +++ b/opendbc/car/hyundai/carcontroller.py @@ -115,11 +115,11 @@ def update(self, CC, CS, now_nanos): self.CP.flags & HyundaiFlags.CANFD_HDA2_ALT_STEERING)) # LFA and HDA icons - if self.frame % 5 == 0 and (not hda2 or hda2_long) and self.car_fingerprint not in (CAR.HYUNDAI_SONATA_2024,): - can_sends.append(hyundaicanfd.create_lfahda_cluster(self.packer, self.CAN, CC.enabled)) - if self.frame % 5 == 0 and (not hda2 or hda2_long) and self.car_fingerprint in (CAR.HYUNDAI_SONATA_2024,): - can_sends.append(hyundaicanfd.create_msg_161(self.packer, self.CAN, CC.enabled, CS.msg_161, self.CP, hud_control, CS, CC, self.frame)) - can_sends.append(hyundaicanfd.create_msg_162(self.packer, self.CAN, CC.enabled, CS.msg_162, self.CP, hud_control)) + if self.frame % 5 == 0 and (not hda2 or hda2_long): + if self.car_fingerprint == CAR.HYUNDAI_SONATA_HEV_2024: + can_sends.extend(hyundaicanfd.create_ccnc(self.packer, self.CAN, self.frame, self.CP, CC, CS)) + else: + can_sends.append(hyundaicanfd.create_lfahda_cluster(self.packer, self.CAN, CC.enabled)) # blinkers if hda2 and self.CP.flags & HyundaiFlags.ENABLE_BLINKERS: diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index 06fd94214e4..e92b0eaf7cf 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -50,6 +50,8 @@ def __init__(self, CP): self.buttons_counter = 0 self.cruise_info = {} + + self.ccnc_car = CP.carFingerprint in (CAR.HYUNDAI_SONATA_HEV_2024,) self.msg_161 = {} self.msg_162 = {} @@ -224,14 +226,14 @@ def update_canfd(self, can_parsers) -> structs.CarState: ret.steeringPressed = self.update_steering_pressed(abs(ret.steeringTorque) > self.params.STEER_THRESHOLD, 5) ret.steerFaultTemporary = cp.vl["MDPS"]["LKA_FAULT"] != 0 - # TODO: alt signal usage may be described by cp.vl['BLINKERS']['USE_ALT_LAMP'] - left_blinker_sig, right_blinker_sig = "LEFT_LAMP", "RIGHT_LAMP" - if self.CP.carFingerprint in (CAR.HYUNDAI_KONA_EV_2ND_GEN, CAR.HYUNDAI_SONATA_2024): - left_blinker_sig, right_blinker_sig = "LEFT_LAMP_ALT", "RIGHT_LAMP_ALT" - ret.leftBlinker, ret.rightBlinker = self.update_blinker_from_lamp(50, cp.vl["BLINKERS"][left_blinker_sig], - cp.vl["BLINKERS"][right_blinker_sig]) + if self.ccnc_car: + self.msg_161 = copy.copy(cp_cam.vl["MSG_161"]) + self.msg_162 = copy.copy(cp_cam.vl["MSG_162"]) + + alt = "_ALT" if self.ccnc_car else "" + ret.leftBlinker, ret.rightBlinker = self.update_blinker_from_lamp(50, cp.vl["BLINKERS"][f"LEFT_LAMP{alt}"], + cp.vl["BLINKERS"][f"RIGHT_LAMP{alt}"]) if self.CP.enableBsm: - alt = "_ALT" if self.CP.carFingerprint == CAR.HYUNDAI_SONATA_2024 else "" ret.leftBlindspot = cp.vl["BLINDSPOTS_REAR_CORNERS"][f"FL_INDICATOR{alt}"] != 0 ret.rightBlindspot = cp.vl["BLINDSPOTS_REAR_CORNERS"][f"FR_INDICATOR{alt}"] != 0 @@ -270,10 +272,6 @@ def update_canfd(self, can_parsers) -> structs.CarState: ret.buttonEvents = [*create_button_events(self.cruise_buttons[-1], prev_cruise_buttons, BUTTONS_DICT), *create_button_events(self.main_buttons[-1], prev_main_buttons, {1: ButtonType.mainCruise})] - if self.CP.carFingerprint in (CAR.HYUNDAI_SONATA_2024,): - self.msg_161 = copy.copy(cp_cam.vl["MSG_161"]) - self.msg_162 = copy.copy(cp_cam.vl["MSG_162"]) - return ret def get_can_parsers_canfd(self, CP): @@ -321,7 +319,7 @@ def get_can_parsers_canfd(self, CP): cam_messages += [ ("SCC_CONTROL", 50), ] - if self.CP.carFingerprint in (CAR.HYUNDAI_SONATA_2024,): + if self.ccnc_car: cam_messages += [ ("MSG_161", 20), ("MSG_162", 20), diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index bdc1c626fb6..ad6f1ad9a67 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -120,21 +120,33 @@ def create_lfahda_cluster(packer, CAN, enabled): } return packer.make_can_msg("LFAHDA_CLUSTER", CAN.ECAN, values) -def create_msg_161(packer, CAN, enabled, msg_161, car_params, hud_control, car_state, car_control, frame): - values = msg_161.copy() +def create_ccnc(packer, CAN, frame, car_params, car_control, car_state): + ret = [] + + msg_161 = car_state.msg_161.copy() + msg_162 = car_state.msg_162.copy() + enabled = car_control.enabled + hud_control = car_control.hudControl + + # HIDE FAULTS + msg_162.update({ + "FAULT_LSS": 0, + "FAULT_HDA": 0, + "FAULT_DAS": 0, + }) # HIDE ALERTS - if values.get("ALERTS_5") == 5: # USE SWITCH OR PEDAL TO ACCELERATE - values["ALERTS_5"] = 0 - if values.get("ALERTS_2") == 5: # CONSIDER TAKING A BREAK - values.update({"ALERTS_2": 0, "SOUNDS_2": 0, "DAW_ICON": 0}) + if msg_161.get("ALERTS_5") == 5: # USE SWITCH OR PEDAL TO ACCELERATE + msg_161["ALERTS_5"] = 0 + if msg_161.get("ALERTS_2") == 5: # CONSIDER TAKING A BREAK + msg_161.update({"ALERTS_2": 0, "SOUNDS_2": 0, "DAW_ICON": 0}) # LANELINES curvature = { i: (31 if i == -1 else 13 - abs(i + 15)) if i < 0 else 15 + i for i in range(-15, 16) } - values.update({ + msg_161.update({ "LANELINE_CURVATURE": curvature.get(max(-15, min(int(car_state.out.steeringAngleDeg / 3), 15)), 14) if enabled else 15, "LFA_ICON": 2 if enabled else 0, "LKA_ICON": 4 if enabled else 0, @@ -146,7 +158,7 @@ def create_msg_161(packer, CAN, enabled, msg_161, car_params, hud_control, car_s # LCA if enabled: speed_below_threshold = car_state.out.vEgo < 8.94 - values.update({ + msg_161.update({ "LCA_LEFT_ICON": 0 if car_state.out.leftBlindspot or speed_below_threshold else 2 if car_control.leftBlinker else 1, "LCA_RIGHT_ICON": 0 if car_state.out.rightBlindspot or speed_below_threshold else 2 if car_control.rightBlinker else 1, "LCA_LEFT_ARROW": 2 if car_control.leftBlinker else 0, @@ -154,64 +166,52 @@ def create_msg_161(packer, CAN, enabled, msg_161, car_params, hud_control, car_s }) # LANE DEPARTURE - if hud_control.leftLaneDepart: - values["LANELINE_LEFT"] = 4 if (frame // 50) % 2 == 0 else 1 - if hud_control.rightLaneDepart: - values["LANELINE_RIGHT"] = 4 if (frame // 50) % 2 == 0 else 1 + if hud_control.leftLaneDepart or hud_control.rightLaneDepart: + msg_162["VIBRATE"] = 1 + if hud_control.leftLaneDepart: + msg_161["LANELINE_LEFT"] = 4 if (frame // 50) % 2 == 0 else 1 + if hud_control.rightLaneDepart: + msg_161["LANELINE_RIGHT"] = 4 if (frame // 50) % 2 == 0 else 1 + if car_params.openpilotLongitudinalControl: # HIDE ALERTS - if values.get("ALERTS_5") == 4: # SMART CRUISE CONTROL CONDITIONS NOT MET - values["ALERTS_5"] = 0 + if msg_161.get("ALERTS_5") == 4: # SMART CRUISE CONTROL CONDITIONS NOT MET + msg_161["ALERTS_5"] = 0 + + # BACKGROUND + msg_161["BACKGROUND"] = 1 if enabled else 7 # SETSPEED - values["SETSPEED"] = 3 if enabled else 1 - values["SETSPEED_HUD"] = 2 if enabled else 1 - values["SETSPEED_SPEED"] = 25 if (s := round(car_state.out.vCruiseCluster * CV.KPH_TO_MPH)) > 100 else s + msg_161["SETSPEED"] = 3 if enabled else 1 + msg_161["SETSPEED_HUD"] = 2 if enabled else 1 + msg_161["SETSPEED_SPEED"] = 25 if (s := round(car_state.out.vCruiseCluster * CV.KPH_TO_MPH)) > 100 else s # DISTANCE if 1 <= hud_control.leadDistanceBars <= 3: - values["DISTANCE"] = hud_control.leadDistanceBars - values["DISTANCE_SPACING"] = 1 if enabled else 0 - values["DISTANCE_LEAD"] = 2 if enabled and hud_control.leadVisible else 1 if enabled else 0 - values["DISTANCE_CAR"] = 2 if enabled else 1 - values["ALERTS_3"] = hud_control.leadDistanceBars + 6 + msg_161["DISTANCE"] = hud_control.leadDistanceBars + msg_161["DISTANCE_SPACING"] = 1 if enabled else 0 + msg_161["DISTANCE_LEAD"] = 2 if enabled and hud_control.leadVisible else 1 if enabled else 0 + msg_161["DISTANCE_CAR"] = 2 if enabled else 1 + msg_161["ALERTS_3"] = hud_control.leadDistanceBars + 6 else: - values["DISTANCE"] = 0 - values["DISTANCE_SPACING"] = 0 - values["DISTANCE_LEAD"] = 0 - values["DISTANCE_CAR"] = 0 - - # BACKGROUND - values["BACKGROUND"] = 1 if enabled else 7 + msg_161["DISTANCE"] = 0 + msg_161["DISTANCE_SPACING"] = 0 + msg_161["DISTANCE_LEAD"] = 0 + msg_161["DISTANCE_CAR"] = 0 - return packer.make_can_msg("MSG_161", CAN.ECAN, values) - -def create_msg_162(packer, CAN, enabled, msg_162, car_params, hud_control): - values = msg_162.copy() - - # HIDE FAULTS - values.update({ - "FAULT_LSS": 0, - "FAULT_HDA": 0, - "FAULT_DAS": 0, - }) - - # LANE DEPARTURE - if hud_control.leftLaneDepart or hud_control.rightLaneDepart: - values["VIBRATE"] = 1 - - if car_params.openpilotLongitudinalControl: - # *** TODO *** LEAD_DISTANCE/LEAD_LATERAL # LEAD if hud_control.leadVisible: - values["LEAD"] = 2 if enabled else 1 - values["LEAD_DISTANCE"] = 100 + msg_162["LEAD"] = 2 if enabled else 1 + msg_162["LEAD_DISTANCE"] = 100 else: - values["LEAD"] = 0 - values["LEAD_DISTANCE"] = 0 + msg_162["LEAD"] = 0 + msg_162["LEAD_DISTANCE"] = 0 + + ret.append(packer.make_can_msg("MSG_161", CAN.ECAN, msg_161)) + ret.append(packer.make_can_msg("MSG_162", CAN.ECAN, msg_162)) - return packer.make_can_msg("MSG_162", CAN.ECAN, values) + return ret def create_acc_control(packer, CAN, enabled, accel_last, accel, stopping, gas_override, set_speed, hud_control): jerk = 5 From 9c4a244f3a6128a84248a6b0789d6023d591754e Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 14 Dec 2024 01:10:55 -0500 Subject: [PATCH 016/316] more --- opendbc/car/hyundai/hyundaicanfd.py | 30 ++++++++++++----------------- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index ad6f1ad9a67..e6920eb54fd 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -142,10 +142,7 @@ def create_ccnc(packer, CAN, frame, car_params, car_control, car_state): msg_161.update({"ALERTS_2": 0, "SOUNDS_2": 0, "DAW_ICON": 0}) # LANELINES - curvature = { - i: (31 if i == -1 else 13 - abs(i + 15)) if i < 0 else 15 + i - for i in range(-15, 16) - } + curvature = {i: (31 if i == -1 else 13 - abs(i + 15)) if i < 0 else 15 + i for i in range(-15, 16)} msg_161.update({ "LANELINE_CURVATURE": curvature.get(max(-15, min(int(car_state.out.steeringAngleDeg / 3), 15)), 14) if enabled else 15, "LFA_ICON": 2 if enabled else 0, @@ -179,13 +176,13 @@ def create_ccnc(packer, CAN, frame, car_params, car_control, car_state): if msg_161.get("ALERTS_5") == 4: # SMART CRUISE CONTROL CONDITIONS NOT MET msg_161["ALERTS_5"] = 0 - # BACKGROUND - msg_161["BACKGROUND"] = 1 if enabled else 7 - - # SETSPEED - msg_161["SETSPEED"] = 3 if enabled else 1 - msg_161["SETSPEED_HUD"] = 2 if enabled else 1 - msg_161["SETSPEED_SPEED"] = 25 if (s := round(car_state.out.vCruiseCluster * CV.KPH_TO_MPH)) > 100 else s + # BACKGROUND,SETSPEED + msg_161.update({ + "BACKGROUND": 1 if enabled else 7, + "SETSPEED": 3 if enabled else 1, + "SETSPEED_HUD": 2 if enabled else 1, + "SETSPEED_SPEED": 25 if (s := round(car_state.out.vCruiseCluster * CV.KPH_TO_MPH)) > 100 else s, + }) # DISTANCE if 1 <= hud_control.leadDistanceBars <= 3: @@ -200,13 +197,10 @@ def create_ccnc(packer, CAN, frame, car_params, car_control, car_state): msg_161["DISTANCE_LEAD"] = 0 msg_161["DISTANCE_CAR"] = 0 - # LEAD - if hud_control.leadVisible: - msg_162["LEAD"] = 2 if enabled else 1 - msg_162["LEAD_DISTANCE"] = 100 - else: - msg_162["LEAD"] = 0 - msg_162["LEAD_DISTANCE"] = 0 + msg_162.update({ + "LEAD": 2 if enabled else 1 if hud_control.leadVisible else 0, + "LEAD_DISTANCE": 100 if hud_control.leadVisible else 0, + }) ret.append(packer.make_can_msg("MSG_161", CAN.ECAN, msg_161)) ret.append(packer.make_can_msg("MSG_162", CAN.ECAN, msg_162)) From 5a583ccd248846866906bcdff2e74b0fedbad326 Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 14 Dec 2024 01:21:54 -0500 Subject: [PATCH 017/316] wrong car --- opendbc/car/hyundai/carcontroller.py | 2 +- opendbc/car/hyundai/carstate.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/opendbc/car/hyundai/carcontroller.py b/opendbc/car/hyundai/carcontroller.py index 235ffa047ba..0e4daa97b1d 100644 --- a/opendbc/car/hyundai/carcontroller.py +++ b/opendbc/car/hyundai/carcontroller.py @@ -116,7 +116,7 @@ def update(self, CC, CS, now_nanos): # LFA and HDA icons if self.frame % 5 == 0 and (not hda2 or hda2_long): - if self.car_fingerprint == CAR.HYUNDAI_SONATA_HEV_2024: + if self.car_fingerprint == CAR.HYUNDAI_SONATA_2024: can_sends.extend(hyundaicanfd.create_ccnc(self.packer, self.CAN, self.frame, self.CP, CC, CS)) else: can_sends.append(hyundaicanfd.create_lfahda_cluster(self.packer, self.CAN, CC.enabled)) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index e92b0eaf7cf..d3543f1b55c 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -51,7 +51,7 @@ def __init__(self, CP): self.cruise_info = {} - self.ccnc_car = CP.carFingerprint in (CAR.HYUNDAI_SONATA_HEV_2024,) + self.ccnc_car = CP.carFingerprint in (CAR.HYUNDAI_SONATA_2024,) self.msg_161 = {} self.msg_162 = {} From f485cd9e4c39c860712798554cb89bccbb545c20 Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 14 Dec 2024 01:53:47 -0500 Subject: [PATCH 018/316] HYUNDAI_SONATA_HEV_2024 --- opendbc/car/hyundai/carcontroller.py | 2 +- opendbc/car/hyundai/carstate.py | 2 +- opendbc/car/hyundai/fingerprints.py | 8 ++++++++ opendbc/car/hyundai/values.py | 4 ++++ opendbc/car/tests/routes.py | 1 + opendbc/car/torque_data/override.toml | 1 + 6 files changed, 16 insertions(+), 2 deletions(-) diff --git a/opendbc/car/hyundai/carcontroller.py b/opendbc/car/hyundai/carcontroller.py index 0e4daa97b1d..07f8252d0d1 100644 --- a/opendbc/car/hyundai/carcontroller.py +++ b/opendbc/car/hyundai/carcontroller.py @@ -116,7 +116,7 @@ def update(self, CC, CS, now_nanos): # LFA and HDA icons if self.frame % 5 == 0 and (not hda2 or hda2_long): - if self.car_fingerprint == CAR.HYUNDAI_SONATA_2024: + if self.car_fingerprint in (CAR.HYUNDAI_SONATA_2024, CAR.HYUNDAI_SONATA_HEV_2024,): can_sends.extend(hyundaicanfd.create_ccnc(self.packer, self.CAN, self.frame, self.CP, CC, CS)) else: can_sends.append(hyundaicanfd.create_lfahda_cluster(self.packer, self.CAN, CC.enabled)) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index d3543f1b55c..6c7002152c1 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -51,7 +51,7 @@ def __init__(self, CP): self.cruise_info = {} - self.ccnc_car = CP.carFingerprint in (CAR.HYUNDAI_SONATA_2024,) + self.ccnc_car = CP.carFingerprint in (CAR.HYUNDAI_SONATA_2024, CAR.HYUNDAI_SONATA_HEV_2024,) self.msg_161 = {} self.msg_162 = {} diff --git a/opendbc/car/hyundai/fingerprints.py b/opendbc/car/hyundai/fingerprints.py index c9d8e49d6c6..4a5ffb1e781 100644 --- a/opendbc/car/hyundai/fingerprints.py +++ b/opendbc/car/hyundai/fingerprints.py @@ -951,6 +951,14 @@ b'\xf1\x00DN8HMFC AT USA LHD 1.00 1.07 99211-L1000 211223', ], }, + CAR.HYUNDAI_SONATA_HEV_2024: { + (Ecu.fwdRadar, 0x7d0, None): [ + b'\xf1\x00DN8_ RDR ----- 1.00 1.00 99110-L1800 ', + ], + (Ecu.fwdCamera, 0x7c4, None): [ + b'\xf1\x00DN8HMFC AT USA LHD 1.00 1.01 99211-L1800 230512', + ], + }, CAR.KIA_SORENTO: { (Ecu.fwdCamera, 0x7c4, None): [ b'\xf1\x00UMP LKAS AT KOR LHD 1.00 1.00 95740-C5550 S30', diff --git a/opendbc/car/hyundai/values.py b/opendbc/car/hyundai/values.py index 4b726757d32..0c16d89bf6d 100644 --- a/opendbc/car/hyundai/values.py +++ b/opendbc/car/hyundai/values.py @@ -311,6 +311,10 @@ class CAR(Platforms): HYUNDAI_SONATA.specs, flags=HyundaiFlags.MANDO_RADAR | HyundaiFlags.CHECKSUM_CRC8 | HyundaiFlags.HYBRID, ) + HYUNDAI_SONATA_HEV_2024 = HyundaiCanFDPlatformConfig( + [HyundaiCarDocs("Hyundai Sonata Hybrid 2024", "All", car_parts=CarParts.common([CarHarness.hyundai_a]))], + CarSpecs(mass=1616, wheelbase=2.84, steerRatio=13.27), + ) HYUNDAI_IONIQ_5 = HyundaiCanFDPlatformConfig( [ HyundaiCarDocs("Hyundai Ioniq 5 (Non-US only) 2022-24", "All", car_parts=CarParts.common([CarHarness.hyundai_q])), diff --git a/opendbc/car/tests/routes.py b/opendbc/car/tests/routes.py index 3252b22bfbb..6f2da3ec8c6 100644 --- a/opendbc/car/tests/routes.py +++ b/opendbc/car/tests/routes.py @@ -181,6 +181,7 @@ class CarTestRoute(NamedTuple): CarTestRoute("82e9cdd3f43bf83e|2021-05-15--02-42-51", HYUNDAI.HYUNDAI_ELANTRA_2021), CarTestRoute("715ac05b594e9c59|2021-06-20--16-21-07", HYUNDAI.HYUNDAI_ELANTRA_HEV_2021), CarTestRoute("7120aa90bbc3add7|2021-08-02--07-12-31", HYUNDAI.HYUNDAI_SONATA_HYBRID), + CarTestRoute("bc40c72b728178f2/00000006--ee76ae8c42", HYUNDAI.HYUNDAI_SONATA_HEV_2024), CarTestRoute("715ac05b594e9c59|2021-10-27--23-24-56", HYUNDAI.GENESIS_G70_2020), CarTestRoute("6b0d44d22df18134|2023-05-06--10-36-55", HYUNDAI.GENESIS_GV80), diff --git a/opendbc/car/torque_data/override.toml b/opendbc/car/torque_data/override.toml index 936bb69fb28..ec90903b80b 100644 --- a/opendbc/car/torque_data/override.toml +++ b/opendbc/car/torque_data/override.toml @@ -73,6 +73,7 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"] "GENESIS_GV70_ELECTRIFIED_1ST_GEN" = [1.9, 1.9, 0.09] "GENESIS_G80_2ND_GEN_FL" = [2.5819356441497803, 2.5, 0.11244568973779678] "HYUNDAI_SONATA_2024" = [2.5, 2.5, 0.1] +"HYUNDAI_SONATA_HEV_2024" = [2.5, 2.5, 0.1] # Dashcam or fallback configured as ideal car "MOCK" = [10.0, 10, 0.0] From 6de4cda6d95128bbdadea516e50ff265ccb1c5e2 Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 14 Dec 2024 01:59:35 -0500 Subject: [PATCH 019/316] HYUNDAI_KONA_2ND_GEN --- opendbc/car/hyundai/carcontroller.py | 2 +- opendbc/car/hyundai/carstate.py | 2 +- opendbc/car/hyundai/fingerprints.py | 10 ++++++++++ opendbc/car/hyundai/values.py | 4 ++++ opendbc/car/tests/routes.py | 1 + opendbc/car/torque_data/override.toml | 1 + 6 files changed, 18 insertions(+), 2 deletions(-) diff --git a/opendbc/car/hyundai/carcontroller.py b/opendbc/car/hyundai/carcontroller.py index 07f8252d0d1..318697c0775 100644 --- a/opendbc/car/hyundai/carcontroller.py +++ b/opendbc/car/hyundai/carcontroller.py @@ -116,7 +116,7 @@ def update(self, CC, CS, now_nanos): # LFA and HDA icons if self.frame % 5 == 0 and (not hda2 or hda2_long): - if self.car_fingerprint in (CAR.HYUNDAI_SONATA_2024, CAR.HYUNDAI_SONATA_HEV_2024,): + if self.car_fingerprint in (CAR.HYUNDAI_SONATA_2024, CAR.HYUNDAI_SONATA_HEV_2024, CAR.HYUNDAI_KONA_2ND_GEN,): can_sends.extend(hyundaicanfd.create_ccnc(self.packer, self.CAN, self.frame, self.CP, CC, CS)) else: can_sends.append(hyundaicanfd.create_lfahda_cluster(self.packer, self.CAN, CC.enabled)) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index 6c7002152c1..2c7e0eb7ec1 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -51,7 +51,7 @@ def __init__(self, CP): self.cruise_info = {} - self.ccnc_car = CP.carFingerprint in (CAR.HYUNDAI_SONATA_2024, CAR.HYUNDAI_SONATA_HEV_2024,) + self.ccnc_car = CP.carFingerprint in (CAR.HYUNDAI_SONATA_2024, CAR.HYUNDAI_SONATA_HEV_2024, CAR.HYUNDAI_KONA_2ND_GEN,) self.msg_161 = {} self.msg_162 = {} diff --git a/opendbc/car/hyundai/fingerprints.py b/opendbc/car/hyundai/fingerprints.py index 4a5ffb1e781..f6494002252 100644 --- a/opendbc/car/hyundai/fingerprints.py +++ b/opendbc/car/hyundai/fingerprints.py @@ -544,6 +544,16 @@ b'\xf1\x00OS9 LKAS AT USA LHD 1.00 1.00 95740-J9300 g21', ], }, + CAR.HYUNDAI_KONA_2ND_GEN: { + (Ecu.fwdRadar, 0x7d0, None): [ + b'\xf1\x00SX2_ RDR ----- 1.00 1.02 99110-BE000 ', + b'\xf1\x00SX2_ RDR ----- 1.00 1.02 99110-BE500 ', + ], + (Ecu.fwdCamera, 0x7c4, None): [ + b'\xf1\x00SX2 MFC AT USA LHD 1.00 1.03 99211-BE000 230517', + b'\xf1\x00SX2 MFC AT USA LHD 1.00 1.07 99211-BE000 240611', + ], + }, CAR.KIA_CEED: { (Ecu.fwdRadar, 0x7d0, None): [ b'\xf1\x00CD__ SCC F-CUP 1.00 1.02 99110-J7000 ', diff --git a/opendbc/car/hyundai/values.py b/opendbc/car/hyundai/values.py index 0c16d89bf6d..9192b32c149 100644 --- a/opendbc/car/hyundai/values.py +++ b/opendbc/car/hyundai/values.py @@ -222,6 +222,10 @@ class CAR(Platforms): CarSpecs(mass=1275, wheelbase=2.6, steerRatio=13.42, tireStiffnessFactor=0.385), flags=HyundaiFlags.CLUSTER_GEARS | HyundaiFlags.ALT_LIMITS, ) + HYUNDAI_KONA_2ND_GEN = HyundaiCanFDPlatformConfig( + [HyundaiCarDocs("Hyundai Kona 2024", car_parts=CarParts.common([CarHarness.hyundai_l]))], + CarSpecs(mass=1590, wheelbase=2.66, steerRatio=13.6, tireStiffnessFactor=0.385), + ) HYUNDAI_KONA_EV = HyundaiPlatformConfig( [HyundaiCarDocs("Hyundai Kona Electric 2018-21", car_parts=CarParts.common([CarHarness.hyundai_g]))], CarSpecs(mass=1685, wheelbase=2.6, steerRatio=13.42, tireStiffnessFactor=0.385), diff --git a/opendbc/car/tests/routes.py b/opendbc/car/tests/routes.py index 6f2da3ec8c6..49b8d049b72 100644 --- a/opendbc/car/tests/routes.py +++ b/opendbc/car/tests/routes.py @@ -152,6 +152,7 @@ class CarTestRoute(NamedTuple): CarTestRoute("012c95f06918eca4|2023-01-15--11-19-36", HYUNDAI.HYUNDAI_IONIQ), # openpilot longitudinal enabled CarTestRoute("ab59fe909f626921|2021-10-18--18-34-28", HYUNDAI.HYUNDAI_IONIQ_HEV_2022), CarTestRoute("22d955b2cd499c22|2020-08-10--19-58-21", HYUNDAI.HYUNDAI_KONA), + CarTestRoute("8f4a9150d36961c8/00000001--960c4735d5", HYUNDAI.HYUNDAI_KONA_2ND_GEN), CarTestRoute("efc48acf44b1e64d|2021-05-28--21-05-04", HYUNDAI.HYUNDAI_KONA_EV), CarTestRoute("f90d3cd06caeb6fa|2023-09-06--17-15-47", HYUNDAI.HYUNDAI_KONA_EV), # openpilot longitudinal enabled CarTestRoute("ff973b941a69366f|2022-07-28--22-01-19", HYUNDAI.HYUNDAI_KONA_EV_2022, segment=11), diff --git a/opendbc/car/torque_data/override.toml b/opendbc/car/torque_data/override.toml index ec90903b80b..6ee290147a9 100644 --- a/opendbc/car/torque_data/override.toml +++ b/opendbc/car/torque_data/override.toml @@ -74,6 +74,7 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"] "GENESIS_G80_2ND_GEN_FL" = [2.5819356441497803, 2.5, 0.11244568973779678] "HYUNDAI_SONATA_2024" = [2.5, 2.5, 0.1] "HYUNDAI_SONATA_HEV_2024" = [2.5, 2.5, 0.1] +"HYUNDAI_KONA_2ND_GEN" = [2.5, 2.5, 0.1] # Dashcam or fallback configured as ideal car "MOCK" = [10.0, 10, 0.0] From f7c4efce67e3fe78a490e96fb2aeec5c1bb7b6df Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 14 Dec 2024 02:00:58 -0500 Subject: [PATCH 020/316] HYUNDAI_KONA_EV_2ND_GEN --- opendbc/car/hyundai/carcontroller.py | 2 +- opendbc/car/hyundai/carstate.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/opendbc/car/hyundai/carcontroller.py b/opendbc/car/hyundai/carcontroller.py index 318697c0775..43fb590a15c 100644 --- a/opendbc/car/hyundai/carcontroller.py +++ b/opendbc/car/hyundai/carcontroller.py @@ -116,7 +116,7 @@ def update(self, CC, CS, now_nanos): # LFA and HDA icons if self.frame % 5 == 0 and (not hda2 or hda2_long): - if self.car_fingerprint in (CAR.HYUNDAI_SONATA_2024, CAR.HYUNDAI_SONATA_HEV_2024, CAR.HYUNDAI_KONA_2ND_GEN,): + if self.car_fingerprint in (CAR.HYUNDAI_SONATA_2024, CAR.HYUNDAI_SONATA_HEV_2024, CAR.HYUNDAI_KONA_2ND_GEN, CAR.HYUNDAI_KONA_EV_2ND_GEN,): can_sends.extend(hyundaicanfd.create_ccnc(self.packer, self.CAN, self.frame, self.CP, CC, CS)) else: can_sends.append(hyundaicanfd.create_lfahda_cluster(self.packer, self.CAN, CC.enabled)) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index 2c7e0eb7ec1..abe75c18701 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -51,7 +51,7 @@ def __init__(self, CP): self.cruise_info = {} - self.ccnc_car = CP.carFingerprint in (CAR.HYUNDAI_SONATA_2024, CAR.HYUNDAI_SONATA_HEV_2024, CAR.HYUNDAI_KONA_2ND_GEN,) + self.ccnc_car = CP.carFingerprint in (CAR.HYUNDAI_SONATA_2024, CAR.HYUNDAI_SONATA_HEV_2024, CAR.HYUNDAI_KONA_2ND_GEN, CAR.HYUNDAI_KONA_EV_2ND_GEN,) self.msg_161 = {} self.msg_162 = {} From ced3afd41ee395ff285f361cae65341e5e2683d8 Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 14 Dec 2024 02:05:16 -0500 Subject: [PATCH 021/316] KIA_SORENTO_2024 --- opendbc/car/hyundai/carcontroller.py | 2 +- opendbc/car/hyundai/carstate.py | 2 +- opendbc/car/hyundai/fingerprints.py | 8 ++++++++ opendbc/car/hyundai/values.py | 4 ++++ opendbc/car/tests/routes.py | 1 + opendbc/car/torque_data/override.toml | 1 + 6 files changed, 16 insertions(+), 2 deletions(-) diff --git a/opendbc/car/hyundai/carcontroller.py b/opendbc/car/hyundai/carcontroller.py index 43fb590a15c..b06d64ab0e7 100644 --- a/opendbc/car/hyundai/carcontroller.py +++ b/opendbc/car/hyundai/carcontroller.py @@ -116,7 +116,7 @@ def update(self, CC, CS, now_nanos): # LFA and HDA icons if self.frame % 5 == 0 and (not hda2 or hda2_long): - if self.car_fingerprint in (CAR.HYUNDAI_SONATA_2024, CAR.HYUNDAI_SONATA_HEV_2024, CAR.HYUNDAI_KONA_2ND_GEN, CAR.HYUNDAI_KONA_EV_2ND_GEN,): + if self.car_fingerprint in (CAR.HYUNDAI_SONATA_2024, CAR.HYUNDAI_SONATA_HEV_2024, CAR.HYUNDAI_KONA_2ND_GEN, CAR.HYUNDAI_KONA_EV_2ND_GEN, CAR.KIA_SORENTO_2024,): can_sends.extend(hyundaicanfd.create_ccnc(self.packer, self.CAN, self.frame, self.CP, CC, CS)) else: can_sends.append(hyundaicanfd.create_lfahda_cluster(self.packer, self.CAN, CC.enabled)) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index abe75c18701..406f72c8c41 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -51,7 +51,7 @@ def __init__(self, CP): self.cruise_info = {} - self.ccnc_car = CP.carFingerprint in (CAR.HYUNDAI_SONATA_2024, CAR.HYUNDAI_SONATA_HEV_2024, CAR.HYUNDAI_KONA_2ND_GEN, CAR.HYUNDAI_KONA_EV_2ND_GEN,) + self.ccnc_car = CP.carFingerprint in (CAR.HYUNDAI_SONATA_2024, CAR.HYUNDAI_SONATA_HEV_2024, CAR.HYUNDAI_KONA_2ND_GEN, CAR.HYUNDAI_KONA_EV_2ND_GEN, CAR.KIA_SORENTO_2024,) self.msg_161 = {} self.msg_162 = {} diff --git a/opendbc/car/hyundai/fingerprints.py b/opendbc/car/hyundai/fingerprints.py index f6494002252..7f378447ff0 100644 --- a/opendbc/car/hyundai/fingerprints.py +++ b/opendbc/car/hyundai/fingerprints.py @@ -1135,6 +1135,14 @@ b'\xf1\x00MQ4_ SCC FHCUP 1.00 1.08 99110-P2000 ', ], }, + CAR.KIA_SORENTO_2024: { + (Ecu.fwdCamera, 0x7c4, None): [ + b'\xf1\x00MQ4 MFC AT AUS RHD 1.01 1.04 99210-P2550 231127', + ], + (Ecu.fwdRadar, 0x7d0, None): [ + b'\xf1\x00MQ4_ RDR ----- 1.00 1.01 99110-P2500 ', + ], + }, CAR.KIA_SORENTO_HEV_4TH_GEN: { (Ecu.fwdCamera, 0x7c4, None): [ b'\xf1\x00MQ4HMFC AT KOR LHD 1.00 1.04 99210-P2000 200330', diff --git a/opendbc/car/hyundai/values.py b/opendbc/car/hyundai/values.py index 9192b32c149..c5213ee8a01 100644 --- a/opendbc/car/hyundai/values.py +++ b/opendbc/car/hyundai/values.py @@ -469,6 +469,10 @@ class CAR(Platforms): CarSpecs(mass=3957 * CV.LB_TO_KG, wheelbase=2.81, steerRatio=13.5), # average of the platforms flags=HyundaiFlags.RADAR_SCC, ) + KIA_SORENTO_2024 = HyundaiCanFDPlatformConfig( + [HyundaiCarDocs("Kia Sorento 2024", car_parts=CarParts.common([CarHarness.hyundai_a]))], + CarSpecs(mass=3957 * CV.LB_TO_KG, wheelbase=2.81, steerRatio=13.5), + ) KIA_SORENTO_HEV_4TH_GEN = HyundaiCanFDPlatformConfig( [ HyundaiCarDocs("Kia Sorento Hybrid 2021-23", "All", car_parts=CarParts.common([CarHarness.hyundai_a])), diff --git a/opendbc/car/tests/routes.py b/opendbc/car/tests/routes.py index 49b8d049b72..c742573bac6 100644 --- a/opendbc/car/tests/routes.py +++ b/opendbc/car/tests/routes.py @@ -138,6 +138,7 @@ class CarTestRoute(NamedTuple): CarTestRoute("36e10531feea61a4|2022-07-25--13-37-42", HYUNDAI.HYUNDAI_TUCSON_4TH_GEN), # hybrid CarTestRoute("5875672fc1d4bf57|2020-07-23--21-33-28", HYUNDAI.KIA_SORENTO), CarTestRoute("1d0d000db3370fd0|2023-01-04--22-28-42", HYUNDAI.KIA_SORENTO_4TH_GEN, segment=5), + CarTestRoute("60380edf6d76cb45/00000004--e450afc26c", HYUNDAI.KIA_SORENTO_2024), CarTestRoute("fc19648042eb6896|2023-08-16--11-43-27", HYUNDAI.KIA_SORENTO_HEV_4TH_GEN, segment=14), CarTestRoute("628935d7d3e5f4f7|2022-11-30--01-12-46", HYUNDAI.KIA_SORENTO_HEV_4TH_GEN), # plug-in hybrid CarTestRoute("9c917ba0d42ffe78|2020-04-17--12-43-19", HYUNDAI.HYUNDAI_PALISADE), diff --git a/opendbc/car/torque_data/override.toml b/opendbc/car/torque_data/override.toml index 6ee290147a9..be56ee510f3 100644 --- a/opendbc/car/torque_data/override.toml +++ b/opendbc/car/torque_data/override.toml @@ -75,6 +75,7 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"] "HYUNDAI_SONATA_2024" = [2.5, 2.5, 0.1] "HYUNDAI_SONATA_HEV_2024" = [2.5, 2.5, 0.1] "HYUNDAI_KONA_2ND_GEN" = [2.5, 2.5, 0.1] +"KIA_SORENTO_2024" = [2.5, 2.5, 0.1] # Dashcam or fallback configured as ideal car "MOCK" = [10.0, 10, 0.0] From a6142165df781731b8140240acb6b540b1e83c2f Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 14 Dec 2024 02:11:19 -0500 Subject: [PATCH 022/316] KIA_K5_2025 --- opendbc/car/hyundai/carcontroller.py | 2 +- opendbc/car/hyundai/carstate.py | 2 +- opendbc/car/hyundai/fingerprints.py | 8 ++++++++ opendbc/car/hyundai/values.py | 4 ++++ opendbc/car/tests/routes.py | 1 + opendbc/car/torque_data/override.toml | 1 + 6 files changed, 16 insertions(+), 2 deletions(-) diff --git a/opendbc/car/hyundai/carcontroller.py b/opendbc/car/hyundai/carcontroller.py index b06d64ab0e7..24645ccd870 100644 --- a/opendbc/car/hyundai/carcontroller.py +++ b/opendbc/car/hyundai/carcontroller.py @@ -116,7 +116,7 @@ def update(self, CC, CS, now_nanos): # LFA and HDA icons if self.frame % 5 == 0 and (not hda2 or hda2_long): - if self.car_fingerprint in (CAR.HYUNDAI_SONATA_2024, CAR.HYUNDAI_SONATA_HEV_2024, CAR.HYUNDAI_KONA_2ND_GEN, CAR.HYUNDAI_KONA_EV_2ND_GEN, CAR.KIA_SORENTO_2024,): + if self.car_fingerprint in (CAR.HYUNDAI_SONATA_2024, CAR.HYUNDAI_SONATA_HEV_2024, CAR.HYUNDAI_KONA_2ND_GEN, CAR.HYUNDAI_KONA_EV_2ND_GEN, CAR.KIA_SORENTO_2024, CAR.KIA_K5_2025,): can_sends.extend(hyundaicanfd.create_ccnc(self.packer, self.CAN, self.frame, self.CP, CC, CS)) else: can_sends.append(hyundaicanfd.create_lfahda_cluster(self.packer, self.CAN, CC.enabled)) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index 406f72c8c41..492cdb1bcd4 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -51,7 +51,7 @@ def __init__(self, CP): self.cruise_info = {} - self.ccnc_car = CP.carFingerprint in (CAR.HYUNDAI_SONATA_2024, CAR.HYUNDAI_SONATA_HEV_2024, CAR.HYUNDAI_KONA_2ND_GEN, CAR.HYUNDAI_KONA_EV_2ND_GEN, CAR.KIA_SORENTO_2024,) + self.ccnc_car = CP.carFingerprint in (CAR.HYUNDAI_SONATA_2024, CAR.HYUNDAI_SONATA_HEV_2024, CAR.HYUNDAI_KONA_2ND_GEN, CAR.HYUNDAI_KONA_EV_2ND_GEN, CAR.KIA_SORENTO_2024, CAR.KIA_K5_2025,) self.msg_161 = {} self.msg_162 = {} diff --git a/opendbc/car/hyundai/fingerprints.py b/opendbc/car/hyundai/fingerprints.py index 7f378447ff0..0cd3a18c895 100644 --- a/opendbc/car/hyundai/fingerprints.py +++ b/opendbc/car/hyundai/fingerprints.py @@ -616,6 +616,14 @@ b'\xf1\x00DL ESC \t 102"\x08\x10 58910-L3800', ], }, + CAR.KIA_K5_2025: { + (Ecu.fwdRadar, 0x7d0, None): [ + b'\xf1\x00DL3_ RDR ----- 1.00 1.01 99110-L2500 ', + ], + (Ecu.fwdCamera, 0x7c4, None): [ + b'\xf1\x00DL3 MFC AT USA LHD 1.00 1.04 99210-L2500 240117', + ], + }, CAR.KIA_K5_HEV_2020: { (Ecu.fwdRadar, 0x7d0, None): [ b'\xf1\x00DLhe SCC FHCUP 1.00 1.02 99110-L7000 ', diff --git a/opendbc/car/hyundai/values.py b/opendbc/car/hyundai/values.py index c5213ee8a01..1155924f5bd 100644 --- a/opendbc/car/hyundai/values.py +++ b/opendbc/car/hyundai/values.py @@ -366,6 +366,10 @@ class CAR(Platforms): CarSpecs(mass=3381 * CV.LB_TO_KG, wheelbase=2.85, steerRatio=13.27, tireStiffnessFactor=0.5), # 2021 Kia K5 Steering Ratio (all trims) flags=HyundaiFlags.CHECKSUM_CRC8, ) + KIA_K5_2025 = HyundaiCanFDPlatformConfig( + [HyundaiCarDocs("Kia K5 2025", "Highway Driving Assist", car_parts=CarParts.common([CarHarness.hyundai_m]))], + CarSpecs(mass=3230 * CV.LB_TO_KG, wheelbase=2.85, steerRatio=13.27), + ) KIA_K5_HEV_2020 = HyundaiPlatformConfig( [HyundaiCarDocs("Kia K5 Hybrid 2020-22", car_parts=CarParts.common([CarHarness.hyundai_a]))], KIA_K5_2021.specs, diff --git a/opendbc/car/tests/routes.py b/opendbc/car/tests/routes.py index c742573bac6..c044a350327 100644 --- a/opendbc/car/tests/routes.py +++ b/opendbc/car/tests/routes.py @@ -166,6 +166,7 @@ class CarTestRoute(NamedTuple): CarTestRoute("68d6a96e703c00c9|2022-09-10--16-09-39", HYUNDAI.KIA_EV6), # HDA1 CarTestRoute("9b25e8c1484a1b67|2023-04-13--10-41-45", HYUNDAI.KIA_EV6), CarTestRoute("007d5e4ad9f86d13|2021-09-30--15-09-23", HYUNDAI.KIA_K5_2021), + CarTestRoute("todo", HYUNDAI.KIA_K5_2025), CarTestRoute("c58dfc9fc16590e0|2023-01-14--13-51-48", HYUNDAI.KIA_K5_HEV_2020), CarTestRoute("78ad5150de133637|2023-09-13--16-15-57", HYUNDAI.KIA_K8_HEV_1ST_GEN), CarTestRoute("50c6c9b85fd1ff03|2020-10-26--17-56-06", HYUNDAI.KIA_NIRO_EV), diff --git a/opendbc/car/torque_data/override.toml b/opendbc/car/torque_data/override.toml index be56ee510f3..87797dbd08d 100644 --- a/opendbc/car/torque_data/override.toml +++ b/opendbc/car/torque_data/override.toml @@ -76,6 +76,7 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"] "HYUNDAI_SONATA_HEV_2024" = [2.5, 2.5, 0.1] "HYUNDAI_KONA_2ND_GEN" = [2.5, 2.5, 0.1] "KIA_SORENTO_2024" = [2.5, 2.5, 0.1] +"KIA_K5_2025" = [2.5, 2.5, 0.1] # Dashcam or fallback configured as ideal car "MOCK" = [10.0, 10, 0.0] From 920d3105e44a02c51e0f4d59d8b96b610dc0beb5 Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 14 Dec 2024 02:14:10 -0500 Subject: [PATCH 023/316] < 160 --- opendbc/car/hyundai/carcontroller.py | 9 ++++++++- opendbc/car/hyundai/carstate.py | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/opendbc/car/hyundai/carcontroller.py b/opendbc/car/hyundai/carcontroller.py index 24645ccd870..72157902324 100644 --- a/opendbc/car/hyundai/carcontroller.py +++ b/opendbc/car/hyundai/carcontroller.py @@ -116,7 +116,14 @@ def update(self, CC, CS, now_nanos): # LFA and HDA icons if self.frame % 5 == 0 and (not hda2 or hda2_long): - if self.car_fingerprint in (CAR.HYUNDAI_SONATA_2024, CAR.HYUNDAI_SONATA_HEV_2024, CAR.HYUNDAI_KONA_2ND_GEN, CAR.HYUNDAI_KONA_EV_2ND_GEN, CAR.KIA_SORENTO_2024, CAR.KIA_K5_2025,): + if self.car_fingerprint in ( + CAR.HYUNDAI_SONATA_2024, + CAR.HYUNDAI_SONATA_HEV_2024, + CAR.HYUNDAI_KONA_2ND_GEN, + CAR.HYUNDAI_KONA_EV_2ND_GEN, + CAR.KIA_SORENTO_2024, + CAR.KIA_K5_2025, + ): can_sends.extend(hyundaicanfd.create_ccnc(self.packer, self.CAN, self.frame, self.CP, CC, CS)) else: can_sends.append(hyundaicanfd.create_lfahda_cluster(self.packer, self.CAN, CC.enabled)) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index 492cdb1bcd4..f91b9bbc0b0 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -51,7 +51,14 @@ def __init__(self, CP): self.cruise_info = {} - self.ccnc_car = CP.carFingerprint in (CAR.HYUNDAI_SONATA_2024, CAR.HYUNDAI_SONATA_HEV_2024, CAR.HYUNDAI_KONA_2ND_GEN, CAR.HYUNDAI_KONA_EV_2ND_GEN, CAR.KIA_SORENTO_2024, CAR.KIA_K5_2025,) + self.ccnc_car = CP.carFingerprint in ( + CAR.HYUNDAI_SONATA_2024, + CAR.HYUNDAI_SONATA_HEV_2024, + CAR.HYUNDAI_KONA_2ND_GEN, + CAR.HYUNDAI_KONA_EV_2ND_GEN, + CAR.KIA_SORENTO_2024, + CAR.KIA_K5_2025, + ) self.msg_161 = {} self.msg_162 = {} From b640a7679ea97ba4552dfb7b86d8fa54f16d98f0 Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 14 Dec 2024 02:16:50 -0500 Subject: [PATCH 024/316] ws --- opendbc/car/hyundai/carcontroller.py | 10 +++++----- opendbc/car/hyundai/carstate.py | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/opendbc/car/hyundai/carcontroller.py b/opendbc/car/hyundai/carcontroller.py index 72157902324..b72155e4996 100644 --- a/opendbc/car/hyundai/carcontroller.py +++ b/opendbc/car/hyundai/carcontroller.py @@ -117,11 +117,11 @@ def update(self, CC, CS, now_nanos): # LFA and HDA icons if self.frame % 5 == 0 and (not hda2 or hda2_long): if self.car_fingerprint in ( - CAR.HYUNDAI_SONATA_2024, - CAR.HYUNDAI_SONATA_HEV_2024, - CAR.HYUNDAI_KONA_2ND_GEN, - CAR.HYUNDAI_KONA_EV_2ND_GEN, - CAR.KIA_SORENTO_2024, + CAR.HYUNDAI_SONATA_2024, + CAR.HYUNDAI_SONATA_HEV_2024, + CAR.HYUNDAI_KONA_2ND_GEN, + CAR.HYUNDAI_KONA_EV_2ND_GEN, + CAR.KIA_SORENTO_2024, CAR.KIA_K5_2025, ): can_sends.extend(hyundaicanfd.create_ccnc(self.packer, self.CAN, self.frame, self.CP, CC, CS)) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index f91b9bbc0b0..ba6489933e1 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -52,11 +52,11 @@ def __init__(self, CP): self.cruise_info = {} self.ccnc_car = CP.carFingerprint in ( - CAR.HYUNDAI_SONATA_2024, - CAR.HYUNDAI_SONATA_HEV_2024, - CAR.HYUNDAI_KONA_2ND_GEN, - CAR.HYUNDAI_KONA_EV_2ND_GEN, - CAR.KIA_SORENTO_2024, + CAR.HYUNDAI_SONATA_2024, + CAR.HYUNDAI_SONATA_HEV_2024, + CAR.HYUNDAI_KONA_2ND_GEN, + CAR.HYUNDAI_KONA_EV_2ND_GEN, + CAR.KIA_SORENTO_2024, CAR.KIA_K5_2025, ) self.msg_161 = {} From c5fc68ba85b388875ea1979604bc12ea42d39d3f Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 14 Dec 2024 02:35:32 -0500 Subject: [PATCH 025/316] HyundaiFlags.CCNC --- opendbc/car/hyundai/carcontroller.py | 9 +-------- opendbc/car/hyundai/carstate.py | 14 +++----------- opendbc/car/hyundai/values.py | 9 ++++++++- 3 files changed, 12 insertions(+), 20 deletions(-) diff --git a/opendbc/car/hyundai/carcontroller.py b/opendbc/car/hyundai/carcontroller.py index 83a6cc3c68d..c6e7970966a 100644 --- a/opendbc/car/hyundai/carcontroller.py +++ b/opendbc/car/hyundai/carcontroller.py @@ -116,14 +116,7 @@ def update(self, CC, CS, now_nanos): # LFA and HDA icons if self.frame % 5 == 0 and (not hda2 or hda2_long): - if self.car_fingerprint in ( - CAR.HYUNDAI_SONATA_2024, - CAR.HYUNDAI_SONATA_HEV_2024, - CAR.HYUNDAI_KONA_2ND_GEN, - CAR.HYUNDAI_KONA_EV_2ND_GEN, - CAR.KIA_SORENTO_2024, - CAR.KIA_K5_2025, - ): + if HyundaiFlags.CCNC: can_sends.extend(hyundaicanfd.create_ccnc(self.packer, self.CAN, self.frame, self.CP, CC, CS)) else: can_sends.append(hyundaicanfd.create_lfahda_cluster(self.packer, self.CAN, CC.enabled)) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index b241efb5d95..f2fd0bc2e45 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -53,14 +53,6 @@ def __init__(self, CP): self.cruise_info = {} - self.ccnc_car = CP.carFingerprint in ( - CAR.HYUNDAI_SONATA_2024, - CAR.HYUNDAI_SONATA_HEV_2024, - CAR.HYUNDAI_KONA_2ND_GEN, - CAR.HYUNDAI_KONA_EV_2ND_GEN, - CAR.KIA_SORENTO_2024, - CAR.KIA_K5_2025, - ) self.msg_161 = {} self.msg_162 = {} @@ -235,11 +227,11 @@ def update_canfd(self, can_parsers) -> structs.CarState: ret.steeringPressed = self.update_steering_pressed(abs(ret.steeringTorque) > self.params.STEER_THRESHOLD, 5) ret.steerFaultTemporary = cp.vl["MDPS"]["LKA_FAULT"] != 0 - if self.ccnc_car: + if HyundaiFlags.CCNC: self.msg_161 = copy.copy(cp_cam.vl["MSG_161"]) self.msg_162 = copy.copy(cp_cam.vl["MSG_162"]) - alt = "_ALT" if self.ccnc_car else "" + alt = "_ALT" if HyundaiFlags.CCNC else "" ret.leftBlinker, ret.rightBlinker = self.update_blinker_from_lamp(50, cp.vl["BLINKERS"][f"LEFT_LAMP{alt}"], cp.vl["BLINKERS"][f"RIGHT_LAMP{alt}"]) if self.CP.enableBsm: @@ -328,7 +320,7 @@ def get_can_parsers_canfd(self, CP): cam_messages += [ ("SCC_CONTROL", 50), ] - if self.ccnc_car: + if HyundaiFlags.CCNC: cam_messages += [ ("MSG_161", 20), ("MSG_162", 20), diff --git a/opendbc/car/hyundai/values.py b/opendbc/car/hyundai/values.py index 1155924f5bd..2ab78884fbd 100644 --- a/opendbc/car/hyundai/values.py +++ b/opendbc/car/hyundai/values.py @@ -98,6 +98,8 @@ class HyundaiFlags(IntFlag): MIN_STEER_32_MPH = 2 ** 23 + CCNC = 2 ** 24 + class Footnote(Enum): CANFD = CarFootnote( @@ -225,6 +227,7 @@ class CAR(Platforms): HYUNDAI_KONA_2ND_GEN = HyundaiCanFDPlatformConfig( [HyundaiCarDocs("Hyundai Kona 2024", car_parts=CarParts.common([CarHarness.hyundai_l]))], CarSpecs(mass=1590, wheelbase=2.66, steerRatio=13.6, tireStiffnessFactor=0.385), + flags=HyundaiFlags.CCNC, ) HYUNDAI_KONA_EV = HyundaiPlatformConfig( [HyundaiCarDocs("Hyundai Kona Electric 2018-21", car_parts=CarParts.common([CarHarness.hyundai_g]))], @@ -240,7 +243,7 @@ class CAR(Platforms): [HyundaiCarDocs("Hyundai Kona Electric (with HDA II, Korea only) 2023", video_link="https://www.youtube.com/watch?v=U2fOCmcQ8hw", car_parts=CarParts.common([CarHarness.hyundai_r]))], CarSpecs(mass=1740, wheelbase=2.66, steerRatio=13.6, tireStiffnessFactor=0.385), - flags=HyundaiFlags.EV | HyundaiFlags.CANFD_NO_RADAR_DISABLE, + flags=HyundaiFlags.EV | HyundaiFlags.CANFD_NO_RADAR_DISABLE | HyundaiFlags.CCNC, ) HYUNDAI_KONA_HEV = HyundaiPlatformConfig( [HyundaiCarDocs("Hyundai Kona Hybrid 2020", car_parts=CarParts.common([CarHarness.hyundai_i]))], # TODO: check packages, @@ -278,6 +281,7 @@ class CAR(Platforms): HYUNDAI_SONATA_2024 = HyundaiCanFDPlatformConfig( [HyundaiCarDocs("Hyundai Sonata 2024", "All", car_parts=CarParts.common([CarHarness.hyundai_a]))], CarSpecs(mass=1556, wheelbase=2.84, steerRatio=12.81), + flags=HyundaiFlags.CCNC, ) HYUNDAI_SONATA_LF = HyundaiPlatformConfig( [HyundaiCarDocs("Hyundai Sonata 2018-19", car_parts=CarParts.common([CarHarness.hyundai_e]))], @@ -318,6 +322,7 @@ class CAR(Platforms): HYUNDAI_SONATA_HEV_2024 = HyundaiCanFDPlatformConfig( [HyundaiCarDocs("Hyundai Sonata Hybrid 2024", "All", car_parts=CarParts.common([CarHarness.hyundai_a]))], CarSpecs(mass=1616, wheelbase=2.84, steerRatio=13.27), + flags=HyundaiFlags.CCNC, ) HYUNDAI_IONIQ_5 = HyundaiCanFDPlatformConfig( [ @@ -369,6 +374,7 @@ class CAR(Platforms): KIA_K5_2025 = HyundaiCanFDPlatformConfig( [HyundaiCarDocs("Kia K5 2025", "Highway Driving Assist", car_parts=CarParts.common([CarHarness.hyundai_m]))], CarSpecs(mass=3230 * CV.LB_TO_KG, wheelbase=2.85, steerRatio=13.27), + flags=HyundaiFlags.CCNC, ) KIA_K5_HEV_2020 = HyundaiPlatformConfig( [HyundaiCarDocs("Kia K5 Hybrid 2020-22", car_parts=CarParts.common([CarHarness.hyundai_a]))], @@ -476,6 +482,7 @@ class CAR(Platforms): KIA_SORENTO_2024 = HyundaiCanFDPlatformConfig( [HyundaiCarDocs("Kia Sorento 2024", car_parts=CarParts.common([CarHarness.hyundai_a]))], CarSpecs(mass=3957 * CV.LB_TO_KG, wheelbase=2.81, steerRatio=13.5), + flags=HyundaiFlags.CCNC, ) KIA_SORENTO_HEV_4TH_GEN = HyundaiCanFDPlatformConfig( [ From 43bbb5af8214f56ecb9547556117988a115c7647 Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 14 Dec 2024 05:12:23 -0500 Subject: [PATCH 026/316] cleaner --- opendbc/car/hyundai/hyundaicanfd.py | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index e6920eb54fd..b777a5d76d2 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -170,33 +170,27 @@ def create_ccnc(packer, CAN, frame, car_params, car_control, car_state): if hud_control.rightLaneDepart: msg_161["LANELINE_RIGHT"] = 4 if (frame // 50) % 2 == 0 else 1 - + # OPENPILOT LONGITUDINAL if car_params.openpilotLongitudinalControl: + # HIDE ALERTS if msg_161.get("ALERTS_5") == 4: # SMART CRUISE CONTROL CONDITIONS NOT MET msg_161["ALERTS_5"] = 0 - # BACKGROUND,SETSPEED + # BACKGROUND, SETSPEED, DISTANCE msg_161.update({ "BACKGROUND": 1 if enabled else 7, "SETSPEED": 3 if enabled else 1, "SETSPEED_HUD": 2 if enabled else 1, "SETSPEED_SPEED": 25 if (s := round(car_state.out.vCruiseCluster * CV.KPH_TO_MPH)) > 100 else s, + "DISTANCE": hud_control.leadDistanceBars, + "DISTANCE_SPACING": 1 if enabled else 0, + "DISTANCE_LEAD": 2 if enabled and hud_control.leadVisible else 1 if enabled else 0, + "DISTANCE_CAR": 2 if enabled else 1, + "ALERTS_3": hud_control.leadDistanceBars + 6, }) - # DISTANCE - if 1 <= hud_control.leadDistanceBars <= 3: - msg_161["DISTANCE"] = hud_control.leadDistanceBars - msg_161["DISTANCE_SPACING"] = 1 if enabled else 0 - msg_161["DISTANCE_LEAD"] = 2 if enabled and hud_control.leadVisible else 1 if enabled else 0 - msg_161["DISTANCE_CAR"] = 2 if enabled else 1 - msg_161["ALERTS_3"] = hud_control.leadDistanceBars + 6 - else: - msg_161["DISTANCE"] = 0 - msg_161["DISTANCE_SPACING"] = 0 - msg_161["DISTANCE_LEAD"] = 0 - msg_161["DISTANCE_CAR"] = 0 - + # LEAD msg_162.update({ "LEAD": 2 if enabled else 1 if hud_control.leadVisible else 0, "LEAD_DISTANCE": 100 if hud_control.leadVisible else 0, From fb224af386b028eb2bf7218c18cff2fe1cc5c89b Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 14 Dec 2024 05:27:29 -0500 Subject: [PATCH 027/316] shorter --- opendbc/car/hyundai/hyundaicanfd.py | 48 ++++++++++++++--------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index b777a5d76d2..277ea65c0ff 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -120,13 +120,13 @@ def create_lfahda_cluster(packer, CAN, enabled): } return packer.make_can_msg("LFAHDA_CLUSTER", CAN.ECAN, values) -def create_ccnc(packer, CAN, frame, car_params, car_control, car_state): +def create_ccnc(packer, CAN, frame, CP, CC, CS): ret = [] - msg_161 = car_state.msg_161.copy() - msg_162 = car_state.msg_162.copy() - enabled = car_control.enabled - hud_control = car_control.hudControl + msg_161 = CS.msg_161.copy() + msg_162 = CS.msg_162.copy() + enabled = CC.enabled + hud = CC.hudControl # HIDE FAULTS msg_162.update({ @@ -141,10 +141,10 @@ def create_ccnc(packer, CAN, frame, car_params, car_control, car_state): if msg_161.get("ALERTS_2") == 5: # CONSIDER TAKING A BREAK msg_161.update({"ALERTS_2": 0, "SOUNDS_2": 0, "DAW_ICON": 0}) - # LANELINES + # LANELINES, ICONS curvature = {i: (31 if i == -1 else 13 - abs(i + 15)) if i < 0 else 15 + i for i in range(-15, 16)} msg_161.update({ - "LANELINE_CURVATURE": curvature.get(max(-15, min(int(car_state.out.steeringAngleDeg / 3), 15)), 14) if enabled else 15, + "LANELINE_CURVATURE": curvature.get(max(-15, min(int(CS.out.steeringAngleDeg / 3), 15)), 14) if enabled else 15, "LFA_ICON": 2 if enabled else 0, "LKA_ICON": 4 if enabled else 0, "LANELINE_LEFT": 2 if enabled else 0, @@ -154,24 +154,24 @@ def create_ccnc(packer, CAN, frame, car_params, car_control, car_state): # LCA if enabled: - speed_below_threshold = car_state.out.vEgo < 8.94 + speed_below_threshold = CS.out.vEgo < 8.94 msg_161.update({ - "LCA_LEFT_ICON": 0 if car_state.out.leftBlindspot or speed_below_threshold else 2 if car_control.leftBlinker else 1, - "LCA_RIGHT_ICON": 0 if car_state.out.rightBlindspot or speed_below_threshold else 2 if car_control.rightBlinker else 1, - "LCA_LEFT_ARROW": 2 if car_control.leftBlinker else 0, - "LCA_RIGHT_ARROW": 2 if car_control.rightBlinker else 0, + "LCA_LEFT_ICON": 0 if CS.out.leftBlindspot or speed_below_threshold else 2 if CC.leftBlinker else 1, + "LCA_RIGHT_ICON": 0 if CS.out.rightBlindspot or speed_below_threshold else 2 if CC.rightBlinker else 1, + "LCA_LEFT_ARROW": 2 if CC.leftBlinker else 0, + "LCA_RIGHT_ARROW": 2 if CC.rightBlinker else 0, }) - # LANE DEPARTURE - if hud_control.leftLaneDepart or hud_control.rightLaneDepart: + # LDW + if hud.leftLaneDepart or hud.rightLaneDepart: msg_162["VIBRATE"] = 1 - if hud_control.leftLaneDepart: + if hud.leftLaneDepart: msg_161["LANELINE_LEFT"] = 4 if (frame // 50) % 2 == 0 else 1 - if hud_control.rightLaneDepart: + if hud.rightLaneDepart: msg_161["LANELINE_RIGHT"] = 4 if (frame // 50) % 2 == 0 else 1 - # OPENPILOT LONGITUDINAL - if car_params.openpilotLongitudinalControl: + # OP LONG + if CP.openpilotLongitudinalControl: # HIDE ALERTS if msg_161.get("ALERTS_5") == 4: # SMART CRUISE CONTROL CONDITIONS NOT MET @@ -182,18 +182,18 @@ def create_ccnc(packer, CAN, frame, car_params, car_control, car_state): "BACKGROUND": 1 if enabled else 7, "SETSPEED": 3 if enabled else 1, "SETSPEED_HUD": 2 if enabled else 1, - "SETSPEED_SPEED": 25 if (s := round(car_state.out.vCruiseCluster * CV.KPH_TO_MPH)) > 100 else s, - "DISTANCE": hud_control.leadDistanceBars, + "SETSPEED_SPEED": 25 if (s := round(CS.out.vCruiseCluster * CV.KPH_TO_MPH)) > 100 else s, + "DISTANCE": hud.leadDistanceBars, "DISTANCE_SPACING": 1 if enabled else 0, - "DISTANCE_LEAD": 2 if enabled and hud_control.leadVisible else 1 if enabled else 0, + "DISTANCE_LEAD": 2 if enabled and hud.leadVisible else 1 if enabled else 0, "DISTANCE_CAR": 2 if enabled else 1, - "ALERTS_3": hud_control.leadDistanceBars + 6, + "ALERTS_3": hud.leadDistanceBars + 6, }) # LEAD msg_162.update({ - "LEAD": 2 if enabled else 1 if hud_control.leadVisible else 0, - "LEAD_DISTANCE": 100 if hud_control.leadVisible else 0, + "LEAD": 2 if enabled else 1 if hud.leadVisible else 0, + "LEAD_DISTANCE": 100 if hud.leadVisible else 0, }) ret.append(packer.make_can_msg("MSG_161", CAN.ECAN, msg_161)) From 7c60363135268b21aa04a751c6f1dfaa8e9d0ba3 Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 14 Dec 2024 05:33:52 -0500 Subject: [PATCH 028/316] combined LANELINE --- opendbc/car/hyundai/hyundaicanfd.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 277ea65c0ff..488ad9ec8fe 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -147,8 +147,8 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): "LANELINE_CURVATURE": curvature.get(max(-15, min(int(CS.out.steeringAngleDeg / 3), 15)), 14) if enabled else 15, "LFA_ICON": 2 if enabled else 0, "LKA_ICON": 4 if enabled else 0, - "LANELINE_LEFT": 2 if enabled else 0, - "LANELINE_RIGHT": 2 if enabled else 0, + "LANELINE_LEFT": 4 if hud.leftLaneDepart and (frame // 50) % 2 == 0 else 1 if hud.leftLaneDepart else 2 if enabled else 0, + "LANELINE_RIGHT": 4 if hud.rightLaneDepart and (frame // 50) % 2 == 0 else 1 if hud.rightLaneDepart else 2 if enabled else 0, "CENTERLINE": 1 if enabled else 0, }) @@ -165,10 +165,6 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): # LDW if hud.leftLaneDepart or hud.rightLaneDepart: msg_162["VIBRATE"] = 1 - if hud.leftLaneDepart: - msg_161["LANELINE_LEFT"] = 4 if (frame // 50) % 2 == 0 else 1 - if hud.rightLaneDepart: - msg_161["LANELINE_RIGHT"] = 4 if (frame // 50) % 2 == 0 else 1 # OP LONG if CP.openpilotLongitudinalControl: From 848e8ab3e326b3b5a574fec92bfad7bf1cbbc2bf Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 14 Dec 2024 05:43:41 -0500 Subject: [PATCH 029/316] lca_min --- opendbc/car/hyundai/hyundaicanfd.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 488ad9ec8fe..9e69458d0ab 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -154,10 +154,10 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): # LCA if enabled: - speed_below_threshold = CS.out.vEgo < 8.94 + lca_min = CS.out.vEgo < 8.94 msg_161.update({ - "LCA_LEFT_ICON": 0 if CS.out.leftBlindspot or speed_below_threshold else 2 if CC.leftBlinker else 1, - "LCA_RIGHT_ICON": 0 if CS.out.rightBlindspot or speed_below_threshold else 2 if CC.rightBlinker else 1, + "LCA_LEFT_ICON": 0 if CS.out.leftBlindspot or lca_min else 2 if CC.leftBlinker else 1, + "LCA_RIGHT_ICON": 0 if CS.out.rightBlindspot or lca_min else 2 if CC.rightBlinker else 1, "LCA_LEFT_ARROW": 2 if CC.leftBlinker else 0, "LCA_RIGHT_ARROW": 2 if CC.rightBlinker else 0, }) From 5144e9915ce25e85ba225d039b8b97d620477080 Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 14 Dec 2024 05:53:06 -0500 Subject: [PATCH 030/316] combined lca --- opendbc/car/hyundai/hyundaicanfd.py | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 9e69458d0ab..89d472f6c99 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -141,27 +141,23 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): if msg_161.get("ALERTS_2") == 5: # CONSIDER TAKING A BREAK msg_161.update({"ALERTS_2": 0, "SOUNDS_2": 0, "DAW_ICON": 0}) - # LANELINES, ICONS + # LANELINES, ICONS, LCA curvature = {i: (31 if i == -1 else 13 - abs(i + 15)) if i < 0 else 15 + i for i in range(-15, 16)} + lca_min = CS.out.vEgo < 8.94 + msg_161.update({ - "LANELINE_CURVATURE": curvature.get(max(-15, min(int(CS.out.steeringAngleDeg / 3), 15)), 14) if enabled else 15, "LFA_ICON": 2 if enabled else 0, "LKA_ICON": 4 if enabled else 0, + "LCA_LEFT_ICON": 0 if CS.out.leftBlindspot or lca_min or not enabled else 2 if CC.leftBlinker else 1, + "LCA_RIGHT_ICON": 0 if CS.out.rightBlindspot or lca_min or not enabled else 2 if CC.rightBlinker else 1, + "LCA_LEFT_ARROW": 2 if CC.leftBlinker and enabled else 0, + "LCA_RIGHT_ARROW": 2 if CC.rightBlinker and enabled else 0, "LANELINE_LEFT": 4 if hud.leftLaneDepart and (frame // 50) % 2 == 0 else 1 if hud.leftLaneDepart else 2 if enabled else 0, "LANELINE_RIGHT": 4 if hud.rightLaneDepart and (frame // 50) % 2 == 0 else 1 if hud.rightLaneDepart else 2 if enabled else 0, + "LANELINE_CURVATURE": curvature.get(max(-15, min(int(CS.out.steeringAngleDeg / 3), 15)), 14) if enabled else 15, "CENTERLINE": 1 if enabled else 0, }) - # LCA - if enabled: - lca_min = CS.out.vEgo < 8.94 - msg_161.update({ - "LCA_LEFT_ICON": 0 if CS.out.leftBlindspot or lca_min else 2 if CC.leftBlinker else 1, - "LCA_RIGHT_ICON": 0 if CS.out.rightBlindspot or lca_min else 2 if CC.rightBlinker else 1, - "LCA_LEFT_ARROW": 2 if CC.leftBlinker else 0, - "LCA_RIGHT_ARROW": 2 if CC.rightBlinker else 0, - }) - # LDW if hud.leftLaneDepart or hud.rightLaneDepart: msg_162["VIBRATE"] = 1 From b31006fc35669b82611986acee3395830c1979f1 Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 14 Dec 2024 05:53:26 -0500 Subject: [PATCH 031/316] should be ok --- opendbc/car/hyundai/hyundaicanfd.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 89d472f6c99..d69351de5a3 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -143,13 +143,11 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): # LANELINES, ICONS, LCA curvature = {i: (31 if i == -1 else 13 - abs(i + 15)) if i < 0 else 15 + i for i in range(-15, 16)} - lca_min = CS.out.vEgo < 8.94 - msg_161.update({ "LFA_ICON": 2 if enabled else 0, "LKA_ICON": 4 if enabled else 0, - "LCA_LEFT_ICON": 0 if CS.out.leftBlindspot or lca_min or not enabled else 2 if CC.leftBlinker else 1, - "LCA_RIGHT_ICON": 0 if CS.out.rightBlindspot or lca_min or not enabled else 2 if CC.rightBlinker else 1, + "LCA_LEFT_ICON": 0 if CS.out.leftBlindspot or CS.out.vEgo < 8.94 or not enabled else 2 if CC.leftBlinker else 1, + "LCA_RIGHT_ICON": 0 if CS.out.rightBlindspot or CS.out.vEgo < 8.94 or not enabled else 2 if CC.rightBlinker else 1, "LCA_LEFT_ARROW": 2 if CC.leftBlinker and enabled else 0, "LCA_RIGHT_ARROW": 2 if CC.rightBlinker and enabled else 0, "LANELINE_LEFT": 4 if hud.leftLaneDepart and (frame // 50) % 2 == 0 else 1 if hud.leftLaneDepart else 2 if enabled else 0, From 6df2b93b511d2f78d8edc7ab76444aed758fbe66 Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 14 Dec 2024 06:04:11 -0500 Subject: [PATCH 032/316] faster? --- opendbc/car/hyundai/hyundaicanfd.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index d69351de5a3..3f38d2d44a0 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -129,15 +129,13 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): hud = CC.hudControl # HIDE FAULTS - msg_162.update({ - "FAULT_LSS": 0, - "FAULT_HDA": 0, - "FAULT_DAS": 0, - }) + for f in ("FAULT_LSS", "FAULT_HDA", "FAULT_DAS"): + msg_162[f] = 0 # HIDE ALERTS if msg_161.get("ALERTS_5") == 5: # USE SWITCH OR PEDAL TO ACCELERATE msg_161["ALERTS_5"] = 0 + if msg_161.get("ALERTS_2") == 5: # CONSIDER TAKING A BREAK msg_161.update({"ALERTS_2": 0, "SOUNDS_2": 0, "DAW_ICON": 0}) From 8e3d143168b2d0b6af99699372e1581840d58119 Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 14 Dec 2024 06:05:38 -0500 Subject: [PATCH 033/316] better comments --- opendbc/car/hyundai/hyundaicanfd.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 3f38d2d44a0..c26b96eeb85 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -133,10 +133,10 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): msg_162[f] = 0 # HIDE ALERTS - if msg_161.get("ALERTS_5") == 5: # USE SWITCH OR PEDAL TO ACCELERATE + if msg_161.get("ALERTS_5") == 5: # USE_SWITCH_OR_PEDAL_TO_ACCELERATE msg_161["ALERTS_5"] = 0 - if msg_161.get("ALERTS_2") == 5: # CONSIDER TAKING A BREAK + if msg_161.get("ALERTS_2") == 5: # CONSIDER_TAKING_A_BREAK msg_161.update({"ALERTS_2": 0, "SOUNDS_2": 0, "DAW_ICON": 0}) # LANELINES, ICONS, LCA @@ -162,7 +162,7 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): if CP.openpilotLongitudinalControl: # HIDE ALERTS - if msg_161.get("ALERTS_5") == 4: # SMART CRUISE CONTROL CONDITIONS NOT MET + if msg_161.get("ALERTS_5") == 4: # SMART_CRUISE_CONTROL_CONDITIONS_NOT_MET msg_161["ALERTS_5"] = 0 # BACKGROUND, SETSPEED, DISTANCE From e5d8546194b75143a903706cef5211103ccb6802 Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 14 Dec 2024 13:39:33 -0500 Subject: [PATCH 034/316] fwdCamera then fwdRadar --- opendbc/car/hyundai/fingerprints.py | 32 ++++++++++++++--------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/opendbc/car/hyundai/fingerprints.py b/opendbc/car/hyundai/fingerprints.py index ce257eb9b4f..6593c2052df 100644 --- a/opendbc/car/hyundai/fingerprints.py +++ b/opendbc/car/hyundai/fingerprints.py @@ -198,13 +198,13 @@ ], }, CAR.HYUNDAI_SONATA_2024: { - (Ecu.fwdRadar, 0x7d0, None): [ - b'\xf1\x00DN8_ RDR ----- 1.00 1.00 99110-L1800 ', - ], (Ecu.fwdCamera, 0x7c4, None): [ b'\xf1\x00DN8 MFC AT USA LHD 1.00 1.01 99211-L1800 230512', b'\xf1\x00DN8 MFC AT KOR LHD 1.00 1.01 99211-L1800 230512', ], + (Ecu.fwdRadar, 0x7d0, None): [ + b'\xf1\x00DN8_ RDR ----- 1.00 1.00 99110-L1800 ', + ], }, CAR.HYUNDAI_SONATA_LF: { (Ecu.fwdRadar, 0x7d0, None): [ @@ -545,14 +545,14 @@ ], }, CAR.HYUNDAI_KONA_2ND_GEN: { - (Ecu.fwdRadar, 0x7d0, None): [ - b'\xf1\x00SX2_ RDR ----- 1.00 1.02 99110-BE000 ', - b'\xf1\x00SX2_ RDR ----- 1.00 1.02 99110-BE500 ', - ], (Ecu.fwdCamera, 0x7c4, None): [ b'\xf1\x00SX2 MFC AT USA LHD 1.00 1.03 99211-BE000 230517', b'\xf1\x00SX2 MFC AT USA LHD 1.00 1.07 99211-BE000 240611', ], + (Ecu.fwdRadar, 0x7d0, None): [ + b'\xf1\x00SX2_ RDR ----- 1.00 1.02 99110-BE000 ', + b'\xf1\x00SX2_ RDR ----- 1.00 1.02 99110-BE500 ', + ], }, CAR.KIA_CEED: { (Ecu.fwdRadar, 0x7d0, None): [ @@ -618,12 +618,12 @@ ], }, CAR.KIA_K5_2025: { - (Ecu.fwdRadar, 0x7d0, None): [ - b'\xf1\x00DL3_ RDR ----- 1.00 1.01 99110-L2500 ', - ], (Ecu.fwdCamera, 0x7c4, None): [ b'\xf1\x00DL3 MFC AT USA LHD 1.00 1.04 99210-L2500 240117', ], + (Ecu.fwdRadar, 0x7d0, None): [ + b'\xf1\x00DL3_ RDR ----- 1.00 1.01 99110-L2500 ', + ], }, CAR.KIA_K5_HEV_2020: { (Ecu.fwdRadar, 0x7d0, None): [ @@ -702,12 +702,12 @@ ], }, CAR.HYUNDAI_KONA_EV_2ND_GEN: { - (Ecu.fwdRadar, 0x7d0, None): [ - b'\xf1\x00SXev RDR ----- 1.00 1.00 99110-BF000 ', - ], (Ecu.fwdCamera, 0x7c4, None): [ b'\xf1\x00SX2EMFC AT KOR LHD 1.00 1.00 99211-BF000 230410', ], + (Ecu.fwdRadar, 0x7d0, None): [ + b'\xf1\x00SXev RDR ----- 1.00 1.00 99110-BF000 ', + ], }, CAR.KIA_NIRO_EV: { (Ecu.fwdRadar, 0x7d0, None): [ @@ -971,12 +971,12 @@ ], }, CAR.HYUNDAI_SONATA_HEV_2024: { - (Ecu.fwdRadar, 0x7d0, None): [ - b'\xf1\x00DN8_ RDR ----- 1.00 1.00 99110-L1800 ', - ], (Ecu.fwdCamera, 0x7c4, None): [ b'\xf1\x00DN8HMFC AT USA LHD 1.00 1.01 99211-L1800 230512', ], + (Ecu.fwdRadar, 0x7d0, None): [ + b'\xf1\x00DN8_ RDR ----- 1.00 1.00 99110-L1800 ', + ], }, CAR.KIA_SORENTO: { (Ecu.fwdCamera, 0x7c4, None): [ From 37f3d239beec8362120e23c5827f853b4c0fcacd Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 14 Dec 2024 17:32:42 -0500 Subject: [PATCH 035/316] fix lead distance --- opendbc/car/hyundai/hyundaicanfd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index c26b96eeb85..36c41b939c7 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -181,7 +181,7 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): # LEAD msg_162.update({ "LEAD": 2 if enabled else 1 if hud.leadVisible else 0, - "LEAD_DISTANCE": 100 if hud.leadVisible else 0, + "LEAD_DISTANCE": 150, }) ret.append(packer.make_can_msg("MSG_161", CAN.ECAN, msg_161)) From 3ac1ddd22f810958bd5644585196d6b637c25457 Mon Sep 17 00:00:00 2001 From: royjr Date: Sun, 15 Dec 2024 09:55:42 -0500 Subject: [PATCH 036/316] fix lead --- opendbc/car/hyundai/hyundaicanfd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 36c41b939c7..b45ee1d7065 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -180,7 +180,7 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): # LEAD msg_162.update({ - "LEAD": 2 if enabled else 1 if hud.leadVisible else 0, + "LEAD": 2 if enabled and hud.leadVisible else 1 if hud.leadVisible else 0, "LEAD_DISTANCE": 150, }) From 79c6253ad2fb297d239857d6d6535ae1ef1539db Mon Sep 17 00:00:00 2001 From: royjr Date: Sun, 15 Dec 2024 09:56:10 -0500 Subject: [PATCH 037/316] add left/right lane --- opendbc/car/hyundai/hyundaicanfd.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index b45ee1d7065..698068caaf9 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -148,6 +148,8 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): "LCA_RIGHT_ICON": 0 if CS.out.rightBlindspot or CS.out.vEgo < 8.94 or not enabled else 2 if CC.rightBlinker else 1, "LCA_LEFT_ARROW": 2 if CC.leftBlinker and enabled else 0, "LCA_RIGHT_ARROW": 2 if CC.rightBlinker and enabled else 0, + "LANE_LEFT": 1 if CC.leftBlinker and enabled else 0, + "LANE_RIGHT": 1 if CC.rightBlinker and enabled else 0, "LANELINE_LEFT": 4 if hud.leftLaneDepart and (frame // 50) % 2 == 0 else 1 if hud.leftLaneDepart else 2 if enabled else 0, "LANELINE_RIGHT": 4 if hud.rightLaneDepart and (frame // 50) % 2 == 0 else 1 if hud.rightLaneDepart else 2 if enabled else 0, "LANELINE_CURVATURE": curvature.get(max(-15, min(int(CS.out.steeringAngleDeg / 3), 15)), 14) if enabled else 15, From 87c1723967767d16ab25434fcabe97bbd55b7bc7 Mon Sep 17 00:00:00 2001 From: royjr Date: Sun, 15 Dec 2024 10:08:36 -0500 Subject: [PATCH 038/316] not needed --- opendbc/car/hyundai/hyundaicanfd.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 698068caaf9..2a6689a446f 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -146,10 +146,10 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): "LKA_ICON": 4 if enabled else 0, "LCA_LEFT_ICON": 0 if CS.out.leftBlindspot or CS.out.vEgo < 8.94 or not enabled else 2 if CC.leftBlinker else 1, "LCA_RIGHT_ICON": 0 if CS.out.rightBlindspot or CS.out.vEgo < 8.94 or not enabled else 2 if CC.rightBlinker else 1, - "LCA_LEFT_ARROW": 2 if CC.leftBlinker and enabled else 0, - "LCA_RIGHT_ARROW": 2 if CC.rightBlinker and enabled else 0, - "LANE_LEFT": 1 if CC.leftBlinker and enabled else 0, - "LANE_RIGHT": 1 if CC.rightBlinker and enabled else 0, + "LCA_LEFT_ARROW": 2 if CC.leftBlinker else 0, + "LCA_RIGHT_ARROW": 2 if CC.rightBlinker else 0, + "LANE_LEFT": 1 if CC.leftBlinker else 0, + "LANE_RIGHT": 1 if CC.rightBlinker else 0, "LANELINE_LEFT": 4 if hud.leftLaneDepart and (frame // 50) % 2 == 0 else 1 if hud.leftLaneDepart else 2 if enabled else 0, "LANELINE_RIGHT": 4 if hud.rightLaneDepart and (frame // 50) % 2 == 0 else 1 if hud.rightLaneDepart else 2 if enabled else 0, "LANELINE_CURVATURE": curvature.get(max(-15, min(int(CS.out.steeringAngleDeg / 3), 15)), 14) if enabled else 15, From 49ef8a0edc859a205cb72e8b24ac456ab0da6dff Mon Sep 17 00:00:00 2001 From: royjr Date: Mon, 16 Dec 2024 19:36:20 -0500 Subject: [PATCH 039/316] add kona ev fp --- opendbc/car/hyundai/fingerprints.py | 1 + 1 file changed, 1 insertion(+) diff --git a/opendbc/car/hyundai/fingerprints.py b/opendbc/car/hyundai/fingerprints.py index 6593c2052df..ceade13e9be 100644 --- a/opendbc/car/hyundai/fingerprints.py +++ b/opendbc/car/hyundai/fingerprints.py @@ -704,6 +704,7 @@ CAR.HYUNDAI_KONA_EV_2ND_GEN: { (Ecu.fwdCamera, 0x7c4, None): [ b'\xf1\x00SX2EMFC AT KOR LHD 1.00 1.00 99211-BF000 230410', + b'\xf1\x00SX2EMFC AT USA LHD 1.00 1.02 99211-BF000 230823', ], (Ecu.fwdRadar, 0x7d0, None): [ b'\xf1\x00SXev RDR ----- 1.00 1.00 99110-BF000 ', From 95f73ae2f158492fe8e28f6096fd3ee9a73df84e Mon Sep 17 00:00:00 2001 From: royjr Date: Mon, 16 Dec 2024 21:21:39 -0500 Subject: [PATCH 040/316] add camera data --- opendbc/dbc/hyundai_canfd.dbc | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/opendbc/dbc/hyundai_canfd.dbc b/opendbc/dbc/hyundai_canfd.dbc index 9d28bc84c4f..d3780328c1a 100644 --- a/opendbc/dbc/hyundai_canfd.dbc +++ b/opendbc/dbc/hyundai_canfd.dbc @@ -770,6 +770,29 @@ BO_ 354 MSG_162: 32 CCNC SG_ FAULT_ESS : 249|3@1+ (1,0) [0|7] "" XXX SG_ ZEROS_14 : 252|4@1+ (1,0) [0|15] "" XXX +BO_ 437 MSG_1B5: 32 XXX + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ LEFT : 24|2@1+ (1,0) [0|3] "" XXX + SG_ LEFT_LDW : 27|1@0+ (1,0) [0|1] "" XXX + SG_ LEFT_1 : 29|9@1+ (1,0) [0|511] "" XXX + SG_ LEFT_2 : 38|5@1+ (1,0) [0|31] "" XXX + SG_ LEFT_3 : 43|10@1- (1,0) [0|1023] "" XXX + SG_ LEFT_4 : 64|16@1- (1,0) [0|65535] "" XXX + SG_ LEFT_5 : 80|16@1- (1,0) [0|65535] "" XXX + SG_ RIGHT : 96|2@1+ (1,0) [0|3] "" XXX + SG_ RIGHT_LDW : 99|1@0+ (1,0) [0|1] "" XXX + SG_ RIGHT_1 : 101|9@1+ (1,0) [0|511] "" XXX + SG_ RIGHT_2 : 110|5@1+ (1,0) [0|31] "" XXX + SG_ RIGHT_3 : 115|10@1- (1,0) [0|1023] "" XXX + SG_ RIGHT_4 : 128|16@1- (1,0) [0|65535] "" XXX + SG_ RIGHT_5 : 144|16@1- (1,0) [0|65535] "" XXX + SG_ LEAD : 192|2@1+ (1,0) [0|3] "" XXX + SG_ LEAD_1 : 194|6@1+ (1,0) [0|63] "" XXX + SG_ LEAD_2 : 200|11@1- (1,0) [0|4095] "" XXX + SG_ LEAD_3 : 211|1@0+ (1,0) [0|1] "" XXX + SG_ LEAD_DISTANCE : 213|11@1+ (1,0) [0|2047] "" XXX + CM_ 272 "Alternative LKAS message, used on cars such as 2023 Ioniq 6, 2nd gen Kona. Matches LKAS except size is 32 bytes"; CM_ 676 "Contains signals with detailed lane line information. Used by ADAS ECU on HDA 2 vehicles to operate LFA."; CM_ 866 "Contains signals with detailed lane line information. Used by ADAS ECU on HDA 2 vehicles to operate LFA. Used on cars that use message 272."; From 4fd8b2df6a8c755418427eb7c137e54eda495dc1 Mon Sep 17 00:00:00 2001 From: royjr Date: Mon, 16 Dec 2024 21:45:47 -0500 Subject: [PATCH 041/316] fancy lead --- opendbc/car/hyundai/hyundaicanfd.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 2a6689a446f..9c8f4f218fc 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -2,6 +2,9 @@ from opendbc.car.common.conversions import Conversions as CV from opendbc.car.common.numpy_fast import clip from opendbc.car.hyundai.values import HyundaiFlags +import cereal.messaging as messaging + +sm = messaging.SubMaster(['radarState'], ignore_avg_freq=['radarState']) class CanBus(CanBusBase): @@ -181,10 +184,13 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): }) # LEAD - msg_162.update({ - "LEAD": 2 if enabled and hud.leadVisible else 1 if hud.leadVisible else 0, - "LEAD_DISTANCE": 150, - }) + sm.update() + if sm.updated['radarState']: + lead_one = sm['radarState'].leadOne + if lead_one.dRel != 0: + msg_162["LEAD_DISTANCE"] = max(0, min(int(lead_one.dRel * 3.28084 * 3), 1000)) + msg_162["LEAD_LATERAL"] = - max(-45, min(int(lead_one.yRel * 1), 45)) + msg_162["LEAD"] = 2 if enabled and hud.leadVisible else 1 if hud.leadVisible else 0 ret.append(packer.make_can_msg("MSG_161", CAN.ECAN, msg_161)) ret.append(packer.make_can_msg("MSG_162", CAN.ECAN, msg_162)) From 95719e2cf6ae54b0e8f2f14d768f68665bdd3199 Mon Sep 17 00:00:00 2001 From: royjr Date: Mon, 16 Dec 2024 23:27:40 -0500 Subject: [PATCH 042/316] check flags too --- opendbc/car/hyundai/carcontroller.py | 2 +- opendbc/car/hyundai/carstate.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/opendbc/car/hyundai/carcontroller.py b/opendbc/car/hyundai/carcontroller.py index c6e7970966a..bcea987d121 100644 --- a/opendbc/car/hyundai/carcontroller.py +++ b/opendbc/car/hyundai/carcontroller.py @@ -116,7 +116,7 @@ def update(self, CC, CS, now_nanos): # LFA and HDA icons if self.frame % 5 == 0 and (not hda2 or hda2_long): - if HyundaiFlags.CCNC: + if self.CP.flags & HyundaiFlags.CCNC: can_sends.extend(hyundaicanfd.create_ccnc(self.packer, self.CAN, self.frame, self.CP, CC, CS)) else: can_sends.append(hyundaicanfd.create_lfahda_cluster(self.packer, self.CAN, CC.enabled)) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index f2fd0bc2e45..15841c859f4 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -227,11 +227,11 @@ def update_canfd(self, can_parsers) -> structs.CarState: ret.steeringPressed = self.update_steering_pressed(abs(ret.steeringTorque) > self.params.STEER_THRESHOLD, 5) ret.steerFaultTemporary = cp.vl["MDPS"]["LKA_FAULT"] != 0 - if HyundaiFlags.CCNC: + if self.CP.flags & HyundaiFlags.CCNC: self.msg_161 = copy.copy(cp_cam.vl["MSG_161"]) self.msg_162 = copy.copy(cp_cam.vl["MSG_162"]) - alt = "_ALT" if HyundaiFlags.CCNC else "" + alt = "_ALT" if self.CP.flags & HyundaiFlags.CCNC else "" ret.leftBlinker, ret.rightBlinker = self.update_blinker_from_lamp(50, cp.vl["BLINKERS"][f"LEFT_LAMP{alt}"], cp.vl["BLINKERS"][f"RIGHT_LAMP{alt}"]) if self.CP.enableBsm: @@ -320,7 +320,7 @@ def get_can_parsers_canfd(self, CP): cam_messages += [ ("SCC_CONTROL", 50), ] - if HyundaiFlags.CCNC: + if CP.flags & HyundaiFlags.CCNC: cam_messages += [ ("MSG_161", 20), ("MSG_162", 20), From 2a6d2d7f11f79c77a199ea4445d7d69639af3f0d Mon Sep 17 00:00:00 2001 From: royjr Date: Mon, 16 Dec 2024 23:35:03 -0500 Subject: [PATCH 043/316] no hda2 --- opendbc/car/hyundai/carcontroller.py | 2 +- opendbc/car/hyundai/carstate.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/opendbc/car/hyundai/carcontroller.py b/opendbc/car/hyundai/carcontroller.py index bcea987d121..772bebee3d5 100644 --- a/opendbc/car/hyundai/carcontroller.py +++ b/opendbc/car/hyundai/carcontroller.py @@ -116,7 +116,7 @@ def update(self, CC, CS, now_nanos): # LFA and HDA icons if self.frame % 5 == 0 and (not hda2 or hda2_long): - if self.CP.flags & HyundaiFlags.CCNC: + if self.CP.flags & HyundaiFlags.CCNC and not hda2: can_sends.extend(hyundaicanfd.create_ccnc(self.packer, self.CAN, self.frame, self.CP, CC, CS)) else: can_sends.append(hyundaicanfd.create_lfahda_cluster(self.packer, self.CAN, CC.enabled)) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index 15841c859f4..848dab8bb44 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -227,11 +227,11 @@ def update_canfd(self, can_parsers) -> structs.CarState: ret.steeringPressed = self.update_steering_pressed(abs(ret.steeringTorque) > self.params.STEER_THRESHOLD, 5) ret.steerFaultTemporary = cp.vl["MDPS"]["LKA_FAULT"] != 0 - if self.CP.flags & HyundaiFlags.CCNC: + if self.CP.flags & HyundaiFlags.CCNC and not self.CP.flags & HyundaiFlags.CANFD_HDA2: self.msg_161 = copy.copy(cp_cam.vl["MSG_161"]) self.msg_162 = copy.copy(cp_cam.vl["MSG_162"]) - alt = "_ALT" if self.CP.flags & HyundaiFlags.CCNC else "" + alt = "_ALT" if self.CP.flags & HyundaiFlags.CCNC and not self.CP.flags & HyundaiFlags.CANFD_HDA2 else "" ret.leftBlinker, ret.rightBlinker = self.update_blinker_from_lamp(50, cp.vl["BLINKERS"][f"LEFT_LAMP{alt}"], cp.vl["BLINKERS"][f"RIGHT_LAMP{alt}"]) if self.CP.enableBsm: @@ -320,7 +320,7 @@ def get_can_parsers_canfd(self, CP): cam_messages += [ ("SCC_CONTROL", 50), ] - if CP.flags & HyundaiFlags.CCNC: + if self.CP.flags & HyundaiFlags.CCNC and not self.CP.flags & HyundaiFlags.CANFD_HDA2: cam_messages += [ ("MSG_161", 20), ("MSG_162", 20), From 1fcbb451b084a1c98db38755cfda42d28d3e56d1 Mon Sep 17 00:00:00 2001 From: royjr Date: Mon, 16 Dec 2024 23:42:04 -0500 Subject: [PATCH 044/316] Revert "fancy lead" This reverts commit 4fd8b2df6a8c755418427eb7c137e54eda495dc1. --- opendbc/car/hyundai/hyundaicanfd.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 9c8f4f218fc..2a6689a446f 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -2,9 +2,6 @@ from opendbc.car.common.conversions import Conversions as CV from opendbc.car.common.numpy_fast import clip from opendbc.car.hyundai.values import HyundaiFlags -import cereal.messaging as messaging - -sm = messaging.SubMaster(['radarState'], ignore_avg_freq=['radarState']) class CanBus(CanBusBase): @@ -184,13 +181,10 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): }) # LEAD - sm.update() - if sm.updated['radarState']: - lead_one = sm['radarState'].leadOne - if lead_one.dRel != 0: - msg_162["LEAD_DISTANCE"] = max(0, min(int(lead_one.dRel * 3.28084 * 3), 1000)) - msg_162["LEAD_LATERAL"] = - max(-45, min(int(lead_one.yRel * 1), 45)) - msg_162["LEAD"] = 2 if enabled and hud.leadVisible else 1 if hud.leadVisible else 0 + msg_162.update({ + "LEAD": 2 if enabled and hud.leadVisible else 1 if hud.leadVisible else 0, + "LEAD_DISTANCE": 150, + }) ret.append(packer.make_can_msg("MSG_161", CAN.ECAN, msg_161)) ret.append(packer.make_can_msg("MSG_162", CAN.ECAN, msg_162)) From fa03f8904650f237fa542aa0d9129df79962a87f Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 17 Dec 2024 14:38:43 -0500 Subject: [PATCH 045/316] block alert on stock long as well --- opendbc/car/hyundai/hyundaicanfd.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 2a6689a446f..621c0f81f4c 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -133,6 +133,9 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): msg_162[f] = 0 # HIDE ALERTS + if msg_161.get("ALERTS_5") == 4: # SMART_CRUISE_CONTROL_CONDITIONS_NOT_MET + msg_161["ALERTS_5"] = 0 + if msg_161.get("ALERTS_5") == 5: # USE_SWITCH_OR_PEDAL_TO_ACCELERATE msg_161["ALERTS_5"] = 0 @@ -163,10 +166,6 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): # OP LONG if CP.openpilotLongitudinalControl: - # HIDE ALERTS - if msg_161.get("ALERTS_5") == 4: # SMART_CRUISE_CONTROL_CONDITIONS_NOT_MET - msg_161["ALERTS_5"] = 0 - # BACKGROUND, SETSPEED, DISTANCE msg_161.update({ "BACKGROUND": 1 if enabled else 7, From 25faeeb77a8edc1eda3f302162cff6f6aad6fe32 Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 18 Dec 2024 10:29:39 -0500 Subject: [PATCH 046/316] blah --- opendbc/car/hyundai/hyundaicanfd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 621c0f81f4c..35488b004ca 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -1,4 +1,4 @@ -from opendbc.car import CanBusBase +blahfrom opendbc.car import CanBusBase from opendbc.car.common.conversions import Conversions as CV from opendbc.car.common.numpy_fast import clip from opendbc.car.hyundai.values import HyundaiFlags From c3cce9126d6dcc38975f0586d72bceac803aa278 Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 18 Dec 2024 10:29:45 -0500 Subject: [PATCH 047/316] Revert "blah" This reverts commit 25faeeb77a8edc1eda3f302162cff6f6aad6fe32. --- opendbc/car/hyundai/hyundaicanfd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 35488b004ca..621c0f81f4c 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -1,4 +1,4 @@ -blahfrom opendbc.car import CanBusBase +from opendbc.car import CanBusBase from opendbc.car.common.conversions import Conversions as CV from opendbc.car.common.numpy_fast import clip from opendbc.car.hyundai.values import HyundaiFlags From 10d09bb74a8903244e22c4b719ed321a32908e03 Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 19 Dec 2024 08:30:08 -0500 Subject: [PATCH 048/316] add sonata hev fp --- opendbc/car/hyundai/fingerprints.py | 1 + 1 file changed, 1 insertion(+) diff --git a/opendbc/car/hyundai/fingerprints.py b/opendbc/car/hyundai/fingerprints.py index ceade13e9be..ad88c2c48ff 100644 --- a/opendbc/car/hyundai/fingerprints.py +++ b/opendbc/car/hyundai/fingerprints.py @@ -974,6 +974,7 @@ CAR.HYUNDAI_SONATA_HEV_2024: { (Ecu.fwdCamera, 0x7c4, None): [ b'\xf1\x00DN8HMFC AT USA LHD 1.00 1.01 99211-L1800 230512', + b'\xf1\x00DN8HMFC AT KOR LHD 1.00 1.01 99211-L1800 230512', ], (Ecu.fwdRadar, 0x7d0, None): [ b'\xf1\x00DN8_ RDR ----- 1.00 1.00 99110-L1800 ', From 951210df848cb4e38c32c34b93da106c1f5fbedf Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 19 Dec 2024 10:11:50 -0500 Subject: [PATCH 049/316] sorento metric fix --- opendbc/car/hyundai/carstate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index 848dab8bb44..e0eeec2215a 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -97,7 +97,7 @@ def update(self, can_parsers) -> structs.CarState: # Mimic how dash converts to imperial. # Sorento is the only platform where CF_Clu_VehicleSpeed is already imperial when not is_metric # TODO: CGW_USM1->CF_Gway_DrLockSoundRValue may describe this - if not self.is_metric and self.CP.carFingerprint not in (CAR.KIA_SORENTO,): + if not self.is_metric and self.CP.carFingerprint not in (CAR.KIA_SORENTO, KIA_SORENTO_2024,): self.cluster_speed = math.floor(self.cluster_speed * CV.KPH_TO_MPH + CV.KPH_TO_MPH) ret.vEgoCluster = self.cluster_speed * speed_conv From e5b005c5ad9e57fb83f16c2375c0130329e489a4 Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 19 Dec 2024 11:09:12 -0500 Subject: [PATCH 050/316] whoops --- opendbc/car/hyundai/carstate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index e0eeec2215a..c42ca25397a 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -97,7 +97,7 @@ def update(self, can_parsers) -> structs.CarState: # Mimic how dash converts to imperial. # Sorento is the only platform where CF_Clu_VehicleSpeed is already imperial when not is_metric # TODO: CGW_USM1->CF_Gway_DrLockSoundRValue may describe this - if not self.is_metric and self.CP.carFingerprint not in (CAR.KIA_SORENTO, KIA_SORENTO_2024,): + if not self.is_metric and self.CP.carFingerprint not in (CAR.KIA_SORENTO, CAR.KIA_SORENTO_2024,): self.cluster_speed = math.floor(self.cluster_speed * CV.KPH_TO_MPH + CV.KPH_TO_MPH) ret.vEgoCluster = self.cluster_speed * speed_conv From fc6fda1d777dabd8df059e4eb820b19840f33811 Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 19 Dec 2024 11:23:17 -0500 Subject: [PATCH 051/316] this hurts --- opendbc/car/hyundai/hyundaicanfd.py | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 621c0f81f4c..e4d8e90db8d 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -142,33 +142,20 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): if msg_161.get("ALERTS_2") == 5: # CONSIDER_TAKING_A_BREAK msg_161.update({"ALERTS_2": 0, "SOUNDS_2": 0, "DAW_ICON": 0}) - # LANELINES, ICONS, LCA - curvature = {i: (31 if i == -1 else 13 - abs(i + 15)) if i < 0 else 15 + i for i in range(-15, 16)} + # ICONS, LANELINES msg_161.update({ "LFA_ICON": 2 if enabled else 0, "LKA_ICON": 4 if enabled else 0, - "LCA_LEFT_ICON": 0 if CS.out.leftBlindspot or CS.out.vEgo < 8.94 or not enabled else 2 if CC.leftBlinker else 1, - "LCA_RIGHT_ICON": 0 if CS.out.rightBlindspot or CS.out.vEgo < 8.94 or not enabled else 2 if CC.rightBlinker else 1, - "LCA_LEFT_ARROW": 2 if CC.leftBlinker else 0, - "LCA_RIGHT_ARROW": 2 if CC.rightBlinker else 0, - "LANE_LEFT": 1 if CC.leftBlinker else 0, - "LANE_RIGHT": 1 if CC.rightBlinker else 0, - "LANELINE_LEFT": 4 if hud.leftLaneDepart and (frame // 50) % 2 == 0 else 1 if hud.leftLaneDepart else 2 if enabled else 0, - "LANELINE_RIGHT": 4 if hud.rightLaneDepart and (frame // 50) % 2 == 0 else 1 if hud.rightLaneDepart else 2 if enabled else 0, - "LANELINE_CURVATURE": curvature.get(max(-15, min(int(CS.out.steeringAngleDeg / 3), 15)), 14) if enabled else 15, + "LANELINE_LEFT": 2 if enabled else 0, + "LANELINE_RIGHT": 2 if enabled else 0, "CENTERLINE": 1 if enabled else 0, }) - # LDW - if hud.leftLaneDepart or hud.rightLaneDepart: - msg_162["VIBRATE"] = 1 - # OP LONG if CP.openpilotLongitudinalControl: - # BACKGROUND, SETSPEED, DISTANCE + # SETSPEED, DISTANCE msg_161.update({ - "BACKGROUND": 1 if enabled else 7, "SETSPEED": 3 if enabled else 1, "SETSPEED_HUD": 2 if enabled else 1, "SETSPEED_SPEED": 25 if (s := round(CS.out.vCruiseCluster * CV.KPH_TO_MPH)) > 100 else s, From 2333093df8c02439f2dc5452158d74683f7900dc Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 19 Dec 2024 19:15:48 -0500 Subject: [PATCH 052/316] fix 161 --- opendbc/car/hyundai/hyundaicanfd.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index e4d8e90db8d..fa2c449190c 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -144,11 +144,10 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): # ICONS, LANELINES msg_161.update({ - "LFA_ICON": 2 if enabled else 0, - "LKA_ICON": 4 if enabled else 0, + "CENTERLINE": 1 if enabled else 0, "LANELINE_LEFT": 2 if enabled else 0, "LANELINE_RIGHT": 2 if enabled else 0, - "CENTERLINE": 1 if enabled else 0, + "LFA_ICON": 2 if enabled else 0, }) # OP LONG From 9d15ca507ee7afbf66b8f05e80d2acdaf441929a Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 19 Dec 2024 19:21:54 -0500 Subject: [PATCH 053/316] add LFAHDA_CLUSTER --- opendbc/car/hyundai/hyundaicanfd.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index fa2c449190c..4fd3290d2b4 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -150,6 +150,12 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): "LFA_ICON": 2 if enabled else 0, }) + # LFAHDA_CLUSTER + lfahda_cluster = { + "NEW_SIGNAL_5": 1, + "LFA_ICON": 2 if enabled else 0, + } + # OP LONG if CP.openpilotLongitudinalControl: @@ -171,6 +177,7 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): "LEAD_DISTANCE": 150, }) + ret.append(packer.make_can_msg("LFAHDA_CLUSTER", CAN.ECAN, lfahda_cluster)) ret.append(packer.make_can_msg("MSG_161", CAN.ECAN, msg_161)) ret.append(packer.make_can_msg("MSG_162", CAN.ECAN, msg_162)) From e8e008d72c4275a58e2e56742e0ee1c860116d81 Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 19 Dec 2024 19:32:45 -0500 Subject: [PATCH 054/316] fix LFA --- opendbc/car/hyundai/hyundaicanfd.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 4fd3290d2b4..13dae134cf6 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -39,16 +39,14 @@ def create_steering_messages(packer, CP, CAN, enabled, lat_active, apply_steer): ret = [] + # TODO: gate these changes to ccnc values = { - "LKA_MODE": 2, - "LKA_ICON": 2 if enabled else 1, - "TORQUE_REQUEST": apply_steer, - "LKA_ASSIST": 0, + "NEW_SIGNAL_1": 3 if lat_active else 1, + "TORQUE_REQUEST": apply_steer if lat_active else 0, "STEER_REQ": 1 if lat_active else 0, - "STEER_MODE": 0, - "HAS_LANE_SAFETY": 0, # hide LKAS settings - "NEW_SIGNAL_1": 0, - "NEW_SIGNAL_2": 0, + "NEW_SIGNAL_4": 9, + # TODO: NEW_SIGNAL_3 is 10-32+ sometimes + "NEW_SIGNAL_3": 10 if lat_active else 100, } if CP.flags & HyundaiFlags.CANFD_HDA2: From 96c3b83238b40b74b563804ac327bbb6c481142e Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 19 Dec 2024 20:51:08 -0500 Subject: [PATCH 055/316] new signal for LFAHDA_CLUSTER --- opendbc/dbc/hyundai_canfd.dbc | 1 + 1 file changed, 1 insertion(+) diff --git a/opendbc/dbc/hyundai_canfd.dbc b/opendbc/dbc/hyundai_canfd.dbc index d3780328c1a..fa1d31c9d50 100644 --- a/opendbc/dbc/hyundai_canfd.dbc +++ b/opendbc/dbc/hyundai_canfd.dbc @@ -340,6 +340,7 @@ BO_ 480 LFAHDA_CLUSTER: 16 ADRV SG_ NEW_SIGNAL_2 : 30|1@0+ (1,0) [0|1] "" XXX SG_ NEW_SIGNAL_3 : 49|1@0+ (1,0) [0|1] "" XXX SG_ NEW_SIGNAL_4 : 24|1@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_5 : 25|1@0+ (1,0) [0|1] "" XXX BO_ 490 ADRV_0x1ea: 32 ADRV SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX From 6a0439dd04fac8a4ac728c6779e43227ac09242b Mon Sep 17 00:00:00 2001 From: royjr Date: Fri, 20 Dec 2024 00:10:22 -0500 Subject: [PATCH 056/316] new signal for LFA --- opendbc/dbc/hyundai_canfd.dbc | 1 + 1 file changed, 1 insertion(+) diff --git a/opendbc/dbc/hyundai_canfd.dbc b/opendbc/dbc/hyundai_canfd.dbc index fa1d31c9d50..a179172c313 100644 --- a/opendbc/dbc/hyundai_canfd.dbc +++ b/opendbc/dbc/hyundai_canfd.dbc @@ -160,6 +160,7 @@ BO_ 298 LFA: 16 ADRV SG_ LKA_ASSIST : 62|1@1+ (1,0) [0|1] "" XXX SG_ LKA_MODE : 24|3@1+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_2 : 70|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_4 : 72|4@1+ (1,0) [0|15] "" XXX SG_ HAS_LANE_SAFETY : 80|1@0+ (1,0) [0|1] "" XXX SG_ NEW_SIGNAL_3 : 111|8@0+ (1,0) [0|255] "" XXX From 8a048e7de79f21b18c759b10d5b4aae97aeba3cf Mon Sep 17 00:00:00 2001 From: royjr Date: Fri, 20 Dec 2024 00:11:31 -0500 Subject: [PATCH 057/316] hide for now --- opendbc/car/hyundai/hyundaicanfd.py | 1 + 1 file changed, 1 insertion(+) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 13dae134cf6..2e6a0027bd2 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -146,6 +146,7 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): "LANELINE_LEFT": 2 if enabled else 0, "LANELINE_RIGHT": 2 if enabled else 0, "LFA_ICON": 2 if enabled else 0, + "LKA_ICON": 4 if enabled else 0, }) # LFAHDA_CLUSTER From 5e0a1d98136cd3ccaeb0ce6f5e5a6dadd11b747d Mon Sep 17 00:00:00 2001 From: royjr Date: Fri, 20 Dec 2024 00:12:27 -0500 Subject: [PATCH 058/316] ew --- opendbc/car/hyundai/hyundaicanfd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 2e6a0027bd2..bc823378475 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -46,7 +46,7 @@ def create_steering_messages(packer, CP, CAN, enabled, lat_active, apply_steer): "STEER_REQ": 1 if lat_active else 0, "NEW_SIGNAL_4": 9, # TODO: NEW_SIGNAL_3 is 10-32+ sometimes - "NEW_SIGNAL_3": 10 if lat_active else 100, + "NEW_SIGNAL_3": 10 if lat_active else 100, } if CP.flags & HyundaiFlags.CANFD_HDA2: From a5f5b805a927431e4d83d82c7ebd7b5758db0abc Mon Sep 17 00:00:00 2001 From: royjr Date: Fri, 20 Dec 2024 02:22:04 -0500 Subject: [PATCH 059/316] keep hidden --- opendbc/car/hyundai/hyundaicanfd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index bc823378475..a97f3742588 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -146,7 +146,7 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): "LANELINE_LEFT": 2 if enabled else 0, "LANELINE_RIGHT": 2 if enabled else 0, "LFA_ICON": 2 if enabled else 0, - "LKA_ICON": 4 if enabled else 0, + "LKA_ICON": 0, }) # LFAHDA_CLUSTER From fc22d28b80260fb18c257e1bced0d33c03a521b6 Mon Sep 17 00:00:00 2001 From: royjr Date: Fri, 20 Dec 2024 02:59:46 -0500 Subject: [PATCH 060/316] gate LFA --- opendbc/car/hyundai/hyundaicanfd.py | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index a97f3742588..fdf00038d75 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -39,15 +39,26 @@ def create_steering_messages(packer, CP, CAN, enabled, lat_active, apply_steer): ret = [] - # TODO: gate these changes to ccnc - values = { - "NEW_SIGNAL_1": 3 if lat_active else 1, - "TORQUE_REQUEST": apply_steer if lat_active else 0, - "STEER_REQ": 1 if lat_active else 0, - "NEW_SIGNAL_4": 9, - # TODO: NEW_SIGNAL_3 is 10-32+ sometimes - "NEW_SIGNAL_3": 10 if lat_active else 100, - } + if CP.flags & HyundaiFlags.CCNC: + values = { + "NEW_SIGNAL_1": 3 if lat_active else 1, + "TORQUE_REQUEST": apply_steer if lat_active else 0, + "STEER_REQ": 1 if lat_active else 0, + "NEW_SIGNAL_4": 9, + "NEW_SIGNAL_3": 10 if lat_active else 100, # TODO: value between 10-32+ sometimes + } + else: + values = { + "LKA_MODE": 2, + "LKA_ICON": 2 if enabled else 1, + "TORQUE_REQUEST": apply_steer, + "LKA_ASSIST": 0, + "STEER_REQ": 1 if lat_active else 0, + "STEER_MODE": 0, + "HAS_LANE_SAFETY": 0, # hide LKAS settings + "NEW_SIGNAL_1": 0, + "NEW_SIGNAL_2": 0, + } if CP.flags & HyundaiFlags.CANFD_HDA2: hda2_lkas_msg = "LKAS_ALT" if CP.flags & HyundaiFlags.CANFD_HDA2_ALT_STEERING else "LKAS" From 931370d37f24a4c49a7190881135422b0fc029f4 Mon Sep 17 00:00:00 2001 From: royjr Date: Fri, 20 Dec 2024 11:39:50 -0500 Subject: [PATCH 061/316] stop lfa beeps --- opendbc/car/hyundai/hyundaicanfd.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index fdf00038d75..150a7e370ab 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -151,6 +151,9 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): if msg_161.get("ALERTS_2") == 5: # CONSIDER_TAKING_A_BREAK msg_161.update({"ALERTS_2": 0, "SOUNDS_2": 0, "DAW_ICON": 0}) + if msg_161.get("SOUNDS_4") == 2 and msg_161.get("LFA_ICON") in (3, 0,): # LFA BEEPS + msg_161["SOUNDS_4"] = 0 + # ICONS, LANELINES msg_161.update({ "CENTERLINE": 1 if enabled else 0, From f3443201e94e0cacf08055a8d3ccfbfdbc273099 Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 21 Dec 2024 00:00:05 -0500 Subject: [PATCH 062/316] hide WATCH_FOR_SURROUNDING_VEHICLES --- opendbc/car/hyundai/hyundaicanfd.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 150a7e370ab..f6bd05acdea 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -142,6 +142,9 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): msg_162[f] = 0 # HIDE ALERTS + if msg_161.get("ALERTS_5") == 2: # WATCH_FOR_SURROUNDING_VEHICLES + msg_161["ALERTS_5"] = 0 + if msg_161.get("ALERTS_5") == 4: # SMART_CRUISE_CONTROL_CONDITIONS_NOT_MET msg_161["ALERTS_5"] = 0 From e6dd01aa0c6ad14c27789aa9c36724390a993dff Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 21 Dec 2024 00:06:23 -0500 Subject: [PATCH 063/316] only if enabled --- opendbc/car/hyundai/hyundaicanfd.py | 30 +++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index f6bd05acdea..306800c0980 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -137,25 +137,27 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): enabled = CC.enabled hud = CC.hudControl - # HIDE FAULTS - for f in ("FAULT_LSS", "FAULT_HDA", "FAULT_DAS"): - msg_162[f] = 0 + if enabled: - # HIDE ALERTS - if msg_161.get("ALERTS_5") == 2: # WATCH_FOR_SURROUNDING_VEHICLES - msg_161["ALERTS_5"] = 0 + # HIDE FAULTS + for f in ("FAULT_LSS", "FAULT_HDA", "FAULT_DAS"): + msg_162[f] = 0 - if msg_161.get("ALERTS_5") == 4: # SMART_CRUISE_CONTROL_CONDITIONS_NOT_MET - msg_161["ALERTS_5"] = 0 + # HIDE ALERTS + if msg_161.get("ALERTS_5") == 2: # WATCH_FOR_SURROUNDING_VEHICLES + msg_161["ALERTS_5"] = 0 - if msg_161.get("ALERTS_5") == 5: # USE_SWITCH_OR_PEDAL_TO_ACCELERATE - msg_161["ALERTS_5"] = 0 + if msg_161.get("ALERTS_5") == 4: # SMART_CRUISE_CONTROL_CONDITIONS_NOT_MET + msg_161["ALERTS_5"] = 0 - if msg_161.get("ALERTS_2") == 5: # CONSIDER_TAKING_A_BREAK - msg_161.update({"ALERTS_2": 0, "SOUNDS_2": 0, "DAW_ICON": 0}) + if msg_161.get("ALERTS_5") == 5: # USE_SWITCH_OR_PEDAL_TO_ACCELERATE + msg_161["ALERTS_5"] = 0 - if msg_161.get("SOUNDS_4") == 2 and msg_161.get("LFA_ICON") in (3, 0,): # LFA BEEPS - msg_161["SOUNDS_4"] = 0 + if msg_161.get("ALERTS_2") == 5: # CONSIDER_TAKING_A_BREAK + msg_161.update({"ALERTS_2": 0, "SOUNDS_2": 0, "DAW_ICON": 0}) + + if msg_161.get("SOUNDS_4") == 2 and msg_161.get("LFA_ICON") in (3, 0,): # LFA BEEPS + msg_161["SOUNDS_4"] = 0 # ICONS, LANELINES msg_161.update({ From b74a35711b2a8b6f6f5f8ed184722b9044056e20 Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 21 Dec 2024 17:33:52 -0500 Subject: [PATCH 064/316] Revert "only if enabled" This reverts commit e6dd01aa0c6ad14c27789aa9c36724390a993dff. --- opendbc/car/hyundai/hyundaicanfd.py | 30 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 306800c0980..f6bd05acdea 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -137,27 +137,25 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): enabled = CC.enabled hud = CC.hudControl - if enabled: + # HIDE FAULTS + for f in ("FAULT_LSS", "FAULT_HDA", "FAULT_DAS"): + msg_162[f] = 0 - # HIDE FAULTS - for f in ("FAULT_LSS", "FAULT_HDA", "FAULT_DAS"): - msg_162[f] = 0 + # HIDE ALERTS + if msg_161.get("ALERTS_5") == 2: # WATCH_FOR_SURROUNDING_VEHICLES + msg_161["ALERTS_5"] = 0 - # HIDE ALERTS - if msg_161.get("ALERTS_5") == 2: # WATCH_FOR_SURROUNDING_VEHICLES - msg_161["ALERTS_5"] = 0 + if msg_161.get("ALERTS_5") == 4: # SMART_CRUISE_CONTROL_CONDITIONS_NOT_MET + msg_161["ALERTS_5"] = 0 - if msg_161.get("ALERTS_5") == 4: # SMART_CRUISE_CONTROL_CONDITIONS_NOT_MET - msg_161["ALERTS_5"] = 0 + if msg_161.get("ALERTS_5") == 5: # USE_SWITCH_OR_PEDAL_TO_ACCELERATE + msg_161["ALERTS_5"] = 0 - if msg_161.get("ALERTS_5") == 5: # USE_SWITCH_OR_PEDAL_TO_ACCELERATE - msg_161["ALERTS_5"] = 0 + if msg_161.get("ALERTS_2") == 5: # CONSIDER_TAKING_A_BREAK + msg_161.update({"ALERTS_2": 0, "SOUNDS_2": 0, "DAW_ICON": 0}) - if msg_161.get("ALERTS_2") == 5: # CONSIDER_TAKING_A_BREAK - msg_161.update({"ALERTS_2": 0, "SOUNDS_2": 0, "DAW_ICON": 0}) - - if msg_161.get("SOUNDS_4") == 2 and msg_161.get("LFA_ICON") in (3, 0,): # LFA BEEPS - msg_161["SOUNDS_4"] = 0 + if msg_161.get("SOUNDS_4") == 2 and msg_161.get("LFA_ICON") in (3, 0,): # LFA BEEPS + msg_161["SOUNDS_4"] = 0 # ICONS, LANELINES msg_161.update({ From e04bac7fd35adbf0acc1a82d1c2fef0a82579091 Mon Sep 17 00:00:00 2001 From: royjr Date: Mon, 23 Dec 2024 00:08:10 -0500 Subject: [PATCH 065/316] fix alerts --- opendbc/dbc/hyundai_canfd.dbc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opendbc/dbc/hyundai_canfd.dbc b/opendbc/dbc/hyundai_canfd.dbc index a179172c313..99db5976521 100644 --- a/opendbc/dbc/hyundai_canfd.dbc +++ b/opendbc/dbc/hyundai_canfd.dbc @@ -694,8 +694,8 @@ BO_ 353 MSG_161: 32 CCNC SG_ LANE_ZOOM : 126|2@1+ (1,0) [0|3] "" XXX SG_ ALERTS_1 : 128|6@1+ (1,0) [0|63] "" XXX SG_ ALERTS_2 : 134|5@1+ (1,0) [0|3] "" XXX - SG_ ALERTS_3 : 139|4@1+ (1,0) [0|15] "" XXX - SG_ ALERTS_4 : 143|9@1+ (1,0) [0|511] "" XXX + SG_ ALERTS_3 : 139|5@1+ (1,0) [0|15] "" XXX + SG_ ALERTS_4 : 144|8@1+ (1,0) [0|511] "" XXX SG_ ALERTS_5 : 152|5@1+ (1,0) [0|7] "" XXX SG_ MUTE : 157|3@1+ (1,0) [0|7] "" XXX SG_ SOUNDS_1 : 160|4@1+ (1,0) [0|3] "" XXX From 481ff8b997397ef162ac46aa770f13fc49eec3d3 Mon Sep 17 00:00:00 2001 From: royjr Date: Mon, 23 Dec 2024 00:11:10 -0500 Subject: [PATCH 066/316] add 161 comments --- opendbc/dbc/hyundai_canfd.dbc | 40 +++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/opendbc/dbc/hyundai_canfd.dbc b/opendbc/dbc/hyundai_canfd.dbc index 99db5976521..3221eb4bbf6 100644 --- a/opendbc/dbc/hyundai_canfd.dbc +++ b/opendbc/dbc/hyundai_canfd.dbc @@ -854,3 +854,43 @@ VAL_ 1041 DRIVER_SEATBELT 0 "Unlatched" 1 "Latched"; VAL_ 1041 PASSENGER_SEATBELT 0 "Unlatched" 1 "Latched"; VAL_ 1144 DRIVE_MODE2 3 "Set Sport" 1 "Set Normal" 2 "Set Eco"; VAL_ 1240 DISTANCE_UNIT 1 "Miles" 0 "Kilometers"; +VAL_ 353 FCA_ICON 0 "HIDDEN" 1 "ORANGE" 2 "RED"; +VAL_ 353 FCA_ALT_ICON 0 "HIDDEN" 1 "ORANGE" 3 "RED"; +VAL_ 353 LKA_ICON 0 "HIDDEN" 1 "ORANGE" 3 "GRAY" 4 "GREEN"; +VAL_ 353 HBA_ICON 0 "HIDDEN" 1 "GRAY" 2 "GREEN"; +VAL_ 353 FCA_IMAGE 0 "HIDDEN" 2 "VISIBLE"; +VAL_ 353 BCA_LEFT 0 "HIDDEN" 1 "VISIBLE" 2 "VISIBLE+ICON"; +VAL_ 353 BCA_RIGHT 0 "HIDDEN" 1 "VISIBLE" 2 "VISIBLE+ICON"; +VAL_ 353 LCA_LEFT_ARROW 0 "HIDDEN" 1 "VISIBLE"; +VAL_ 353 LCA_RIGHT_ARROW 0 "HIDDEN" 1 "VISIBLE"; +VAL_ 353 CENTERLINE 0 "HIDDEN" 1 "GREEN"; +VAL_ 353 TARGET 0 "HIDDEN" 1 "BLUE" 3 "WHITE"; +VAL_ 353 LANELINE_LEFT 0 "GRAY" 1 "HIDDEN" 2 "WHITE" 4 "ORANGE" 6 "GREEN"; +VAL_ 353 LANELINE_RIGHT 0 "GRAY" 1 "HIDDEN" 2 "WHITE" 4 "ORANGE" 6 "GREEN"; +VAL_ 353 LANE_HIGHLIGHT 0 "HIDDEN" 1 "GREEN" 2 "WHITE" 3 "BLUE" 4 "ORANGE" 5 "RED"; +VAL_ 353 LANE_LEFT 0 "HIDDEN" 1 "GREEN"; +VAL_ 353 LANE_RIGHT 0 "HIDDEN" 1 "GREEN"; +VAL_ 353 LANE_ZOOM 0 "ZOOM" 1 "HIDDEN"; +VAL_ 353 ALERTS_1 0 "HIDDEN" 1 "WARNING_ONLY_CAR_CENTER" 2 "WARNING_ONLY_CAR_LEFT" 3 "WARNING_ONLY_CAR_RIGHT" 4 "WARNING_ONLY_LEFT" 5 "WARNING_ONLY_RIGHT" 11 "EMERGENCY_BRAKING_CAR_CENTER" 12 "EMERGENCY_BRAKING_CAR_LEFT" 13 "EMERGENCY_BRAKING_CAR_RIGHT" 14 "EMERGENCY_BRAKING_LEFT" 15 "EMERGENCY_BRAKING_RIGHT" 21 "EMERGENCY_STEERING_CAR_LEFT" 22 "EMERGENCY_STEERING_CAR_RIGHT" 23 "EMERGENCY_STEERING_CAR_LEFT_AWAY" 24 "EMERGENCY_STEERING_CAR_RIGHT_AWAY" 25 "EMERGENCY_STEERING_REAR_LEFT" 26 "EMERGENCY_STEERING_REAR_RIGHT" 33 "DRIVE_CAREFULLY"; +VAL_ 353 ALERTS_2 0 "HIDDEN" 1 "KEEP_HANDS_ON_STEERING_WHEEL" 2 "KEEP_HANDS_ON_STEERING_WHEEL_RED" 3 "LANE_FOLLOWING_ASSIST_DEACTIVATED" 4 "HIGHWAY_DRIVING_ASSIST_DEACTIVATED" 5 "CONSIDER_TAKING_A_BREAK" 6 "PRESS_OK_BUTTON_TO_ENABLE_LANE_CHANGE_ASSIST" 7 "COLLISION_RISK_VEHICLE_TAKING_EMERGENCY_CONTROL" 8 "TAKE_CONTROL_OF_THE_VEHICLE_IMMEDIATELY_VEHICLE_IS_STOPPING" 9 "TAKE_CONTROL_OF_THE_VEHICLE_IMMEDIATELY" 11 "HIGHWAY_DRIVING_PILOT_SYSTEM_DEACTIVATED_AUDIBLE" 12 "KEEP_YOUR_EYES_ON_THE_ROAD" 13 "HIGHWAY_DRIVING_PILOT_CONDITIONS_NOT_MET_AUDIBLE" 14 "COLLISION_RISK_VEHICLE_TAKING_EMERGENCY_CONTROL" 15 "SET_THE_WIPER_AND_LIGHT_CONTROLS_TO_AUTO" 16 "BE_PREPARED_TO_TAKE_CONTROL_OF_THE_VEHICLE_AT_ANY_TIME" 21 "TAKE_CONTROL_OF_THE_VEHICLE_IMMEDIATELY_VEHICLE_IS_STOPPING" 10 "TAKE_CONTROL_OF_THE_VEHICLE_IMMEDIATELY"; +VAL_ 353 ALERTS_3 1 "AUTOMATICALLY_ADJUSTING_TO_THE_POSTED_SPEED_LIMIT" 2 "SET_SPEED_CHANGED" 3 "AUTOMATICALLY_ADJUSTING_TO_THE_POSTED_SPEED_LIMIT" 4 "SET_SPEED_CHANGED" 7 "DISTANCE_1" 8 "DISTANCE_2" 9 "DISTANCE_3" 10 "DISTANCE_4" 17 "DRIVE_CAREFULLY" 18 "CHECK_SURROUNDINGS" 19 "CONDITIONS_NOT_MET" 20 "LANES_NOT_DETECTED" 21 "CURVE_TOO_SHARP" 22 "LANE_TOO_NARROW" 23 "ROAD_TYPE_NOT_SUPPORTED" 24 "UNAVAILABLE_WITH_HAZARD_LIGHTS_ON" 25 "VEHICLE_SPEED_IS_TOO_LOW" 26 "KEEP_HANDS_ON_STEERING_WHEEL" 27 "LANE_TYPE_NOT_SUPPORTED" 28 "LANE_ASSIST_CANCELED_STEERING_INPUT_DETECTED" 0 "HIDDEN"; +VAL_ 353 ALERTS_4 0 "HIDDEN" 1 "TAKE_FOOT_OFF_THE_ACCELERATOR_PEDAL" 2 "TAKE_FOOT_OFF_THE_BRAKE_PEDAL" 3 "UNAVAILABLE_WHILE_HIGHWAY_DRIVING_PILOT_SYSTEM_IS_ACTIVE" 4 "TO_EXIT_HDP_GRASP_THE_STEERING_WHEEL_THEN_PRESS_AND_HOLD_THE_HDP_BUTTON" 5 "ACCELERATOR_PEDAL_OPERATION_LIMITED_FOR_SAFETY" 6 "TURN_OFF_HAZARD_WARNING_LIGHTS_AND_TURN_SIGNAL" 7 "KEEP_THE_DRIVERS_SEAT_IN_A_SAFE_DRIVING_POSITION" 16 "SET_SPEED_CHANGED" 17 "ACTIVATING_WINDSHIELD_DEFOG_TO_MAINTAIN_THE_DRIVERS_VIEW" 18 "SET_THE_WIPER_AND_LIGHT_CONTROLS_TO_AUTO" 19 "VEHICLE_SPEED_REDUCED_FOR_SAFETY_MERGING_LANES_AHEAD" 20 "SPEED_REDUCED_FOR_SAFETY_CONSTRUCTION_ZONE_DETECTED" 21 "VEHICLE_SPEED_LIMITED_SENSOR_DETECTION_RANGE_LIMITED" 22 "PREPARE_TO_TAKE_CONTROL_UNSUPPORTED_ROAD_TYPE_AHEAD" 23 "PREPARE_TO_TAKE_CONTROL_ENTRANCE_AND_EXIT_RAMPS_AHEAD" 24 "PREPARE_TO_TAKE_CONTROL_TOLLGATE_AHEAD" 25 "PREPARE_TO_TAKE_CONTROL_ROAD_EVENT_AHEAD" 26 "CLEARING_PATH_FOR_EMERGENCY_VEHICLE" 27 "VEHICLE_IS_TOO_SLOW_COMPARED_TO_TRAFFIC_FLOW" 28 "AFTER_SUNSET_HDP_IS_AVAILABLE_IN_AN_INSIDE_LANE_BEHIND_A_LEADING_VEHICLE" 29 "VEHICLE_SPEED_LIMITED_MERGING_LANES_AHEAD" 30 "VEHICLE_SPEED_LIMITED_CONSTRUCTION_ZONE_DETECTED" 31 "VEHICLE_SPEED_TEMPORARILY_LIMITED_FOR_SAFETY" 32 "PRESS_AND_HOLD_THE_BUTTON_TO_ACTIVATE_HIGHWAY_DRIVING_PILOT" 40 "HIGHWAY_DRIVING_PILOT_SYSTEM_IS_AVAILABLE" 64 "RESTART_VEHICLE_AFTER_EMERGENCY_STOP" 65 "CONNECTED_SERVICES_UNAVAILABLE" 66 "AVAILABLE_AFTER_VEHICLE_SOFTWARE_IS_UPDATED" 67 "ROAD_TYPE_NOT_SUPPORTED" 68 "ONLY_AVAILABLE_WHILE_DRIVING_ON_HIGHWAY_LANES" 69 "UNAVAILABLE_WHILE_OTHER_WARNINGS_ARE_ACTIVE" 70 "CANNOT_ACTIVATE_AT_ENTRANCE_EXIT_RAMPS" 71 "LANE_UNSUPPORTED" 72 "NOT_AVAILABLE_IN_THIS_COUNTRY" 79 "CHECKING_THE_DETECTION_RANGE_OF_THE_SENSOR" 80 "SHIFT_TO_D" 81 "ENGINE_STOPPED_BY_AUTO_STOP" 82 "INCREASE_DISTANCE_FROM_VEHICLE_AHEAD" 83 "VEHICLE_SPEED_IS_TOO_HIGH" 84 "CENTER_VEHICLE_IN_THE_LANE" 85 "PARKING_ASSIST_IS_ACTIVE" 86 "ESC_ACTIVIATION_REQUIRED" 87 "UNFOLD_SIDE_VIEW_MIRRORS" 88 "UNAVAILABLE_IN_THE_OUTER_LANE_AFTER_SUNSET" 89 "VEHICLE_SPEED_LIMITED_AFTER_SUNSET_FOR_SAFETY" 90 "LEADING_VEHICLE_NOT_DETECTED" 104 "AGGRESSIVE_BRAKING_OR_STEERING_DETECTED" 110 "SENSOR_AUTO_CALIBRATION_IN_PROGRESS_THIS_MAY_TAKE_SEVERAL_MINUTES" 111 "HIGHWAY_DRIVING_PILOT_WILL_BE_AVAILABLE_SHORTLY" 112 "IF_STEERING_WHEEL_IS_USED_HDP_WILL_BE_DEACTIVATED" 120 "IMPACT_DETECTED" 128 "UNSUITABLE_USE_OF_ACCELERATOR_PEDAL_DETECTED" 129 "GEAR_SHIFTER_USE_DETECTED" 130 "UNSUITABLE_BRAKE_PEDAL_USE_DETECTED" 131 "VEHICLE_START_BUTTON_PRESSED" 132 "VEHICLE_HAS_BEEN_STOPPED_FOR_TOO_LONG" 141 "TRAFFIC_CONGESTION_HAS_CLEARED" 142 "ENTRANCE_AND_EXIT_RAMPS_AHEAD" 143 "UNSUPPORTED_LANE_AHEAD" 144 "UNSUPPORTED_ROAD_TYPE_AHEAD" 145 "LANE_DEPARTURE_DETECTED" 146 "MAXIMUM_SPEED_EXCEEDED" 147 "HIGHWAY_DRIVING_PILOT_LIMITED_ABNORMAL_VEHICLE_CONTROLLER_STATUS" 148 "WIPER_LIGHT_CONTROL_SETTINGS_ARE_UNSUITABLE_FOR_USE_WITH_HDP" 149 "WINDSHIELD_DEFOG_SYSTEM_STATUS_IS_UNSUITABLE_FOR_USE_WITH_HDP" 150 "HAZARD_WARNING_LIGHTS_OR_TURN_SIGNAL_OPERATION_DETECTED" 151 "PERFORMING_EVASIVE_STEERING_OBSTACLES_DETECTED_AHEAD" 152 "HIGHWAY_DRIVING_PILOT_LIMITED_SENSOR_DETECTION_RANGE_LIMITED" 160 "CHECK_HIGHWAY_DRIVING_PILOT_SYSTEM" 161 "SAFETY_FUNCTION_ACTIVATED" 176 "CAMERA_OBSCURED" 177 "RADAR_BLOCKED" 178 "LIDAR_BLOCKED" 179 "AIRBAG_WARNING_LIGHT_IS_ON" 180 "ATTACHED_TRAILED_DETECTED" 181 "HIGH_OUTSIDE_TEMPERATURE" 182 "LOW_OUTSIDE_TEMPERATURE" 190 "UNAVAILABLE_DUE_TO_THE_ROAD_EVENT_INFORMATION_RECEIVED" 191 "UNAVAILABLE_NEAR_TOLLGATES" 192 "DRIVERS_SEAT_IS_NOT_IN_A_SAFE_DRIVING_POSITION" 193 "VEHICLE_DRIVING_THE_WRONG_WAY_DETECTED_AHEAD" 194 "EMERGENCY_VEHICLE_DETECTED" 195 "OBSTACLE_DETECTED_AHEAD" 196 "SENSOR_BLOCKED_DUE_TO_RAIN_SNOW_OR_ROAD_DEBRIS" 197 "SLIPPERY_ROAD_SURFACE_DETECTED" 198 "CONSTRUCTION_ZONE_DETECTED_AHEAD" 199 "PEDESTRIAN_DETECTED_AHEAD" 200 "UNSUITABLE_DRIVERS_SEAT_POSITION_DETECTED" 201 "FOLDED_SIDE_VIEW_MIRRORS_DETECTED" 208 "VEHICLE_POSITION_NOT_DETECTED" 209 "LANE_NOT_DETECTED" 210 "DRIVER_NOT_DETECTED" 211 "KEEP_YOUR_EYES_ON_THE_ROAD" 212 "LEADING_VEHICLE_REQUIRED_AFTER_SUNSET" 213 "TBD" 240 "LOW_FUEL" 241 "LOW_TIRE_PRESSURE" 242 "DOOR_OPEN" 243 "TRUNK_OPEN" 244 "HOOD_OPEN" 245 "SEAT_BELT_NOT_FASTENED" 246 "PARKING_BRAKE_ACTIVATED" 247 "LOW_EV_BATTERY" 248 "HDP_DEACTIVATION_DELAYED_RISK_OF_COLLISION_DETECTED" 249 "LIFTGATE_OPENED"; +VAL_ 353 ALERTS_5 0 "HIDDEN" 1 "DRIVERS_GRASP_NOT_DETECTED_DRIVING_SPEED_WILL_BE_LIMITED" 2 "WATCH_FOR_SURROUNDING_VEHICLES" 3 "SMART_CRUISE_CONTROL_DEACTIVATED" 4 "SMART_CRUISE_CONTROL_CONDITIONS_NOT_MET" 5 "USE_SWITCH_OR_PEDAL_TO_ACCELERATE" 6 "DRIVER_ASSISTNCE_SYSTEM_LIMITED_TRAILER_ATTACHED" 7 "DRIVER_ASSISTNCE_SYSTEM_LIMITED_DRIVER_FULL_FACE_NOT_VISIBLE" 11 "LEADING_VEHICLE_IS_DRIVING_AWAY" 12 "STOP_VEHICLE_THEN_TRY_AGAIN" 19 "ACTIVATING_HIGHWAY_DRIVING_PILOT_SYSTEM" 20 "CONTINUING_USE_OF_HIGHWAY_DRIVING_PILOT_WILL_RESULT_IN_DEVIATION_FROM_THE_NAVIGATION_ROUTE" 21 "HIGHWAY_DRIVING_PILOT_SYSTEM_DEACTIVATED_SILENT" 22 "HIGHWAY_DRIVING_PILOT_SYSTEM_NOT_APPLIED" 23 "HIGHWAY_DRIVING_PILOT_CONDITIONS_NOT_MET_SILENT"; +VAL_ 353 MUTE 0 "NONE" 1 "MUTED"; +VAL_ 353 SOUNDS_1 0 "NONE" 3 "FAST BEEP" 6 "CONSTANT BEEP"; +VAL_ 353 SOUNDS_2 0 "NONE" 2 "SINGLE CHIME" 3 "CONSTANT CHIME" 6 "FAST BEEP"; +VAL_ 353 SOUNDS_3 0 "NONE" 3 "SOFT CHIME" 5 "SINGLE CHIME"; +VAL_ 353 SOUNDS_4 0 "NONE" 2 "DOUBLE CHIME"; +VAL_ 353 SETSPEED_HUD 0 "HIDDEN" 1 "GRAY" 2 "GREEN" 3 "WHITE" 5 "CYAN"; +VAL_ 353 DISTANCE_CAR 0 "HIDDEN" 1 "GRAY" 2 "WHITE" 3 "CYAN A"; +VAL_ 353 DISTANCE_SPACING 0 "HIDDEN" 1 "BLUE" 3 "WHITE" 5 "CYAN"; +VAL_ 353 SETSPEED 0 "HIDDEN" 1 "GRAY" 2 "GREEN" 3 "WHITE" 6 "CYAN"; +VAL_ 353 HDA_ICON 0 "HIDDEN" 1 "GRAY" 2 "GREEN" 3 "WHITE" 5 "CYAN HDP"; +VAL_ 353 SLA_ICON 0 "HIDDEN" 1 "WHITE UP" 2 "WHITE DOWN" 3 "GREEN UP" 4 "GREEN DOWN"; +VAL_ 353 NAV_ICON 0 "HIDDEN" 1 "GRAY" 2 "GREEN" 4 "WHITE"; +VAL_ 353 LFA_ICON 0 "HIDDEN" 1 "GRAY" 2 "GREEN" 3 "WHITE" 5 "CYAN"; +VAL_ 353 LCA_LEFT_ICON 0 "HIDDEN" 1 "GRAY" 2 "GREEN" 4 "WHITE"; +VAL_ 353 LCA_RIGHT_ICON 0 "HIDDEN" 1 "GRAY" 2 "GREEN" 4 "WHITE"; +VAL_ 353 BACKGROUND 0 "HIDDEN" 1 "BLUE" 3 "ORANGE" 4 "FLASHING ORANGE" 6 "FLASHING RED" 7 "GRAY"; +VAL_ 353 DAW_ICON 0 "HIDDEN" 1 "ORANGE"; +VAL_ 353 CAR_CIRCLE 0 "HIDDEN" 1 "GRAY" 2 "CYAN"; From 0379af4eccfdb8f836f7cbdd0eec151494632c0e Mon Sep 17 00:00:00 2001 From: royjr Date: Mon, 23 Dec 2024 00:37:15 -0500 Subject: [PATCH 067/316] missed this --- opendbc/dbc/hyundai_canfd.dbc | 1 + 1 file changed, 1 insertion(+) diff --git a/opendbc/dbc/hyundai_canfd.dbc b/opendbc/dbc/hyundai_canfd.dbc index 3221eb4bbf6..203720978d2 100644 --- a/opendbc/dbc/hyundai_canfd.dbc +++ b/opendbc/dbc/hyundai_canfd.dbc @@ -882,6 +882,7 @@ VAL_ 353 SOUNDS_2 0 "NONE" 2 "SINGLE CHIME" 3 "CONSTANT CHIME" 6 "FAST BEEP"; VAL_ 353 SOUNDS_3 0 "NONE" 3 "SOFT CHIME" 5 "SINGLE CHIME"; VAL_ 353 SOUNDS_4 0 "NONE" 2 "DOUBLE CHIME"; VAL_ 353 SETSPEED_HUD 0 "HIDDEN" 1 "GRAY" 2 "GREEN" 3 "WHITE" 5 "CYAN"; +VAL_ 353 DISTANCE_LEAD 0 "HIDDEN" 1 "GRAY" 2 "WHITE"; VAL_ 353 DISTANCE_CAR 0 "HIDDEN" 1 "GRAY" 2 "WHITE" 3 "CYAN A"; VAL_ 353 DISTANCE_SPACING 0 "HIDDEN" 1 "BLUE" 3 "WHITE" 5 "CYAN"; VAL_ 353 SETSPEED 0 "HIDDEN" 1 "GRAY" 2 "GREEN" 3 "WHITE" 6 "CYAN"; From 6289a0dfd48c2cf055674007d8d1f45ab58c4ee3 Mon Sep 17 00:00:00 2001 From: royjr Date: Mon, 23 Dec 2024 00:39:01 -0500 Subject: [PATCH 068/316] hide DRIVE_CAREFULLY --- opendbc/car/hyundai/hyundaicanfd.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index f6bd05acdea..9a088d0a8bf 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -142,6 +142,9 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): msg_162[f] = 0 # HIDE ALERTS + if msg_161.get("ALERTS_3") == 17: # DRIVE_CAREFULLY + msg_161["ALERTS_3"] = 0 + if msg_161.get("ALERTS_5") == 2: # WATCH_FOR_SURROUNDING_VEHICLES msg_161["ALERTS_5"] = 0 From def9487d4f4e9b902fc7dd6895ce358fa6f8b959 Mon Sep 17 00:00:00 2001 From: royjr Date: Mon, 23 Dec 2024 11:36:55 -0500 Subject: [PATCH 069/316] this was stupid --- opendbc/car/hyundai/carstate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index c42ca25397a..848dab8bb44 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -97,7 +97,7 @@ def update(self, can_parsers) -> structs.CarState: # Mimic how dash converts to imperial. # Sorento is the only platform where CF_Clu_VehicleSpeed is already imperial when not is_metric # TODO: CGW_USM1->CF_Gway_DrLockSoundRValue may describe this - if not self.is_metric and self.CP.carFingerprint not in (CAR.KIA_SORENTO, CAR.KIA_SORENTO_2024,): + if not self.is_metric and self.CP.carFingerprint not in (CAR.KIA_SORENTO,): self.cluster_speed = math.floor(self.cluster_speed * CV.KPH_TO_MPH + CV.KPH_TO_MPH) ret.vEgoCluster = self.cluster_speed * speed_conv From 47c83366e08218d4aae85a7c90658ef80c3011ee Mon Sep 17 00:00:00 2001 From: royjr Date: Mon, 23 Dec 2024 11:47:15 -0500 Subject: [PATCH 070/316] sorento fix v2 --- opendbc/car/hyundai/carstate.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index 848dab8bb44..814f1038196 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -220,6 +220,9 @@ def update_canfd(self, can_parsers) -> structs.CarState: ret.vEgo, ret.aEgo = self.update_speed_kf(ret.vEgoRaw) ret.standstill = ret.wheelSpeeds.fl <= STANDSTILL_THRESHOLD and ret.wheelSpeeds.rr <= STANDSTILL_THRESHOLD + if self.is_metric and self.CP.carFingerprint in (CAR.KIA_SORENTO_2024,): + ret.vEgoCluster = ret.vEgo * CV.MPH_TO_KPH + ret.steeringRateDeg = cp.vl["STEERING_SENSORS"]["STEERING_RATE"] ret.steeringAngleDeg = cp.vl["STEERING_SENSORS"]["STEERING_ANGLE"] * -1 ret.steeringTorque = cp.vl["MDPS"]["STEERING_COL_TORQUE"] From d23a3b4cd794c83e72d9d62cf42d62e923375c54 Mon Sep 17 00:00:00 2001 From: royjr Date: Mon, 23 Dec 2024 19:36:06 -0500 Subject: [PATCH 071/316] Revert "sorento fix v2" This reverts commit 47c83366e08218d4aae85a7c90658ef80c3011ee. --- opendbc/car/hyundai/carstate.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index 814f1038196..848dab8bb44 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -220,9 +220,6 @@ def update_canfd(self, can_parsers) -> structs.CarState: ret.vEgo, ret.aEgo = self.update_speed_kf(ret.vEgoRaw) ret.standstill = ret.wheelSpeeds.fl <= STANDSTILL_THRESHOLD and ret.wheelSpeeds.rr <= STANDSTILL_THRESHOLD - if self.is_metric and self.CP.carFingerprint in (CAR.KIA_SORENTO_2024,): - ret.vEgoCluster = ret.vEgo * CV.MPH_TO_KPH - ret.steeringRateDeg = cp.vl["STEERING_SENSORS"]["STEERING_RATE"] ret.steeringAngleDeg = cp.vl["STEERING_SENSORS"]["STEERING_ANGLE"] * -1 ret.steeringTorque = cp.vl["MDPS"]["STEERING_COL_TORQUE"] From 2b3598a44b2887c068ca10f21c8476c6d97ba7ac Mon Sep 17 00:00:00 2001 From: royjr Date: Mon, 23 Dec 2024 20:14:51 -0500 Subject: [PATCH 072/316] sorento fix v3 --- opendbc/car/hyundai/hyundaicanfd.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 9a088d0a8bf..fa4a9a86d9e 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -1,7 +1,7 @@ from opendbc.car import CanBusBase from opendbc.car.common.conversions import Conversions as CV from opendbc.car.common.numpy_fast import clip -from opendbc.car.hyundai.values import HyundaiFlags +from opendbc.car.hyundai.values import HyundaiFlags, CAR class CanBus(CanBusBase): @@ -178,11 +178,13 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): # OP LONG if CP.openpilotLongitudinalControl: + setspeed_factor = 1 if CS.is_metric and CP.carFingerprint in (CAR.KIA_SORENTO_2024,) else CV.KPH_TO_MPH + # SETSPEED, DISTANCE msg_161.update({ "SETSPEED": 3 if enabled else 1, "SETSPEED_HUD": 2 if enabled else 1, - "SETSPEED_SPEED": 25 if (s := round(CS.out.vCruiseCluster * CV.KPH_TO_MPH)) > 100 else s, + "SETSPEED_SPEED": 25 if (s := round(CS.out.vCruiseCluster * setspeed_factor)) > 100 else s, "DISTANCE": hud.leadDistanceBars, "DISTANCE_SPACING": 1 if enabled else 0, "DISTANCE_LEAD": 2 if enabled and hud.leadVisible else 1 if enabled else 0, From 279ef4c3dff95d9ffc0e5ed9ecbcecd19daa19c2 Mon Sep 17 00:00:00 2001 From: royjr Date: Mon, 23 Dec 2024 23:21:17 -0500 Subject: [PATCH 073/316] metric v4 --- opendbc/car/hyundai/hyundaicanfd.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index fa4a9a86d9e..26816a44b76 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -1,7 +1,7 @@ from opendbc.car import CanBusBase from opendbc.car.common.conversions import Conversions as CV from opendbc.car.common.numpy_fast import clip -from opendbc.car.hyundai.values import HyundaiFlags, CAR +from opendbc.car.hyundai.values import HyundaiFlags class CanBus(CanBusBase): @@ -178,13 +178,11 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): # OP LONG if CP.openpilotLongitudinalControl: - setspeed_factor = 1 if CS.is_metric and CP.carFingerprint in (CAR.KIA_SORENTO_2024,) else CV.KPH_TO_MPH - # SETSPEED, DISTANCE msg_161.update({ "SETSPEED": 3 if enabled else 1, "SETSPEED_HUD": 2 if enabled else 1, - "SETSPEED_SPEED": 25 if (s := round(CS.out.vCruiseCluster * setspeed_factor)) > 100 else s, + "SETSPEED_SPEED": 25 if (s := round(CS.out.vCruiseCluster * (1 if CS.is_metric else CV.KPH_TO_MPH))) > 100 else s, "DISTANCE": hud.leadDistanceBars, "DISTANCE_SPACING": 1 if enabled else 0, "DISTANCE_LEAD": 2 if enabled and hud.leadVisible else 1 if enabled else 0, From 4fa745fefc0040ef667576935ef7de7ea07dd66f Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 24 Dec 2024 00:52:38 -0500 Subject: [PATCH 074/316] add 162 comments --- opendbc/dbc/hyundai_canfd.dbc | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/opendbc/dbc/hyundai_canfd.dbc b/opendbc/dbc/hyundai_canfd.dbc index 203720978d2..765257e3c66 100644 --- a/opendbc/dbc/hyundai_canfd.dbc +++ b/opendbc/dbc/hyundai_canfd.dbc @@ -726,7 +726,7 @@ BO_ 353 MSG_161: 32 CCNC BO_ 354 MSG_162: 32 CCNC SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ SPEEDLIMIT_STYLE : 24|4@1+ (1,0) [0|7] "" XXX + SG_ COUNTRY : 24|4@1+ (1,0) [0|7] "" XXX SG_ SPEEDLIMIT_FLASH : 28|4@1+ (1,0) [0|15] "" XXX SG_ SPEEDLIMIT : 32|8@1+ (1,0) [0|255] "" XXX SG_ SIGNS : 40|8@1+ (1,0) [0|15] "" XXX @@ -895,3 +895,25 @@ VAL_ 353 LCA_RIGHT_ICON 0 "HIDDEN" 1 "GRAY" 2 "GREEN" 4 "WHITE"; VAL_ 353 BACKGROUND 0 "HIDDEN" 1 "BLUE" 3 "ORANGE" 4 "FLASHING ORANGE" 6 "FLASHING RED" 7 "GRAY"; VAL_ 353 DAW_ICON 0 "HIDDEN" 1 "ORANGE"; VAL_ 353 CAR_CIRCLE 0 "HIDDEN" 1 "GRAY" 2 "CYAN"; +VAL_ 354 COUNTRY 0 "HIDDEN" 1 "SOUTH_KOREA" 4 "INTL" 5 "JAPAN" 6 "CANADA" 7 "USA" 8 "CHINA" 9 "INTL"; +VAL_ 354 SPEEDLIMIT_FLASH 0 "HIDDEN" 1 "ERROR" 2 "NORMAL" 4 "RED"; +VAL_ 354 SIGNS 0 "HIDDEN" 1 "PEDESTRIAN_CROSSING" 2 "SCHOOL_CROSSWALK" 8 "STOP" 9 "YIELD" 16 "DO_NOT_PASS" 19 "DO_NOT_ENTER" 24 "ROUNDABOUT" 26 "RIGHT_CURVE_AHEAD" 27 "LEFT_CURVE_AHEAD" 28 "SLIGHT_RIGHT_CURVE_AHEAD" 29 "SLIGHT_LEFT_CURVE_AHEAD"; +VAL_ 354 SPEEDLIMIT_WEATHER 0 "HIDDEN" 1 "RAIN" 2 "SNOW" 3 "RAIN+SNOW" 4 "TRAILER"; +VAL_ 354 VIBRATE 0 "NONE" 1 "VIBRATE"; +VAL_ 354 LEAD 0 "HIDDEN" 1 "GRAY BOX" 2 "WHITE BOX" 3 "GRAY CAR" 4 "WHITE CAR" 5 "GRAY TRUCK" 6 "WHITE TRUCK" 7 "GRAY PERSON" 8 "WHITE PERSON" 9 "GRAY BICYCLE" 10 "WHITE BICYCLE" 11 "GRAY MOTORCYCLE" 12 "WHITE MOTORCYCLE" 13 "DARK CONE" 14 "ORANGE CONE"; +VAL_ 354 LEAD_ALT 0 "HIDDEN" 1 "GRAY BOX" 2 "WHITE BOX" 3 "DIM CONE" 4 "ORANGE CONE"; +VAL_ 354 LEAD_LEFT 0 "HIDDEN" 1 "GRAY BOX" 2 "WHITE BOX" 3 "GRAY CAR" 4 "WHITE CAR" 5 "GRAY TRUCK" 6 "WHITE TRUCK" 7 "GRAY PERSON" 8 "WHITE PERSON" 9 "GRAY BICYCLE" 10 "WHITE BICYCLE" 11 "GRAY MOTORCYCLE" 12 "WHITE MOTORCYCLE" 13 "DARK CONE" 14 "ORANGE CONE"; +VAL_ 354 LEAD_RIGHT 0 "HIDDEN" 1 "GRAY BOX" 2 "WHITE BOX" 3 "GRAY CAR" 4 "WHITE CAR" 5 "GRAY TRUCK" 6 "WHITE TRUCK" 7 "GRAY PERSON" 8 "WHITE PERSON" 9 "GRAY BICYCLE" 10 "WHITE BICYCLE" 11 "GRAY MOTORCYCLE" 12 "WHITE MOTORCYCLE" 13 "DARK CONE" 14 "ORANGE CONE"; +VAL_ 354 FAULT_FSS 0 "HIDDEN" 1 "CHECK_FORWARD_SAFETY_SYSTEM" 2 "FORWARD_SAFETY_SYSTEM_LIMITED_CAMERA_OBSCURED" 3 "FORWARD_SAFETY_SYSTEM_LIMITED_RADAR_BLOCKED"; +VAL_ 354 FAULT_FCA 0 "HIDDEN" 1 "CHECK_FORWARD_SIDE_SAFETY_SYSTEM" 2 "FORWARD_SIDE_SAFETY_SYSTEM_LIMITED_CAMERA_OBSCURED" 3 "FORWARD_SIDE_SAFETY_SYSTEM_LIMITED_RADAR_BLOCKED"; +VAL_ 354 FAULT_LSS 0 "HIDDEN" 1 "CHECK_LANE_SAFETY_SYSTEM" 2 "LANE_SAFETY_SYSTEM_DISABLED_CAMERA_OBSCURED"; +VAL_ 354 FAULT_SLA 0 "HIDDEN" 1 "CHECK_SPEED_LIMIT_SYSTEM" 2 "SPEED_LIMIT_SYSTEM_DISABLED_CAMERA_OBSCURED"; +VAL_ 354 FAULT_DAW 0 "HIDDEN" 1 "CHECK_INATTENTIVE_DRIVING_WARNING_SYSTEM" 2 "INATTENTIVE_DRIVING_WARNING_SYSTEM_DISABLED_CAMERA_OBSCURED"; +VAL_ 354 FAULT_HBA 0 "HIDDEN" 1 "CHECK_HIGH_BEAM_ASSIST_SYSTEM"; +VAL_ 354 FAULT_SCC 0 "HIDDEN" 1 "CHECK_SMART_CRUISE_CONTROL_SYSTEM" 2 "SMART_CRUISE_CONTROL_DISABLED_RADAR_BLOCKED"; +VAL_ 354 FAULT_LFA 0 "HIDDEN" 1 "CHECK_LANE_FOLLOWING_SYSTEM_ASSIST_SYSTEM"; +VAL_ 354 FAULT_HDA 0 "HIDDEN" 1 "CHECK_HIGHWAY_DRIVING_ASSIST_SYSTEM"; +VAL_ 354 FAULT_LCA 0 "HIDDEN" 1 "CHECK_LANE_CHANGE_ASSIST_FUNCTION" 2 "LANE_CHANGE_ASSIST_FUNCTION_DISABLED_CAMERA_OBSCURED" 3 "LANE_CHANGE_ASSIST_FUNCTION_DISABLED_RADAR_BLOCKED"; +VAL_ 354 FAULT_HDP 0 "HIDDEN" 1 "CHECK_HIGHWAY_DRIVING_PILOT_SYSTEM" 2 "HIGHWAY_DRIVING_PILOT_DISABLED_CAMERA_OBSCURED" 3 "HIGHWAY_DRIVING_PILOT_DISABLED_RADAR_BLOCKED" 4 "HIGHWAY_DRIVING_PILOT_DISABLED_LIDAR_BLOCKED"; +VAL_ 354 FAULT_DAS 0 "HIDDEN" 1 "CHECK_DRIVER_ASSISTANCE_SYSTEM" 2 "DRIVER_ASSISTANCE_SYSTEM_LIMITED_CAMERA_OBSCURED" 3 "DRIVER_ASSISTANCE_SYSTEM_LIMITED_RADAR_BLOCKED" 4 "DRIVER_ASSISTANCE_SYSTEM_LIMITED_CAMERA_OBSCURED_AND_RADAR_BLOCKED"; +VAL_ 354 FAULT_ESS 0 "HIDDEN" 1 "CHECK_EMERGENCY_STOPPING_FUNCTION" 2 "EMERGENCY_STOPPING_FUNCTION_DISABLED_CAMERA_OBSCURED" 3 "EMERGENCY_STOPPING_FUNCTION_DISABLED_RADAR_BLOCKED"; From aacb0ec4121b81c917bbc29c3977b2589b2ee2e6 Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 26 Dec 2024 12:52:11 -0500 Subject: [PATCH 075/316] increase STEER_MAX for CCNC --- opendbc/car/hyundai/values.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/opendbc/car/hyundai/values.py b/opendbc/car/hyundai/values.py index 2ab78884fbd..4503a1712b1 100644 --- a/opendbc/car/hyundai/values.py +++ b/opendbc/car/hyundai/values.py @@ -33,6 +33,9 @@ def __init__(self, CP): self.STEER_DELTA_UP = 2 self.STEER_DELTA_DOWN = 3 + if CP.flags & HyundaiFlags.CCNC: + self.STEER_MAX = 384 + # To determine the limit for your car, find the maximum value that the stock LKAS will request. # If the max stock LKAS request is <384, add your car to this list. elif CP.carFingerprint in (CAR.GENESIS_G80, CAR.GENESIS_G90, CAR.HYUNDAI_ELANTRA, CAR.HYUNDAI_ELANTRA_GT_I30, CAR.HYUNDAI_IONIQ, From 4ab074a2869662d0e2cacebf3b6b2870eb068d7f Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 7 Jan 2025 23:27:31 -0500 Subject: [PATCH 076/316] lower STEER_MAX --- opendbc/car/hyundai/values.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/values.py b/opendbc/car/hyundai/values.py index cf80622dce8..73a539a87c5 100644 --- a/opendbc/car/hyundai/values.py +++ b/opendbc/car/hyundai/values.py @@ -34,7 +34,7 @@ def __init__(self, CP): self.STEER_DELTA_DOWN = 3 if CP.flags & HyundaiFlags.CCNC: - self.STEER_MAX = 384 + self.STEER_MAX = 327 # To determine the limit for your car, find the maximum value that the stock LKAS will request. # If the max stock LKAS request is <384, add your car to this list. From 3d174673e6a08158885517ca51c05e030a696cc3 Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 11 Jan 2025 18:37:42 -0500 Subject: [PATCH 077/316] back to 270 for now --- opendbc/car/hyundai/values.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/opendbc/car/hyundai/values.py b/opendbc/car/hyundai/values.py index 73a539a87c5..6a5bad27223 100644 --- a/opendbc/car/hyundai/values.py +++ b/opendbc/car/hyundai/values.py @@ -33,9 +33,6 @@ def __init__(self, CP): self.STEER_DELTA_UP = 2 self.STEER_DELTA_DOWN = 3 - if CP.flags & HyundaiFlags.CCNC: - self.STEER_MAX = 327 - # To determine the limit for your car, find the maximum value that the stock LKAS will request. # If the max stock LKAS request is <384, add your car to this list. elif CP.carFingerprint in (CAR.GENESIS_G80, CAR.GENESIS_G90, CAR.HYUNDAI_ELANTRA, CAR.HYUNDAI_ELANTRA_GT_I30, CAR.HYUNDAI_IONIQ, From 8441c1d34a68adc15e474cf0255e91343ae103ed Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 16 Jan 2025 22:54:26 -0500 Subject: [PATCH 078/316] shudderless --- opendbc/car/hyundai/hyundaicanfd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index f366d2c2cc8..831d8020fb2 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -42,7 +42,7 @@ def create_steering_messages(packer, CP, CAN, enabled, lat_active, apply_steer): if CP.flags & HyundaiFlags.CCNC: values = { "NEW_SIGNAL_1": 3 if lat_active else 1, - "TORQUE_REQUEST": apply_steer if lat_active else 0, + "TORQUE_REQUEST": apply_steer, "STEER_REQ": 1 if lat_active else 0, "NEW_SIGNAL_4": 9, "NEW_SIGNAL_3": 10 if lat_active else 100, # TODO: value between 10-32+ sometimes From a2f967f5b752a048efa378bee1f5aa4584450bcc Mon Sep 17 00:00:00 2001 From: royjr Date: Fri, 31 Jan 2025 15:10:51 -0500 Subject: [PATCH 079/316] hide lat only fault --- opendbc/car/hyundai/hyundaicanfd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 831d8020fb2..36382c1c7ec 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -138,7 +138,7 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): hud = CC.hudControl # HIDE FAULTS - for f in ("FAULT_LSS", "FAULT_HDA", "FAULT_DAS"): + for f in ("FAULT_LSS", "FAULT_HDA", "FAULT_DAS", "FAULT_LFA"): msg_162[f] = 0 # HIDE ALERTS From 36cae4108c2ae13fd0e49581d188a54cdd3f07d0 Mon Sep 17 00:00:00 2001 From: royjr Date: Sun, 2 Feb 2025 19:47:26 -0500 Subject: [PATCH 080/316] fix auto regen! --- opendbc/car/hyundai/carcontroller.py | 2 +- opendbc/car/hyundai/carstate.py | 4 ++-- opendbc/car/hyundai/hyundaicanfd.py | 11 +++++++---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/opendbc/car/hyundai/carcontroller.py b/opendbc/car/hyundai/carcontroller.py index 869d7e8ce45..b269a5ff92c 100644 --- a/opendbc/car/hyundai/carcontroller.py +++ b/opendbc/car/hyundai/carcontroller.py @@ -130,7 +130,7 @@ def update(self, CC, CS, now_nanos): can_sends.extend(hyundaicanfd.create_adrv_messages(self.packer, self.CAN, self.frame)) if self.frame % 2 == 0: can_sends.append(hyundaicanfd.create_acc_control(self.packer, self.CAN, CC.enabled, self.accel_last, accel, stopping, CC.cruiseControl.override, - set_speed_in_units, hud_control)) + set_speed_in_units, hud_control, CS.cruise_info)) self.accel_last = accel else: # button presses diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index 848dab8bb44..b79b6bd5950 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -241,16 +241,16 @@ def update_canfd(self, can_parsers) -> structs.CarState: # cruise state # CAN FD cars enable on main button press, set available if no TCS faults preventing engagement ret.cruiseState.available = cp.vl["TCS"]["ACCEnable"] == 0 + cp_cruise_info = cp_cam if self.CP.flags & HyundaiFlags.CANFD_CAMERA_SCC else cp + self.cruise_info = copy.copy(cp_cruise_info.vl["SCC_CONTROL"]) if self.CP.openpilotLongitudinalControl: # These are not used for engage/disengage since openpilot keeps track of state using the buttons ret.cruiseState.enabled = cp.vl["TCS"]["ACC_REQ"] == 1 ret.cruiseState.standstill = False else: - cp_cruise_info = cp_cam if self.CP.flags & HyundaiFlags.CANFD_CAMERA_SCC else cp ret.cruiseState.enabled = cp_cruise_info.vl["SCC_CONTROL"]["ACCMode"] in (1, 2) ret.cruiseState.standstill = cp_cruise_info.vl["SCC_CONTROL"]["CRUISE_STANDSTILL"] == 1 ret.cruiseState.speed = cp_cruise_info.vl["SCC_CONTROL"]["VSetDis"] * speed_factor - self.cruise_info = copy.copy(cp_cruise_info.vl["SCC_CONTROL"]) # Manual Speed Limit Assist is a feature that replaces non-adaptive cruise control on EV CAN FD platforms. # It limits the vehicle speed, overridable by pressing the accelerator past a certain point. diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 36382c1c7ec..4ede926ac8b 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -202,7 +202,7 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): return ret -def create_acc_control(packer, CAN, enabled, accel_last, accel, stopping, gas_override, set_speed, hud_control): +def create_acc_control(packer, CAN, enabled, accel_last, accel, stopping, gas_override, set_speed, hud_control, cruise_info): jerk = 5 jn = jerk / 50 if not enabled or gas_override: @@ -211,7 +211,11 @@ def create_acc_control(packer, CAN, enabled, accel_last, accel, stopping, gas_ov a_raw = accel a_val = np.clip(accel, accel_last - jn, accel_last + jn) - values = { + values = {s: cruise_info[s] for s in [ + "ACC_ObjDist", + "ACC_ObjRelSpd", + ]} + values.update({ "ACCMode": 0 if not enabled else (2 if gas_override else 1), "MainMode_ACC": 1, "StopReq": 1 if stopping else 0, @@ -221,14 +225,13 @@ def create_acc_control(packer, CAN, enabled, accel_last, accel, stopping, gas_ov "JerkLowerLimit": jerk if enabled else 1, "JerkUpperLimit": 3.0, - "ACC_ObjDist": 1, "ObjValid": 0, "OBJ_STATUS": 2, "SET_ME_2": 0x4, "SET_ME_3": 0x3, "SET_ME_TMP_64": 0x64, "DISTANCE_SETTING": hud_control.leadDistanceBars, - } + }) return packer.make_can_msg("SCC_CONTROL", CAN.ECAN, values) From 2a06e230fdbb772ad37ea024b5b53a64bb5a9114 Mon Sep 17 00:00:00 2001 From: royjr Date: Mon, 3 Feb 2025 20:55:40 -0500 Subject: [PATCH 081/316] HYUNDAI_TUCSON_2025 --- opendbc/car/hyundai/fingerprints.py | 8 ++++++++ opendbc/car/hyundai/values.py | 5 +++++ opendbc/car/tests/routes.py | 1 + opendbc/car/torque_data/override.toml | 1 + 4 files changed, 15 insertions(+) diff --git a/opendbc/car/hyundai/fingerprints.py b/opendbc/car/hyundai/fingerprints.py index a16d56f13cc..9c6e93ff1f4 100644 --- a/opendbc/car/hyundai/fingerprints.py +++ b/opendbc/car/hyundai/fingerprints.py @@ -1089,6 +1089,14 @@ b'\xf1\x00NX4__ 1.01 1.00 99110-N9100 ', ], }, + CAR.HYUNDAI_TUCSON_2025: { + (Ecu.fwdCamera, 0x7c4, None): [ + b'\xf1\x00NX4 FR_CMR AT USA LHD 1.00 1.00 99211-N7030 C55', + ], + (Ecu.fwdRadar, 0x7d0, None): [ + b'\xf1\x00NX4__ 1.00 1.02 99110N7100 ', + ], + }, CAR.HYUNDAI_SANTA_CRUZ_1ST_GEN: { (Ecu.fwdCamera, 0x7c4, None): [ b'\xf1\x00NX4 FR_CMR AT USA LHD 1.00 1.00 99211-CW000 14M', diff --git a/opendbc/car/hyundai/values.py b/opendbc/car/hyundai/values.py index b2c9910365d..f82e1884d45 100644 --- a/opendbc/car/hyundai/values.py +++ b/opendbc/car/hyundai/values.py @@ -346,6 +346,11 @@ class CAR(Platforms): ], CarSpecs(mass=1630, wheelbase=2.756, steerRatio=13.7, tireStiffnessFactor=0.385), ) + HYUNDAI_TUCSON_2025 = HyundaiCanFDPlatformConfig( + [HyundaiCarDocs("Hyundai Tucson 2025", car_parts=CarParts.common([CarHarness.hyundai_n]))], + CarSpecs(mass=1630, wheelbase=2.756, steerRatio=13.7, tireStiffnessFactor=0.385), + flags=HyundaiFlags.CCNC, + ) HYUNDAI_SANTA_CRUZ_1ST_GEN = HyundaiCanFDPlatformConfig( [HyundaiCarDocs("Hyundai Santa Cruz 2022-24", car_parts=CarParts.common([CarHarness.hyundai_n]))], # weight from Limited trim - the only supported trim, steering ratio according to Hyundai News https://www.hyundainews.com/assets/documents/original/48035-2022SantaCruzProductGuideSpecsv2081521.pdf diff --git a/opendbc/car/tests/routes.py b/opendbc/car/tests/routes.py index 5fa7ca6859c..0ee511c0189 100644 --- a/opendbc/car/tests/routes.py +++ b/opendbc/car/tests/routes.py @@ -137,6 +137,7 @@ class CarTestRoute(NamedTuple): CarTestRoute("fb3fd42f0baaa2f8|2022-03-30--15-25-05", HYUNDAI.HYUNDAI_TUCSON), CarTestRoute("db68bbe12250812c|2022-12-05--00-54-12", HYUNDAI.HYUNDAI_TUCSON_4TH_GEN), # 2023 CarTestRoute("36e10531feea61a4|2022-07-25--13-37-42", HYUNDAI.HYUNDAI_TUCSON_4TH_GEN), # hybrid + CarTestRoute("todo", HYUNDAI.HYUNDAI_TUCSON_2025), CarTestRoute("5875672fc1d4bf57|2020-07-23--21-33-28", HYUNDAI.KIA_SORENTO), CarTestRoute("1d0d000db3370fd0|2023-01-04--22-28-42", HYUNDAI.KIA_SORENTO_4TH_GEN, segment=5), CarTestRoute("60380edf6d76cb45/00000004--e450afc26c", HYUNDAI.KIA_SORENTO_2024), diff --git a/opendbc/car/torque_data/override.toml b/opendbc/car/torque_data/override.toml index d6c05f643ad..dff6288a0bb 100644 --- a/opendbc/car/torque_data/override.toml +++ b/opendbc/car/torque_data/override.toml @@ -78,6 +78,7 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"] "HYUNDAI_KONA_2ND_GEN" = [2.5, 2.5, 0.1] "KIA_SORENTO_2024" = [2.5, 2.5, 0.1] "KIA_K5_2025" = [2.5, 2.5, 0.1] +"HYUNDAI_TUCSON_2025" = [2.5, 2.5, 0.1] # Dashcam or fallback configured as ideal car "MOCK" = [10.0, 10, 0.0] From 57991141c0130221005d2935feaf2df32540f677 Mon Sep 17 00:00:00 2001 From: royjr Date: Mon, 10 Feb 2025 21:31:54 -0500 Subject: [PATCH 082/316] fix tests --- opendbc/car/hyundai/tests/test_hyundai.py | 1 + 1 file changed, 1 insertion(+) diff --git a/opendbc/car/hyundai/tests/test_hyundai.py b/opendbc/car/hyundai/tests/test_hyundai.py index 756fe589bfd..e86fdc3b702 100644 --- a/opendbc/car/hyundai/tests/test_hyundai.py +++ b/opendbc/car/hyundai/tests/test_hyundai.py @@ -23,6 +23,7 @@ CAR.KIA_SPORTAGE_5TH_GEN, CAR.HYUNDAI_SANTA_CRUZ_1ST_GEN, CAR.HYUNDAI_TUCSON_4TH_GEN, + CAR.HYUNDAI_TUCSON_2025, # CAN CAR.HYUNDAI_ELANTRA, CAR.HYUNDAI_ELANTRA_GT_I30, From e6a7a7cd63f97d473ed3a57f1df4c43055581216 Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 12 Feb 2025 00:34:10 -0500 Subject: [PATCH 083/316] add radar dbc --- .../generator/hyundai/hyundai_canfd_radar.dbc | 646 ++++++++++++++++++ .../generator/hyundai/hyundai_canfd_radar.py | 67 ++ 2 files changed, 713 insertions(+) create mode 100644 opendbc/dbc/generator/hyundai/hyundai_canfd_radar.dbc create mode 100755 opendbc/dbc/generator/hyundai/hyundai_canfd_radar.py diff --git a/opendbc/dbc/generator/hyundai/hyundai_canfd_radar.dbc b/opendbc/dbc/generator/hyundai/hyundai_canfd_radar.dbc new file mode 100644 index 00000000000..2d09476ea89 --- /dev/null +++ b/opendbc/dbc/generator/hyundai/hyundai_canfd_radar.dbc @@ -0,0 +1,646 @@ + +VERSION "" + + +NS_ : + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + VAL_TABLE_ + SIG_GROUP_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BS_: + +BU_: XXX + +BO_ 933 RADAR_TRACK_3A5: 24 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + +BO_ 934 RADAR_TRACK_3A6: 24 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + +BO_ 935 RADAR_TRACK_3A7: 24 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + +BO_ 936 RADAR_TRACK_3A8: 24 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + +BO_ 937 RADAR_TRACK_3A9: 24 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + +BO_ 938 RADAR_TRACK_3AA: 24 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + +BO_ 939 RADAR_TRACK_3AB: 24 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + +BO_ 940 RADAR_TRACK_3AC: 24 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + +BO_ 941 RADAR_TRACK_3AD: 24 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + +BO_ 942 RADAR_TRACK_3AE: 24 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + +BO_ 943 RADAR_TRACK_3AF: 24 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + +BO_ 944 RADAR_TRACK_3B0: 24 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + +BO_ 945 RADAR_TRACK_3B1: 24 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + +BO_ 946 RADAR_TRACK_3B2: 24 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + +BO_ 947 RADAR_TRACK_3B3: 24 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + +BO_ 948 RADAR_TRACK_3B4: 24 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + +BO_ 949 RADAR_TRACK_3B5: 24 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + +BO_ 950 RADAR_TRACK_3B6: 24 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + +BO_ 951 RADAR_TRACK_3B7: 24 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + +BO_ 952 RADAR_TRACK_3B8: 24 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + +BO_ 953 RADAR_TRACK_3B9: 24 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + +BO_ 954 RADAR_TRACK_3BA: 24 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + +BO_ 955 RADAR_TRACK_3BB: 24 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + +BO_ 956 RADAR_TRACK_3BC: 24 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + +BO_ 957 RADAR_TRACK_3BD: 24 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + +BO_ 958 RADAR_TRACK_3BE: 24 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + +BO_ 959 RADAR_TRACK_3BF: 24 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + +BO_ 960 RADAR_TRACK_3C0: 24 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + +BO_ 961 RADAR_TRACK_3C1: 24 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + +BO_ 962 RADAR_TRACK_3C2: 24 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + +BO_ 963 RADAR_TRACK_3C3: 24 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + +BO_ 964 RADAR_TRACK_3C4: 24 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + \ No newline at end of file diff --git a/opendbc/dbc/generator/hyundai/hyundai_canfd_radar.py b/opendbc/dbc/generator/hyundai/hyundai_canfd_radar.py new file mode 100755 index 00000000000..54c027b018c --- /dev/null +++ b/opendbc/dbc/generator/hyundai/hyundai_canfd_radar.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python3 +import os + +if __name__ == "__main__": + dbc_name = os.path.basename(__file__).replace(".py", ".dbc") + hyundai_path = os.path.dirname(os.path.realpath(__file__)) + with open(os.path.join(hyundai_path, dbc_name), "w", encoding='utf-8') as f: + f.write(""" +VERSION "" + + +NS_ : + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + VAL_TABLE_ + SIG_GROUP_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BS_: + +BU_: XXX + """) + + for a in range(0x3A5, 0x3A5 + 32): + f.write(f""" +BO_ {a} RADAR_TRACK_{a:X}: 24 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + """) From 4ae31a54e59c2ce6713b9d100b74b658a34da252 Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 12 Feb 2025 01:25:07 -0500 Subject: [PATCH 084/316] radar support --- opendbc/car/hyundai/interface.py | 3 +- opendbc/car/hyundai/radar_interface.py | 14 ++-- opendbc/car/hyundai/tests/test_hyundai.py | 4 +- opendbc/car/hyundai/values.py | 4 +- .../generator/hyundai/hyundai_canfd_radar.dbc | 64 +++++++++---------- .../generator/hyundai/hyundai_canfd_radar.py | 2 +- 6 files changed, 48 insertions(+), 43 deletions(-) diff --git a/opendbc/car/hyundai/interface.py b/opendbc/car/hyundai/interface.py index a2811d12d7b..aab5b9a607b 100644 --- a/opendbc/car/hyundai/interface.py +++ b/opendbc/car/hyundai/interface.py @@ -3,7 +3,7 @@ from opendbc.car.hyundai.values import HyundaiFlags, CAR, DBC, CANFD_RADAR_SCC_CAR, \ CANFD_UNSUPPORTED_LONGITUDINAL_CAR, \ UNSUPPORTED_LONGITUDINAL_CAR, HyundaiPandaFlags -from opendbc.car.hyundai.radar_interface import RADAR_START_ADDR +from opendbc.car.hyundai.radar_interface import RADAR_START_ADDR_CAN, RADAR_START_ADDR_CANFD from opendbc.car.interfaces import CarInterfaceBase from opendbc.car.disable_ecu import disable_ecu @@ -99,6 +99,7 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experime # Common longitudinal control setup + RADAR_START_ADDR = RADAR_START_ADDR_CANFD if ret.flags & HyundaiFlags.CANFD else RADAR_START_ADDR_CAN ret.radarUnavailable = RADAR_START_ADDR not in fingerprint[1] or Bus.radar not in DBC[ret.carFingerprint] ret.openpilotLongitudinalControl = experimental_long and ret.experimentalLongitudinalAvailable ret.pcmCruise = not ret.openpilotLongitudinalControl diff --git a/opendbc/car/hyundai/radar_interface.py b/opendbc/car/hyundai/radar_interface.py index 67ef674d3c1..f91e0e28cb3 100644 --- a/opendbc/car/hyundai/radar_interface.py +++ b/opendbc/car/hyundai/radar_interface.py @@ -3,14 +3,15 @@ from opendbc.can.parser import CANParser from opendbc.car import Bus, structs from opendbc.car.interfaces import RadarInterfaceBase -from opendbc.car.hyundai.values import DBC +from opendbc.car.hyundai.values import DBC, HyundaiFlags -RADAR_START_ADDR = 0x500 +RADAR_START_ADDR_CAN = 0x500 +RADAR_START_ADDR_CANFD = 0x3A5 RADAR_MSG_COUNT = 32 # POC for parsing corner radars: https://github.com/commaai/openpilot/pull/24221/ -def get_radar_can_parser(CP): +def get_radar_can_parser(CP, RADAR_START_ADDR): if Bus.radar not in DBC[CP.carFingerprint]: return None @@ -21,12 +22,13 @@ def get_radar_can_parser(CP): class RadarInterface(RadarInterfaceBase): def __init__(self, CP): super().__init__(CP) + self.RADAR_START_ADDR = RADAR_START_ADDR_CANFD if CP.flags & HyundaiFlags.CANFD else RADAR_START_ADDR_CAN self.updated_messages = set() - self.trigger_msg = RADAR_START_ADDR + RADAR_MSG_COUNT - 1 + self.trigger_msg = self.RADAR_START_ADDR + RADAR_MSG_COUNT - 1 self.track_id = 0 self.radar_off_can = CP.radarUnavailable - self.rcp = get_radar_can_parser(CP) + self.rcp = get_radar_can_parser(CP, self.RADAR_START_ADDR) def update(self, can_strings): if self.radar_off_can or (self.rcp is None): @@ -54,7 +56,7 @@ def _update(self, updated_messages): errors.append("canError") ret.errors = errors - for addr in range(RADAR_START_ADDR, RADAR_START_ADDR + RADAR_MSG_COUNT): + for addr in range(self.RADAR_START_ADDR, self.RADAR_START_ADDR + RADAR_MSG_COUNT): msg = self.rcp.vl[f"RADAR_TRACK_{addr:x}"] if addr not in self.pts: diff --git a/opendbc/car/hyundai/tests/test_hyundai.py b/opendbc/car/hyundai/tests/test_hyundai.py index e86fdc3b702..ec2ef7a3a64 100644 --- a/opendbc/car/hyundai/tests/test_hyundai.py +++ b/opendbc/car/hyundai/tests/test_hyundai.py @@ -7,7 +7,7 @@ from opendbc.car.fw_versions import build_fw_dict from opendbc.car.hyundai.interface import CarInterface from opendbc.car.hyundai.hyundaicanfd import CanBus -from opendbc.car.hyundai.radar_interface import RADAR_START_ADDR +from opendbc.car.hyundai.radar_interface import RADAR_START_ADDR_CAN from opendbc.car.hyundai.values import CAMERA_SCC_CAR, CANFD_CAR, CAN_GEARS, CAR, CHECKSUM, DATE_FW_ECUS, \ HYBRID_CAR, EV_CAR, FW_QUERY_CONFIG, LEGACY_SAFETY_MODE_CAR, CANFD_FUZZY_WHITELIST, \ UNSUPPORTED_LONGITUDINAL_CAR, PLATFORM_CODE_ECUS, HYUNDAI_VERSION_REQUEST_LONG, \ @@ -58,7 +58,7 @@ def test_feature_detection(self): for radar in (True, False): fingerprint = gen_empty_fingerprint() if radar: - fingerprint[1][RADAR_START_ADDR] = 8 + fingerprint[1][RADAR_START_ADDR_CAN] = 8 CP = CarInterface.get_params(CAR.HYUNDAI_SONATA, fingerprint, [], False, False) assert CP.radarUnavailable != radar diff --git a/opendbc/car/hyundai/values.py b/opendbc/car/hyundai/values.py index dcc2da11be1..561ec9ef38f 100644 --- a/opendbc/car/hyundai/values.py +++ b/opendbc/car/hyundai/values.py @@ -145,6 +145,8 @@ class HyundaiCanFDPlatformConfig(PlatformConfig): def init(self): self.flags |= HyundaiFlags.CANFD + if self.flags & HyundaiFlags.MANDO_RADAR: + self.dbc_dict = {Bus.pt: "hyundai_canfd", Bus.radar: 'hyundai_canfd_radar_generated'} class CAR(Platforms): @@ -291,7 +293,7 @@ class CAR(Platforms): HYUNDAI_SONATA_2024 = HyundaiCanFDPlatformConfig( [HyundaiCarDocs("Hyundai Sonata 2024", "All", car_parts=CarParts.common([CarHarness.hyundai_a]))], CarSpecs(mass=1556, wheelbase=2.84, steerRatio=12.81), - flags=HyundaiFlags.CCNC, + flags=HyundaiFlags.CCNC | HyundaiFlags.MANDO_RADAR, ) HYUNDAI_SONATA_LF = HyundaiPlatformConfig( [HyundaiCarDocs("Hyundai Sonata 2018-19", car_parts=CarParts.common([CarHarness.hyundai_e]))], diff --git a/opendbc/dbc/generator/hyundai/hyundai_canfd_radar.dbc b/opendbc/dbc/generator/hyundai/hyundai_canfd_radar.dbc index 2d09476ea89..00684938ed5 100644 --- a/opendbc/dbc/generator/hyundai/hyundai_canfd_radar.dbc +++ b/opendbc/dbc/generator/hyundai/hyundai_canfd_radar.dbc @@ -36,7 +36,7 @@ BS_: BU_: XXX -BO_ 933 RADAR_TRACK_3A5: 24 RADAR +BO_ 933 RADAR_TRACK_3a5: 24 RADAR SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX @@ -55,7 +55,7 @@ BO_ 933 RADAR_TRACK_3A5: 24 RADAR SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX -BO_ 934 RADAR_TRACK_3A6: 24 RADAR +BO_ 934 RADAR_TRACK_3a6: 24 RADAR SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX @@ -74,7 +74,7 @@ BO_ 934 RADAR_TRACK_3A6: 24 RADAR SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX -BO_ 935 RADAR_TRACK_3A7: 24 RADAR +BO_ 935 RADAR_TRACK_3a7: 24 RADAR SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX @@ -93,7 +93,7 @@ BO_ 935 RADAR_TRACK_3A7: 24 RADAR SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX -BO_ 936 RADAR_TRACK_3A8: 24 RADAR +BO_ 936 RADAR_TRACK_3a8: 24 RADAR SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX @@ -112,7 +112,7 @@ BO_ 936 RADAR_TRACK_3A8: 24 RADAR SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX -BO_ 937 RADAR_TRACK_3A9: 24 RADAR +BO_ 937 RADAR_TRACK_3a9: 24 RADAR SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX @@ -131,7 +131,7 @@ BO_ 937 RADAR_TRACK_3A9: 24 RADAR SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX -BO_ 938 RADAR_TRACK_3AA: 24 RADAR +BO_ 938 RADAR_TRACK_3aa: 24 RADAR SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX @@ -150,7 +150,7 @@ BO_ 938 RADAR_TRACK_3AA: 24 RADAR SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX -BO_ 939 RADAR_TRACK_3AB: 24 RADAR +BO_ 939 RADAR_TRACK_3ab: 24 RADAR SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX @@ -169,7 +169,7 @@ BO_ 939 RADAR_TRACK_3AB: 24 RADAR SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX -BO_ 940 RADAR_TRACK_3AC: 24 RADAR +BO_ 940 RADAR_TRACK_3ac: 24 RADAR SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX @@ -188,7 +188,7 @@ BO_ 940 RADAR_TRACK_3AC: 24 RADAR SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX -BO_ 941 RADAR_TRACK_3AD: 24 RADAR +BO_ 941 RADAR_TRACK_3ad: 24 RADAR SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX @@ -207,7 +207,7 @@ BO_ 941 RADAR_TRACK_3AD: 24 RADAR SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX -BO_ 942 RADAR_TRACK_3AE: 24 RADAR +BO_ 942 RADAR_TRACK_3ae: 24 RADAR SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX @@ -226,7 +226,7 @@ BO_ 942 RADAR_TRACK_3AE: 24 RADAR SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX -BO_ 943 RADAR_TRACK_3AF: 24 RADAR +BO_ 943 RADAR_TRACK_3af: 24 RADAR SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX @@ -245,7 +245,7 @@ BO_ 943 RADAR_TRACK_3AF: 24 RADAR SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX -BO_ 944 RADAR_TRACK_3B0: 24 RADAR +BO_ 944 RADAR_TRACK_3b0: 24 RADAR SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX @@ -264,7 +264,7 @@ BO_ 944 RADAR_TRACK_3B0: 24 RADAR SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX -BO_ 945 RADAR_TRACK_3B1: 24 RADAR +BO_ 945 RADAR_TRACK_3b1: 24 RADAR SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX @@ -283,7 +283,7 @@ BO_ 945 RADAR_TRACK_3B1: 24 RADAR SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX -BO_ 946 RADAR_TRACK_3B2: 24 RADAR +BO_ 946 RADAR_TRACK_3b2: 24 RADAR SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX @@ -302,7 +302,7 @@ BO_ 946 RADAR_TRACK_3B2: 24 RADAR SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX -BO_ 947 RADAR_TRACK_3B3: 24 RADAR +BO_ 947 RADAR_TRACK_3b3: 24 RADAR SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX @@ -321,7 +321,7 @@ BO_ 947 RADAR_TRACK_3B3: 24 RADAR SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX -BO_ 948 RADAR_TRACK_3B4: 24 RADAR +BO_ 948 RADAR_TRACK_3b4: 24 RADAR SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX @@ -340,7 +340,7 @@ BO_ 948 RADAR_TRACK_3B4: 24 RADAR SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX -BO_ 949 RADAR_TRACK_3B5: 24 RADAR +BO_ 949 RADAR_TRACK_3b5: 24 RADAR SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX @@ -359,7 +359,7 @@ BO_ 949 RADAR_TRACK_3B5: 24 RADAR SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX -BO_ 950 RADAR_TRACK_3B6: 24 RADAR +BO_ 950 RADAR_TRACK_3b6: 24 RADAR SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX @@ -378,7 +378,7 @@ BO_ 950 RADAR_TRACK_3B6: 24 RADAR SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX -BO_ 951 RADAR_TRACK_3B7: 24 RADAR +BO_ 951 RADAR_TRACK_3b7: 24 RADAR SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX @@ -397,7 +397,7 @@ BO_ 951 RADAR_TRACK_3B7: 24 RADAR SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX -BO_ 952 RADAR_TRACK_3B8: 24 RADAR +BO_ 952 RADAR_TRACK_3b8: 24 RADAR SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX @@ -416,7 +416,7 @@ BO_ 952 RADAR_TRACK_3B8: 24 RADAR SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX -BO_ 953 RADAR_TRACK_3B9: 24 RADAR +BO_ 953 RADAR_TRACK_3b9: 24 RADAR SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX @@ -435,7 +435,7 @@ BO_ 953 RADAR_TRACK_3B9: 24 RADAR SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX -BO_ 954 RADAR_TRACK_3BA: 24 RADAR +BO_ 954 RADAR_TRACK_3ba: 24 RADAR SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX @@ -454,7 +454,7 @@ BO_ 954 RADAR_TRACK_3BA: 24 RADAR SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX -BO_ 955 RADAR_TRACK_3BB: 24 RADAR +BO_ 955 RADAR_TRACK_3bb: 24 RADAR SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX @@ -473,7 +473,7 @@ BO_ 955 RADAR_TRACK_3BB: 24 RADAR SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX -BO_ 956 RADAR_TRACK_3BC: 24 RADAR +BO_ 956 RADAR_TRACK_3bc: 24 RADAR SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX @@ -492,7 +492,7 @@ BO_ 956 RADAR_TRACK_3BC: 24 RADAR SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX -BO_ 957 RADAR_TRACK_3BD: 24 RADAR +BO_ 957 RADAR_TRACK_3bd: 24 RADAR SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX @@ -511,7 +511,7 @@ BO_ 957 RADAR_TRACK_3BD: 24 RADAR SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX -BO_ 958 RADAR_TRACK_3BE: 24 RADAR +BO_ 958 RADAR_TRACK_3be: 24 RADAR SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX @@ -530,7 +530,7 @@ BO_ 958 RADAR_TRACK_3BE: 24 RADAR SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX -BO_ 959 RADAR_TRACK_3BF: 24 RADAR +BO_ 959 RADAR_TRACK_3bf: 24 RADAR SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX @@ -549,7 +549,7 @@ BO_ 959 RADAR_TRACK_3BF: 24 RADAR SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX -BO_ 960 RADAR_TRACK_3C0: 24 RADAR +BO_ 960 RADAR_TRACK_3c0: 24 RADAR SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX @@ -568,7 +568,7 @@ BO_ 960 RADAR_TRACK_3C0: 24 RADAR SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX -BO_ 961 RADAR_TRACK_3C1: 24 RADAR +BO_ 961 RADAR_TRACK_3c1: 24 RADAR SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX @@ -587,7 +587,7 @@ BO_ 961 RADAR_TRACK_3C1: 24 RADAR SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX -BO_ 962 RADAR_TRACK_3C2: 24 RADAR +BO_ 962 RADAR_TRACK_3c2: 24 RADAR SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX @@ -606,7 +606,7 @@ BO_ 962 RADAR_TRACK_3C2: 24 RADAR SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX -BO_ 963 RADAR_TRACK_3C3: 24 RADAR +BO_ 963 RADAR_TRACK_3c3: 24 RADAR SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX @@ -625,7 +625,7 @@ BO_ 963 RADAR_TRACK_3C3: 24 RADAR SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX -BO_ 964 RADAR_TRACK_3C4: 24 RADAR +BO_ 964 RADAR_TRACK_3c4: 24 RADAR SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX diff --git a/opendbc/dbc/generator/hyundai/hyundai_canfd_radar.py b/opendbc/dbc/generator/hyundai/hyundai_canfd_radar.py index 54c027b018c..e5ea3a299d8 100755 --- a/opendbc/dbc/generator/hyundai/hyundai_canfd_radar.py +++ b/opendbc/dbc/generator/hyundai/hyundai_canfd_radar.py @@ -46,7 +46,7 @@ for a in range(0x3A5, 0x3A5 + 32): f.write(f""" -BO_ {a} RADAR_TRACK_{a:X}: 24 RADAR +BO_ {a} RADAR_TRACK_{a:x}: 24 RADAR SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX From 227109268c99244b08d27c654f6512747e2a6119 Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 12 Feb 2025 01:45:23 -0500 Subject: [PATCH 085/316] blah --- opendbc/car/hyundai/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/opendbc/car/hyundai/__init__.py b/opendbc/car/hyundai/__init__.py index e69de29bb2d..0519ecba6ea 100644 --- a/opendbc/car/hyundai/__init__.py +++ b/opendbc/car/hyundai/__init__.py @@ -0,0 +1 @@ + \ No newline at end of file From 25262db9a3a7cf10ae35cdf37ffe27bbab90a91d Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 12 Feb 2025 01:45:27 -0500 Subject: [PATCH 086/316] Revert "blah" This reverts commit 227109268c99244b08d27c654f6512747e2a6119. --- opendbc/car/hyundai/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/opendbc/car/hyundai/__init__.py b/opendbc/car/hyundai/__init__.py index 0519ecba6ea..e69de29bb2d 100644 --- a/opendbc/car/hyundai/__init__.py +++ b/opendbc/car/hyundai/__init__.py @@ -1 +0,0 @@ - \ No newline at end of file From 42406ac1f1d5a037e5efa7534d6b52a9ef827484 Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 12 Feb 2025 01:50:29 -0500 Subject: [PATCH 087/316] wrong car --- opendbc/car/hyundai/values.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opendbc/car/hyundai/values.py b/opendbc/car/hyundai/values.py index fe9237c184f..5413fa42f91 100644 --- a/opendbc/car/hyundai/values.py +++ b/opendbc/car/hyundai/values.py @@ -293,7 +293,7 @@ class CAR(Platforms): HYUNDAI_SONATA_2024 = HyundaiCanFDPlatformConfig( [HyundaiCarDocs("Hyundai Sonata 2024", "All", car_parts=CarParts.common([CarHarness.hyundai_a]))], CarSpecs(mass=1556, wheelbase=2.84, steerRatio=12.81), - flags=HyundaiFlags.CCNC | HyundaiFlags.MANDO_RADAR, + flags=HyundaiFlags.CCNC, ) HYUNDAI_SONATA_LF = HyundaiPlatformConfig( [HyundaiCarDocs("Hyundai Sonata 2018-19", car_parts=CarParts.common([CarHarness.hyundai_e]))], @@ -334,7 +334,7 @@ class CAR(Platforms): HYUNDAI_SONATA_HEV_2024 = HyundaiCanFDPlatformConfig( [HyundaiCarDocs("Hyundai Sonata Hybrid 2024", "All", car_parts=CarParts.common([CarHarness.hyundai_a]))], CarSpecs(mass=1616, wheelbase=2.84, steerRatio=13.27), - flags=HyundaiFlags.CCNC, + flags=HyundaiFlags.CCNC | HyundaiFlags.MANDO_RADAR, ) HYUNDAI_IONIQ_5 = HyundaiCanFDPlatformConfig( [ From 728a136fdb851cc913477e3c518cd6566c5349a1 Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 12 Feb 2025 02:05:20 -0500 Subject: [PATCH 088/316] fix tests --- opendbc/car/hyundai/carcontroller.py | 8 +++++-- opendbc/car/hyundai/carstate.py | 6 +++-- opendbc/car/hyundai/hyundaicanfd.py | 33 +++++++++++++++++++++++++++- 3 files changed, 42 insertions(+), 5 deletions(-) diff --git a/opendbc/car/hyundai/carcontroller.py b/opendbc/car/hyundai/carcontroller.py index b269a5ff92c..67ed48f4e58 100644 --- a/opendbc/car/hyundai/carcontroller.py +++ b/opendbc/car/hyundai/carcontroller.py @@ -129,8 +129,12 @@ def update(self, CC, CS, now_nanos): if hda2: can_sends.extend(hyundaicanfd.create_adrv_messages(self.packer, self.CAN, self.frame)) if self.frame % 2 == 0: - can_sends.append(hyundaicanfd.create_acc_control(self.packer, self.CAN, CC.enabled, self.accel_last, accel, stopping, CC.cruiseControl.override, - set_speed_in_units, hud_control, CS.cruise_info)) + if self.CP.flags & HyundaiFlags.CCNC and not hda2: + can_sends.append(hyundaicanfd.create_ccnc_acc_control(self.packer, self.CAN, CC.enabled, self.accel_last, accel, stopping, + CC.cruiseControl.override, set_speed_in_units, hud_control, CS.cruise_info)) + else: + can_sends.append(hyundaicanfd.create_acc_control(self.packer, self.CAN, CC.enabled, self.accel_last, accel, stopping, CC.cruiseControl.override, + set_speed_in_units, hud_control)) self.accel_last = accel else: # button presses diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index b79b6bd5950..c91c4a4bc87 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -230,6 +230,8 @@ def update_canfd(self, can_parsers) -> structs.CarState: if self.CP.flags & HyundaiFlags.CCNC and not self.CP.flags & HyundaiFlags.CANFD_HDA2: self.msg_161 = copy.copy(cp_cam.vl["MSG_161"]) self.msg_162 = copy.copy(cp_cam.vl["MSG_162"]) + cp_cruise_info = cp_cam if self.CP.flags & HyundaiFlags.CANFD_CAMERA_SCC else cp + self.cruise_info = copy.copy(cp_cruise_info.vl["SCC_CONTROL"]) alt = "_ALT" if self.CP.flags & HyundaiFlags.CCNC and not self.CP.flags & HyundaiFlags.CANFD_HDA2 else "" ret.leftBlinker, ret.rightBlinker = self.update_blinker_from_lamp(50, cp.vl["BLINKERS"][f"LEFT_LAMP{alt}"], @@ -241,16 +243,16 @@ def update_canfd(self, can_parsers) -> structs.CarState: # cruise state # CAN FD cars enable on main button press, set available if no TCS faults preventing engagement ret.cruiseState.available = cp.vl["TCS"]["ACCEnable"] == 0 - cp_cruise_info = cp_cam if self.CP.flags & HyundaiFlags.CANFD_CAMERA_SCC else cp - self.cruise_info = copy.copy(cp_cruise_info.vl["SCC_CONTROL"]) if self.CP.openpilotLongitudinalControl: # These are not used for engage/disengage since openpilot keeps track of state using the buttons ret.cruiseState.enabled = cp.vl["TCS"]["ACC_REQ"] == 1 ret.cruiseState.standstill = False else: + cp_cruise_info = cp_cam if self.CP.flags & HyundaiFlags.CANFD_CAMERA_SCC else cp ret.cruiseState.enabled = cp_cruise_info.vl["SCC_CONTROL"]["ACCMode"] in (1, 2) ret.cruiseState.standstill = cp_cruise_info.vl["SCC_CONTROL"]["CRUISE_STANDSTILL"] == 1 ret.cruiseState.speed = cp_cruise_info.vl["SCC_CONTROL"]["VSetDis"] * speed_factor + self.cruise_info = copy.copy(cp_cruise_info.vl["SCC_CONTROL"]) # Manual Speed Limit Assist is a feature that replaces non-adaptive cruise control on EV CAN FD platforms. # It limits the vehicle speed, overridable by pressing the accelerator past a certain point. diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 4ede926ac8b..bd9b59d81a2 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -202,7 +202,7 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): return ret -def create_acc_control(packer, CAN, enabled, accel_last, accel, stopping, gas_override, set_speed, hud_control, cruise_info): +def create_ccnc_acc_control(packer, CAN, enabled, accel_last, accel, stopping, gas_override, set_speed, hud_control, cruise_info): jerk = 5 jn = jerk / 50 if not enabled or gas_override: @@ -236,6 +236,37 @@ def create_acc_control(packer, CAN, enabled, accel_last, accel, stopping, gas_ov return packer.make_can_msg("SCC_CONTROL", CAN.ECAN, values) +def create_acc_control(packer, CAN, enabled, accel_last, accel, stopping, gas_override, set_speed, hud_control): + jerk = 5 + jn = jerk / 50 + if not enabled or gas_override: + a_val, a_raw = 0, 0 + else: + a_raw = accel + a_val = np.clip(accel, accel_last - jn, accel_last + jn) + + values = { + "ACCMode": 0 if not enabled else (2 if gas_override else 1), + "MainMode_ACC": 1, + "StopReq": 1 if stopping else 0, + "aReqValue": a_val, + "aReqRaw": a_raw, + "VSetDis": set_speed, + "JerkLowerLimit": jerk if enabled else 1, + "JerkUpperLimit": 3.0, + + "ACC_ObjDist": 1, + "ObjValid": 0, + "OBJ_STATUS": 2, + "SET_ME_2": 0x4, + "SET_ME_3": 0x3, + "SET_ME_TMP_64": 0x64, + "DISTANCE_SETTING": hud_control.leadDistanceBars, + } + + return packer.make_can_msg("SCC_CONTROL", CAN.ECAN, values) + + def create_spas_messages(packer, CAN, frame, left_blink, right_blink): ret = [] From 65ba657c4e165f4ec5a3bdf3ccfc93620ebb2f00 Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 12 Feb 2025 14:27:03 -0500 Subject: [PATCH 089/316] fix LONG_DIST factor --- .../generator/hyundai/hyundai_canfd_radar.dbc | 64 +++++++++---------- .../generator/hyundai/hyundai_canfd_radar.py | 2 +- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/opendbc/dbc/generator/hyundai/hyundai_canfd_radar.dbc b/opendbc/dbc/generator/hyundai/hyundai_canfd_radar.dbc index 00684938ed5..15f6cb50398 100644 --- a/opendbc/dbc/generator/hyundai/hyundai_canfd_radar.dbc +++ b/opendbc/dbc/generator/hyundai/hyundai_canfd_radar.dbc @@ -47,7 +47,7 @@ BO_ 933 RADAR_TRACK_3a5: 24 RADAR SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX @@ -66,7 +66,7 @@ BO_ 934 RADAR_TRACK_3a6: 24 RADAR SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX @@ -85,7 +85,7 @@ BO_ 935 RADAR_TRACK_3a7: 24 RADAR SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX @@ -104,7 +104,7 @@ BO_ 936 RADAR_TRACK_3a8: 24 RADAR SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX @@ -123,7 +123,7 @@ BO_ 937 RADAR_TRACK_3a9: 24 RADAR SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX @@ -142,7 +142,7 @@ BO_ 938 RADAR_TRACK_3aa: 24 RADAR SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX @@ -161,7 +161,7 @@ BO_ 939 RADAR_TRACK_3ab: 24 RADAR SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX @@ -180,7 +180,7 @@ BO_ 940 RADAR_TRACK_3ac: 24 RADAR SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX @@ -199,7 +199,7 @@ BO_ 941 RADAR_TRACK_3ad: 24 RADAR SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX @@ -218,7 +218,7 @@ BO_ 942 RADAR_TRACK_3ae: 24 RADAR SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX @@ -237,7 +237,7 @@ BO_ 943 RADAR_TRACK_3af: 24 RADAR SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX @@ -256,7 +256,7 @@ BO_ 944 RADAR_TRACK_3b0: 24 RADAR SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX @@ -275,7 +275,7 @@ BO_ 945 RADAR_TRACK_3b1: 24 RADAR SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX @@ -294,7 +294,7 @@ BO_ 946 RADAR_TRACK_3b2: 24 RADAR SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX @@ -313,7 +313,7 @@ BO_ 947 RADAR_TRACK_3b3: 24 RADAR SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX @@ -332,7 +332,7 @@ BO_ 948 RADAR_TRACK_3b4: 24 RADAR SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX @@ -351,7 +351,7 @@ BO_ 949 RADAR_TRACK_3b5: 24 RADAR SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX @@ -370,7 +370,7 @@ BO_ 950 RADAR_TRACK_3b6: 24 RADAR SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX @@ -389,7 +389,7 @@ BO_ 951 RADAR_TRACK_3b7: 24 RADAR SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX @@ -408,7 +408,7 @@ BO_ 952 RADAR_TRACK_3b8: 24 RADAR SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX @@ -427,7 +427,7 @@ BO_ 953 RADAR_TRACK_3b9: 24 RADAR SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX @@ -446,7 +446,7 @@ BO_ 954 RADAR_TRACK_3ba: 24 RADAR SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX @@ -465,7 +465,7 @@ BO_ 955 RADAR_TRACK_3bb: 24 RADAR SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX @@ -484,7 +484,7 @@ BO_ 956 RADAR_TRACK_3bc: 24 RADAR SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX @@ -503,7 +503,7 @@ BO_ 957 RADAR_TRACK_3bd: 24 RADAR SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX @@ -522,7 +522,7 @@ BO_ 958 RADAR_TRACK_3be: 24 RADAR SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX @@ -541,7 +541,7 @@ BO_ 959 RADAR_TRACK_3bf: 24 RADAR SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX @@ -560,7 +560,7 @@ BO_ 960 RADAR_TRACK_3c0: 24 RADAR SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX @@ -579,7 +579,7 @@ BO_ 961 RADAR_TRACK_3c1: 24 RADAR SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX @@ -598,7 +598,7 @@ BO_ 962 RADAR_TRACK_3c2: 24 RADAR SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX @@ -617,7 +617,7 @@ BO_ 963 RADAR_TRACK_3c3: 24 RADAR SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX @@ -636,7 +636,7 @@ BO_ 964 RADAR_TRACK_3c4: 24 RADAR SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX diff --git a/opendbc/dbc/generator/hyundai/hyundai_canfd_radar.py b/opendbc/dbc/generator/hyundai/hyundai_canfd_radar.py index e5ea3a299d8..c28d5b6a1f9 100755 --- a/opendbc/dbc/generator/hyundai/hyundai_canfd_radar.py +++ b/opendbc/dbc/generator/hyundai/hyundai_canfd_radar.py @@ -57,7 +57,7 @@ SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.1,0) [0|8191] "" XXX + SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX From 7a79f0085f2cc1342565893f0316e6cb547ee924 Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 12 Feb 2025 14:30:56 -0500 Subject: [PATCH 090/316] fix DISTANCE factor --- opendbc/dbc/hyundai_canfd.dbc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/opendbc/dbc/hyundai_canfd.dbc b/opendbc/dbc/hyundai_canfd.dbc index 765257e3c66..ee921b72e39 100644 --- a/opendbc/dbc/hyundai_canfd.dbc +++ b/opendbc/dbc/hyundai_canfd.dbc @@ -681,14 +681,14 @@ BO_ 353 MSG_161: 32 CCNC SG_ ZEROS_5 : 63|1@0+ (1,0) [0|1] "" XXX SG_ CENTERLINE : 64|2@1+ (1,0) [0|3] "" XXX SG_ TARGET : 66|3@1+ (1,0) [0|7] "" XXX - SG_ TARGET_POSITION : 69|11@1+ (1,0) [0|7] "" XXX + SG_ TARGET_POSITION : 69|11@1+ (0.1,0) [0|204.7] "m" XXX SG_ LANELINE_LEFT : 80|4@1+ (1,0) [0|15] "" XXX SG_ LANELINE_LEFT_POSITION : 84|6@1+ (1,0) [0|15] "" XXX SG_ LANELINE_RIGHT : 90|4@1+ (1,0) [0|15] "" XXX SG_ LANELINE_RIGHT_POSITION : 94|6@1+ (1,0) [0|3] "" XXX SG_ LANELINE_CURVATURE : 100|5@1- (1,15) [0|31] "" XXX SG_ LANE_HIGHLIGHT : 105|4@1+ (1,0) [0|15] "" XXX - SG_ LANE_HIGHLIGHT_DISTANCE : 109|11@1+ (1,0) [0|7] "" XXX + SG_ LANE_HIGHLIGHT_DISTANCE : 109|11@1+ (0.1,0) [0|204.7] "m" XXX SG_ LANE_LEFT : 120|3@1+ (1,0) [0|7] "" XXX SG_ LANE_RIGHT : 123|3@1+ (1,0) [0|7] "" XXX SG_ LANE_ZOOM : 126|2@1+ (1,0) [0|3] "" XXX @@ -735,19 +735,19 @@ BO_ 354 MSG_162: 32 CCNC SG_ ZEROS_1 : 55|1@0+ (1,0) [0|1] "" XXX SG_ ZEROS_2 : 56|8@1+ (1,0) [0|255] "" XXX SG_ LEAD : 64|5@1+ (1,0) [0|31] "" XXX - SG_ LEAD_DISTANCE : 69|11@1+ (1,0) [0|2047] "" XXX + SG_ LEAD_DISTANCE : 69|11@1+ (0.1,0) [0|204.7] "m" XXX SG_ LEAD_LATERAL : 80|7@1+ (1,0) [0|127] "" XXX SG_ ZEROS_3 : 87|1@0+ (1,0) [0|1] "" XXX SG_ LEAD_ALT : 88|5@1+ (1,0) [0|31] "" XXX - SG_ LEAD_ALT_DISTANCE : 93|11@1+ (1,0) [0|2047] "" XXX + SG_ LEAD_ALT_DISTANCE : 93|11@1+ (0.1,0) [0|204.7] "m" XXX SG_ LEAD_ALT_LATERAL : 104|7@1+ (1,0) [0|127] "" XXX SG_ ZEROS_4 : 111|1@0+ (1,0) [0|1] "" XXX SG_ LEAD_LEFT : 112|5@1+ (1,0) [0|31] "" XXX - SG_ LEAD_LEFT_DISTANCE : 117|11@1+ (1,0) [0|2047] "" XXX + SG_ LEAD_LEFT_DISTANCE : 117|11@1+ (0.1,0) [0|204.7] "m" XXX SG_ LEAD_LEFT_LATERAL : 128|7@1+ (1,0) [0|127] "" XXX SG_ ZEROS_5 : 135|1@0+ (1,0) [0|1] "" XXX SG_ LEAD_RIGHT : 136|5@1+ (1,0) [0|31] "" XXX - SG_ LEAD_RIGHT_DISTANCE : 141|11@1+ (1,0) [0|2047] "" XXX + SG_ LEAD_RIGHT_DISTANCE : 141|11@1+ (0.1,0) [0|204.7] "m" XXX SG_ LEAD_RIGHT_LATERAL : 152|7@1+ (1,0) [0|127] "" XXX SG_ ZEROS_6 : 159|1@0+ (1,0) [0|1] "" XXX SG_ ZEROS_7 : 160|8@1+ (1,0) [0|255] "" XXX @@ -793,7 +793,7 @@ BO_ 437 MSG_1B5: 32 XXX SG_ LEAD_1 : 194|6@1+ (1,0) [0|63] "" XXX SG_ LEAD_2 : 200|11@1- (1,0) [0|4095] "" XXX SG_ LEAD_3 : 211|1@0+ (1,0) [0|1] "" XXX - SG_ LEAD_DISTANCE : 213|11@1+ (1,0) [0|2047] "" XXX + SG_ LEAD_DISTANCE : 213|11@1+ (0.1,0) [0|204.7] "m" XXX CM_ 272 "Alternative LKAS message, used on cars such as 2023 Ioniq 6, 2nd gen Kona. Matches LKAS except size is 32 bytes"; CM_ 676 "Contains signals with detailed lane line information. Used by ADAS ECU on HDA 2 vehicles to operate LFA."; From fa01355c3a47b1f480a60eed5459fcd306b91ec6 Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 12 Feb 2025 14:31:13 -0500 Subject: [PATCH 091/316] POSTION -> DISTANCE --- opendbc/dbc/hyundai_canfd.dbc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/dbc/hyundai_canfd.dbc b/opendbc/dbc/hyundai_canfd.dbc index ee921b72e39..2fa5eb73b58 100644 --- a/opendbc/dbc/hyundai_canfd.dbc +++ b/opendbc/dbc/hyundai_canfd.dbc @@ -681,7 +681,7 @@ BO_ 353 MSG_161: 32 CCNC SG_ ZEROS_5 : 63|1@0+ (1,0) [0|1] "" XXX SG_ CENTERLINE : 64|2@1+ (1,0) [0|3] "" XXX SG_ TARGET : 66|3@1+ (1,0) [0|7] "" XXX - SG_ TARGET_POSITION : 69|11@1+ (0.1,0) [0|204.7] "m" XXX + SG_ TARGET_DISTANCE : 69|11@1+ (0.1,0) [0|204.7] "m" XXX SG_ LANELINE_LEFT : 80|4@1+ (1,0) [0|15] "" XXX SG_ LANELINE_LEFT_POSITION : 84|6@1+ (1,0) [0|15] "" XXX SG_ LANELINE_RIGHT : 90|4@1+ (1,0) [0|15] "" XXX From 8e169dadcb1b03d9b2853602f1ad06fffddaacd1 Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 12 Feb 2025 15:23:29 -0500 Subject: [PATCH 092/316] MSG_ -> CCNC_0x --- opendbc/car/hyundai/carstate.py | 8 ++++---- opendbc/car/hyundai/hyundaicanfd.py | 4 ++-- opendbc/dbc/hyundai_canfd.dbc | 8 +++++--- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index c91c4a4bc87..4f254303901 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -228,8 +228,8 @@ def update_canfd(self, can_parsers) -> structs.CarState: ret.steerFaultTemporary = cp.vl["MDPS"]["LKA_FAULT"] != 0 if self.CP.flags & HyundaiFlags.CCNC and not self.CP.flags & HyundaiFlags.CANFD_HDA2: - self.msg_161 = copy.copy(cp_cam.vl["MSG_161"]) - self.msg_162 = copy.copy(cp_cam.vl["MSG_162"]) + self.msg_161 = copy.copy(cp_cam.vl["CCNC_0x161"]) + self.msg_162 = copy.copy(cp_cam.vl["CCNC_0x162"]) cp_cruise_info = cp_cam if self.CP.flags & HyundaiFlags.CANFD_CAMERA_SCC else cp self.cruise_info = copy.copy(cp_cruise_info.vl["SCC_CONTROL"]) @@ -324,8 +324,8 @@ def get_can_parsers_canfd(self, CP): ] if self.CP.flags & HyundaiFlags.CCNC and not self.CP.flags & HyundaiFlags.CANFD_HDA2: cam_messages += [ - ("MSG_161", 20), - ("MSG_162", 20), + ("CCNC_0x161", 20), + ("CCNC_0x162", 20), ] return { diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index bd9b59d81a2..8082d2ffc94 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -197,8 +197,8 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): }) ret.append(packer.make_can_msg("LFAHDA_CLUSTER", CAN.ECAN, lfahda_cluster)) - ret.append(packer.make_can_msg("MSG_161", CAN.ECAN, msg_161)) - ret.append(packer.make_can_msg("MSG_162", CAN.ECAN, msg_162)) + ret.append(packer.make_can_msg("CCNC_0x161", CAN.ECAN, msg_161)) + ret.append(packer.make_can_msg("CCNC_0x162", CAN.ECAN, msg_162)) return ret diff --git a/opendbc/dbc/hyundai_canfd.dbc b/opendbc/dbc/hyundai_canfd.dbc index 2fa5eb73b58..83eee86d1c4 100644 --- a/opendbc/dbc/hyundai_canfd.dbc +++ b/opendbc/dbc/hyundai_canfd.dbc @@ -662,7 +662,7 @@ BO_ 1264 LOCAL_TIME: 8 XXX SG_ MINUTES : 21|6@0+ (1,0) [0|63] "" XXX SG_ SECONDS : 31|8@0+ (1,0) [0|59] "" XXX -BO_ 353 MSG_161: 32 CCNC +BO_ 353 CCNC_0x161: 32 CCNC SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX SG_ FCA_ICON : 24|3@1+ (1,0) [0|7] "" XXX @@ -723,7 +723,7 @@ BO_ 353 MSG_161: 32 CCNC SG_ ZEROS_8 : 246|2@1+ (1,0) [0|3] "" XXX SG_ ZEROS_9 : 248|8@1+ (1,0) [0|255] "" XXX -BO_ 354 MSG_162: 32 CCNC +BO_ 354 CCNC_0x162: 32 CCNC SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX SG_ COUNTRY : 24|4@1+ (1,0) [0|7] "" XXX @@ -772,7 +772,7 @@ BO_ 354 MSG_162: 32 CCNC SG_ FAULT_ESS : 249|3@1+ (1,0) [0|7] "" XXX SG_ ZEROS_14 : 252|4@1+ (1,0) [0|15] "" XXX -BO_ 437 MSG_1B5: 32 XXX +BO_ 437 CCNC_0x1B5: 32 CCNC SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX SG_ LEFT : 24|2@1+ (1,0) [0|3] "" XXX @@ -803,12 +803,14 @@ CM_ 1043 "Lamp signals do not seem universal on cars that use LKAS_ALT, but stal CM_ SG_ 80 HAS_LANE_SAFETY "If 0, hides LKAS 'Lane Safety' menu from vehicle settings"; CM_ SG_ 96 BRAKE_PRESSURE "User applied brake pedal pressure. Ramps from computer applied pressure on falling edge of cruise. Cruise cancels if !=0"; CM_ SG_ 101 BRAKE_POSITION "User applied brake pedal position, max is ~700. Signed on some vehicles"; +CM_ SG_ 298 NEW_SIGNAL_4 "todo: figure out why always set to 9"; CM_ SG_ 373 PROBABLY_EQUIP "aeb equip?"; CM_ SG_ 373 ACCEnable "Likely a copy of CAN's TCS13->ACCEnable"; CM_ SG_ 373 DriverBraking "Likely derived from BRAKE->BRAKE_POSITION"; CM_ SG_ 373 DriverBrakingLowSens "Higher threshold version of DriverBraking"; CM_ SG_ 352 SET_ME_9 "has something to do with AEB settings"; CM_ SG_ 416 VSetDis "set speed in display units"; +CM_ SG_ 480 NEW_SIGNAL_5 "todo: figure out why always set to 1"; CM_ SG_ 676 LEFT_LANE_LINE "Left lane line confidence"; CM_ SG_ 676 RIGHT_LANE_LINE "Right lane line confidence"; CM_ SG_ 736 MAX_SPEED "Display units. Restricts car from driving above this speed unless accelerator pedal is depressed beyond pressure point"; From d4e2bb84bc259ec1a285e7153e3ea78ce47e72f0 Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 12 Feb 2025 15:39:50 -0500 Subject: [PATCH 093/316] until #1717 is merged --- opendbc/dbc/hyundai_canfd.dbc | 617 +++++++++++++++++----------------- 1 file changed, 306 insertions(+), 311 deletions(-) diff --git a/opendbc/dbc/hyundai_canfd.dbc b/opendbc/dbc/hyundai_canfd.dbc index 83eee86d1c4..f3251b94863 100644 --- a/opendbc/dbc/hyundai_canfd.dbc +++ b/opendbc/dbc/hyundai_canfd.dbc @@ -39,8 +39,8 @@ BU_: XXX CAMERA FRONT_RADAR ADRV APRK BO_ 53 ACCELERATOR: 32 XXX SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ GEAR : 192|3@1+ (1,0) [0|7] "" XXX SG_ ACCELERATOR_PEDAL : 40|8@1+ (1,0) [0|255] "" XXX + SG_ GEAR : 192|3@1+ (1,0) [0|7] "" XXX BO_ 64 GEAR_ALT: 32 XXX SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX @@ -53,25 +53,25 @@ BO_ 69 GEAR: 24 XXX SG_ GEAR : 44|3@1+ (1,0) [0|7] "" XXX BO_ 80 LKAS: 16 XXX - SG_ STEER_REQ : 52|1@1+ (1,0) [0|1] "" XXX - SG_ TORQUE_REQUEST : 41|11@1+ (1,-1024) [0|4095] "" XXX - SG_ LKA_ICON : 38|2@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 27|2@1+ (1,0) [0|255] "" XXX - SG_ LFA_BUTTON : 56|1@1+ (1,0) [0|255] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ STEER_MODE : 65|3@1+ (1,0) [0|1] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ LKA_MODE : 24|3@1+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_1 : 27|2@1+ (1,0) [0|255] "" XXX SG_ LKA_WARNING : 32|1@1+ (1,0) [0|1] "" XXX + SG_ LKA_ICON : 38|2@1+ (1,0) [0|255] "" XXX + SG_ FCA_SYSWARN : 40|1@0+ (1,0) [0|1] "" XXX + SG_ TORQUE_REQUEST : 41|11@1+ (1,-1024) [0|4095] "" XXX + SG_ STEER_REQ : 52|1@1+ (1,0) [0|1] "" XXX + SG_ LFA_BUTTON : 56|1@1+ (1,0) [0|255] "" XXX SG_ LKA_ASSIST : 62|1@1+ (1,0) [0|1] "" XXX - SG_ LKA_MODE : 24|3@1+ (1,0) [0|7] "" XXX + SG_ STEER_MODE : 65|3@1+ (1,0) [0|1] "" XXX SG_ NEW_SIGNAL_2 : 70|2@0+ (1,0) [0|3] "" XXX SG_ HAS_LANE_SAFETY : 80|1@0+ (1,0) [0|1] "" XXX SG_ NEW_SIGNAL_3 : 111|8@0+ (1,0) [0|255] "" XXX - SG_ FCA_SYSWARN : 40|1@0+ (1,0) [0|1] "" XXX BO_ 81 ADRV_0x51: 32 ADRV - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX BO_ 96 ESP_STATUS: 32 XXX SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX @@ -125,40 +125,40 @@ BO_ 261 ACCELERATOR_ALT: 32 XXX SG_ ACCELERATOR_PEDAL : 103|10@1+ (0.25,0) [0|1022] "" XXX BO_ 272 LKAS_ALT: 32 XXX - SG_ STEER_REQ : 52|1@1+ (1,0) [0|1] "" XXX - SG_ TORQUE_REQUEST : 41|11@1+ (1,-1024) [0|4095] "" XXX - SG_ LKA_ICON : 38|2@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 27|2@1+ (1,0) [0|255] "" XXX - SG_ LFA_BUTTON : 56|1@1+ (1,0) [0|255] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ STEER_MODE : 65|3@1+ (1,0) [0|1] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ LKA_MODE : 24|3@1+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_1 : 27|2@1+ (1,0) [0|255] "" XXX SG_ LKA_WARNING : 32|1@1+ (1,0) [0|1] "" XXX + SG_ LKA_ICON : 38|2@1+ (1,0) [0|255] "" XXX + SG_ FCA_SYSWARN : 40|1@0+ (1,0) [0|1] "" XXX + SG_ TORQUE_REQUEST : 41|11@1+ (1,-1024) [0|4095] "" XXX + SG_ STEER_REQ : 52|1@1+ (1,0) [0|1] "" XXX + SG_ LFA_BUTTON : 56|1@1+ (1,0) [0|255] "" XXX SG_ LKA_ASSIST : 62|1@1+ (1,0) [0|1] "" XXX - SG_ LKA_MODE : 24|3@1+ (1,0) [0|7] "" XXX + SG_ STEER_MODE : 65|3@1+ (1,0) [0|1] "" XXX SG_ NEW_SIGNAL_2 : 70|2@0+ (1,0) [0|3] "" XXX SG_ HAS_LANE_SAFETY : 80|1@0+ (1,0) [0|1] "" XXX SG_ NEW_SIGNAL_3 : 111|8@0+ (1,0) [0|255] "" XXX - SG_ FCA_SYSWARN : 40|1@0+ (1,0) [0|1] "" XXX BO_ 293 STEERING_SENSORS: 16 XXX SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ STEERING_RATE : 40|8@1+ (4,0) [0|1016] "deg/s" XXX SG_ STEERING_ANGLE : 24|16@1- (-0.1,0) [0|255] "deg" XXX + SG_ STEERING_RATE : 40|8@1+ (4,0) [0|1016] "deg/s" XXX BO_ 298 LFA: 16 ADRV - SG_ STEER_REQ : 52|1@1+ (1,0) [0|1] "" XXX - SG_ TORQUE_REQUEST : 41|11@1+ (1,-1024) [0|4095] "" XXX - SG_ LKA_ICON : 38|2@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 27|2@1+ (1,0) [0|255] "" XXX - SG_ LFA_BUTTON : 56|1@1+ (1,0) [0|255] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ STEER_MODE : 65|3@1+ (1,0) [0|1] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ LKA_MODE : 24|3@1+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_1 : 27|2@1+ (1,0) [0|255] "" XXX SG_ LKA_WARNING : 32|1@1+ (1,0) [0|1] "" XXX + SG_ LKA_ICON : 38|2@1+ (1,0) [0|255] "" XXX + SG_ TORQUE_REQUEST : 41|11@1+ (1,-1024) [0|4095] "" XXX + SG_ STEER_REQ : 52|1@1+ (1,0) [0|1] "" XXX + SG_ LFA_BUTTON : 56|1@1+ (1,0) [0|255] "" XXX SG_ LKA_ASSIST : 62|1@1+ (1,0) [0|1] "" XXX - SG_ LKA_MODE : 24|3@1+ (1,0) [0|7] "" XXX + SG_ STEER_MODE : 65|3@1+ (1,0) [0|1] "" XXX SG_ NEW_SIGNAL_2 : 70|2@0+ (1,0) [0|3] "" XXX SG_ NEW_SIGNAL_4 : 72|4@1+ (1,0) [0|15] "" XXX SG_ HAS_LANE_SAFETY : 80|1@0+ (1,0) [0|1] "" XXX @@ -168,14 +168,133 @@ BO_ 304 GEAR_SHIFTER: 16 XXX SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX SG_ PARK_BUTTON : 32|2@1+ (1,0) [0|3] "" XXX - SG_ GEAR : 64|3@1+ (1,0) [0|7] "" XXX SG_ KNOB_POSITION : 40|3@1+ (1,0) [0|3] "" XXX + SG_ GEAR : 64|3@1+ (1,0) [0|7] "" XXX + +BO_ 352 ADRV_0x160: 16 ADRV + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ AEB_SETTING : 24|2@1+ (1,0) [0|255] "" XXX + SG_ SET_ME_2 : 56|8@1+ (1,0) [0|1] "" XXX + SG_ SET_ME_FF : 64|8@1+ (1,0) [0|255] "" XXX + SG_ SET_ME_FC : 72|8@1+ (1,0) [0|255] "" XXX + SG_ SET_ME_9 : 80|8@1+ (1,0) [0|255] "" XXX + +BO_ 353 CCNC_0x161: 32 CCNC + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ FCA_ICON : 24|3@1+ (1,0) [0|7] "" XXX + SG_ FCA_ALT_ICON : 27|3@1+ (1,0) [0|7] "" XXX + SG_ LKA_ICON : 30|3@1+ (1,0) [0|3] "" XXX + SG_ HBA_ICON : 33|3@1+ (1,0) [0|7] "" XXX + SG_ ZEROS_1 : 36|4@1+ (1,0) [0|15] "" XXX + SG_ ZEROS_2 : 40|2@1+ (1,0) [0|3] "" XXX + SG_ FCA_IMAGE : 42|3@1+ (1,0) [0|7] "" XXX + SG_ ZEROS_3 : 45|3@1+ (1,0) [0|7] "" XXX + SG_ ZEROS_4 : 48|3@1+ (1,0) [0|7] "" XXX + SG_ BCA_LEFT : 51|3@1+ (1,0) [0|7] "" XXX + SG_ BCA_RIGHT : 54|3@1+ (1,0) [0|7] "" XXX + SG_ LCA_LEFT_ARROW : 57|3@1+ (1,0) [0|7] "" XXX + SG_ LCA_RIGHT_ARROW : 60|3@1+ (1,0) [0|7] "" XXX + SG_ ZEROS_5 : 63|1@0+ (1,0) [0|1] "" XXX + SG_ CENTERLINE : 64|2@1+ (1,0) [0|3] "" XXX + SG_ TARGET : 66|3@1+ (1,0) [0|7] "" XXX + SG_ TARGET_DISTANCE : 69|11@1+ (0.1,0) [0|204.7] "m" XXX + SG_ LANELINE_LEFT : 80|4@1+ (1,0) [0|15] "" XXX + SG_ LANELINE_LEFT_POSITION : 84|6@1+ (1,0) [0|15] "" XXX + SG_ LANELINE_RIGHT : 90|4@1+ (1,0) [0|15] "" XXX + SG_ LANELINE_RIGHT_POSITION : 94|6@1+ (1,0) [0|3] "" XXX + SG_ LANELINE_CURVATURE : 100|5@1- (1,15) [0|31] "" XXX + SG_ LANE_HIGHLIGHT : 105|4@1+ (1,0) [0|15] "" XXX + SG_ LANE_HIGHLIGHT_DISTANCE : 109|11@1+ (0.1,0) [0|204.7] "m" XXX + SG_ LANE_LEFT : 120|3@1+ (1,0) [0|7] "" XXX + SG_ LANE_RIGHT : 123|3@1+ (1,0) [0|7] "" XXX + SG_ LANE_ZOOM : 126|2@1+ (1,0) [0|3] "" XXX + SG_ ALERTS_1 : 128|6@1+ (1,0) [0|63] "" XXX + SG_ ALERTS_2 : 134|5@1+ (1,0) [0|3] "" XXX + SG_ ALERTS_3 : 139|5@1+ (1,0) [0|15] "" XXX + SG_ ALERTS_4 : 144|8@1+ (1,0) [0|511] "" XXX + SG_ ALERTS_5 : 152|5@1+ (1,0) [0|7] "" XXX + SG_ MUTE : 157|3@1+ (1,0) [0|7] "" XXX + SG_ SOUNDS_1 : 160|4@1+ (1,0) [0|3] "" XXX + SG_ SOUNDS_2 : 164|4@1+ (1,0) [0|3] "" XXX + SG_ SOUNDS_3 : 168|4@1+ (1,0) [0|15] "" XXX + SG_ SOUNDS_4 : 172|3@1+ (1,0) [0|7] "" XXX + SG_ ZEROS_6 : 175|1@0+ (1,0) [0|1] "" XXX + SG_ ZEROS_7 : 176|5@1+ (1,0) [0|31] "" XXX + SG_ SETSPEED_HUD : 181|3@1+ (1,0) [0|3] "" XXX + SG_ DISTANCE_LEAD : 184|5@1+ (1,0) [0|31] "" XXX + SG_ DISTANCE_CAR : 189|3@1+ (1,0) [0|7] "" XXX + SG_ DISTANCE_SPACING : 192|4@1+ (1,0) [0|15] "" XXX + SG_ DISTANCE : 196|4@1+ (1,0) [0|7] "" XXX + SG_ SETSPEED_SPEED : 200|8@1+ (1,0) [0|255] "" XXX + SG_ SETSPEED : 208|4@1+ (1,0) [0|3] "" XXX + SG_ HDA_ICON : 212|4@1+ (1,0) [0|3] "" XXX + SG_ SLA_ICON : 216|4@1+ (1,0) [0|15] "" XXX + SG_ NAV_ICON : 220|4@1+ (1,0) [0|3] "" XXX + SG_ LFA_ICON : 224|4@1+ (1,0) [0|3] "" XXX + SG_ LCA_LEFT_ICON : 228|4@1+ (1,0) [0|15] "" XXX + SG_ LCA_RIGHT_ICON : 232|4@1+ (1,0) [0|15] "" XXX + SG_ BACKGROUND : 236|4@1+ (1,0) [0|15] "" XXX + SG_ DAW_ICON : 240|3@1+ (1,0) [0|7] "" XXX + SG_ CAR_CIRCLE : 243|3@1+ (1,0) [0|7] "" XXX + SG_ ZEROS_8 : 246|2@1+ (1,0) [0|3] "" XXX + SG_ ZEROS_9 : 248|8@1+ (1,0) [0|255] "" XXX + +BO_ 354 CCNC_0x162: 32 CCNC + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ COUNTRY : 24|4@1+ (1,0) [0|7] "" XXX + SG_ SPEEDLIMIT_FLASH : 28|4@1+ (1,0) [0|15] "" XXX + SG_ SPEEDLIMIT : 32|8@1+ (1,0) [0|255] "" XXX + SG_ SIGNS : 40|8@1+ (1,0) [0|15] "" XXX + SG_ SPEEDLIMIT_WEATHER : 48|4@1+ (1,0) [0|15] "" XXX + SG_ VIBRATE : 52|3@1+ (1,0) [0|7] "" XXX + SG_ ZEROS_1 : 55|1@0+ (1,0) [0|1] "" XXX + SG_ ZEROS_2 : 56|8@1+ (1,0) [0|255] "" XXX + SG_ LEAD : 64|5@1+ (1,0) [0|31] "" XXX + SG_ LEAD_DISTANCE : 69|11@1+ (0.1,0) [0|204.7] "m" XXX + SG_ LEAD_LATERAL : 80|7@1+ (1,0) [0|127] "" XXX + SG_ ZEROS_3 : 87|1@0+ (1,0) [0|1] "" XXX + SG_ LEAD_ALT : 88|5@1+ (1,0) [0|31] "" XXX + SG_ LEAD_ALT_DISTANCE : 93|11@1+ (0.1,0) [0|204.7] "m" XXX + SG_ LEAD_ALT_LATERAL : 104|7@1+ (1,0) [0|127] "" XXX + SG_ ZEROS_4 : 111|1@0+ (1,0) [0|1] "" XXX + SG_ LEAD_LEFT : 112|5@1+ (1,0) [0|31] "" XXX + SG_ LEAD_LEFT_DISTANCE : 117|11@1+ (0.1,0) [0|204.7] "m" XXX + SG_ LEAD_LEFT_LATERAL : 128|7@1+ (1,0) [0|127] "" XXX + SG_ ZEROS_5 : 135|1@0+ (1,0) [0|1] "" XXX + SG_ LEAD_RIGHT : 136|5@1+ (1,0) [0|31] "" XXX + SG_ LEAD_RIGHT_DISTANCE : 141|11@1+ (0.1,0) [0|204.7] "m" XXX + SG_ LEAD_RIGHT_LATERAL : 152|7@1+ (1,0) [0|127] "" XXX + SG_ ZEROS_6 : 159|1@0+ (1,0) [0|1] "" XXX + SG_ ZEROS_7 : 160|8@1+ (1,0) [0|255] "" XXX + SG_ ZEROS_8 : 168|8@1+ (1,0) [0|255] "" XXX + SG_ ZEROS_9 : 176|8@1+ (1,0) [0|255] "" XXX + SG_ ZEROS_10 : 184|8@1+ (1,0) [0|255] "" XXX + SG_ ZEROS_11 : 192|8@1+ (1,0) [0|255] "" XXX + SG_ ZEROS_12 : 200|8@1+ (1,0) [0|255] "" XXX + SG_ ZEROS_13 : 208|5@1+ (1,0) [0|31] "" XXX + SG_ FAULT_FSS : 213|3@1+ (1,0) [0|7] "" XXX + SG_ FAULT_FCA : 216|3@1+ (1,0) [0|7] "" XXX + SG_ FAULT_LSS : 219|3@1+ (1,0) [0|7] "" XXX + SG_ FAULT_SLA : 222|3@1+ (1,0) [0|7] "" XXX + SG_ FAULT_DAW : 225|3@1+ (1,0) [0|7] "" XXX + SG_ FAULT_HBA : 228|3@1+ (1,0) [0|7] "" XXX + SG_ FAULT_SCC : 231|3@1+ (1,0) [0|7] "" XXX + SG_ FAULT_LFA : 234|3@1+ (1,0) [0|7] "" XXX + SG_ FAULT_HDA : 237|3@1+ (1,0) [0|7] "" XXX + SG_ FAULT_LCA : 240|3@1+ (1,0) [0|7] "" XXX + SG_ FAULT_HDP : 243|3@1+ (1,0) [0|7] "" XXX + SG_ FAULT_DAS : 246|3@1+ (1,0) [0|7] "" XXX + SG_ FAULT_ESS : 249|3@1+ (1,0) [0|7] "" XXX + SG_ ZEROS_14 : 252|4@1+ (1,0) [0|15] "" XXX BO_ 357 SPAS1: 24 APRK SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|0] "" XXX - SG_ NEW_SIGNAL_1 : 96|16@1- (0.1,0) [0|0] "" XXX SG_ NEW_SIGNAL_2 : 90|3@1+ (1,0) [0|0] "" XXX + SG_ NEW_SIGNAL_1 : 96|16@1- (0.1,0) [0|0] "" XXX BO_ 362 SPAS2: 32 APRK SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX @@ -185,31 +304,22 @@ BO_ 362 SPAS2: 32 APRK BO_ 373 TCS: 24 XXX SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 80|1@0+ (1,0) [0|1] "" XXX - SG_ NEW_SIGNAL_2 : 74|1@0+ (1,0) [0|1] "" XXX - SG_ NEW_SIGNAL_3 : 76|1@0+ (1,0) [0|1] "" XXX SG_ NEW_SIGNAL_4 : 24|7@1+ (1,0) [0|127] "" XXX SG_ aBasis : 32|11@1+ (0.01,-10.23) [0|7] "m/s^2" XXX + SG_ ACCEL_REF_ACC : 48|11@1- (1,0) [0|1023] "" XXX + SG_ EQUIP_MAYBE : 64|1@0+ (1,0) [0|1] "" XXX + SG_ ACCEnable : 67|2@0+ (1,0) [0|3] "" XXX + SG_ ACC_REQ : 68|1@0+ (1,0) [0|1] "" XXX SG_ NEW_SIGNAL_5 : 72|1@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_2 : 74|1@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_3 : 76|1@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_1 : 80|1@0+ (1,0) [0|1] "" XXX + SG_ DriverBraking : 81|1@0+ (1,0) [0|1] "" XXX + SG_ DriverBrakingLowSens : 84|1@1+ (1,0) [0|1] "" XXX + SG_ AEB_EQUIP_MAYBE : 96|1@0+ (1,0) [0|1] "" XXX SG_ NEW_SIGNAL_6 : 128|4@1+ (1,0) [0|15] "" XXX SG_ NEW_SIGNAL_7 : 135|2@0+ (1,0) [0|3] "" XXX SG_ PROBABLY_EQUIP : 136|2@1+ (1,0) [0|3] "" XXX - SG_ AEB_EQUIP_MAYBE : 96|1@0+ (1,0) [0|1] "" XXX - SG_ EQUIP_MAYBE : 64|1@0+ (1,0) [0|1] "" XXX - SG_ DriverBraking : 81|1@0+ (1,0) [0|1] "" XXX - SG_ DriverBrakingLowSens : 84|1@1+ (1,0) [0|1] "" XXX - SG_ ACC_REQ : 68|1@0+ (1,0) [0|1] "" XXX - SG_ ACCEL_REF_ACC : 48|11@1- (1,0) [0|1023] "" XXX - SG_ ACCEnable : 67|2@0+ (1,0) [0|3] "" XXX - -BO_ 352 ADRV_0x160: 16 ADRV - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ SET_ME_FF : 64|8@1+ (1,0) [0|255] "" XXX - SG_ SET_ME_FC : 72|8@1+ (1,0) [0|255] "" XXX - SG_ SET_ME_2 : 56|8@1+ (1,0) [0|1] "" XXX - SG_ AEB_SETTING : 24|2@1+ (1,0) [0|255] "" XXX - SG_ SET_ME_9 : 80|8@1+ (1,0) [0|255] "" XXX BO_ 384 CAM_0x180: 32 CAMERA SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX @@ -237,40 +347,40 @@ BO_ 389 CAM_0x185: 8 CAMERA BO_ 416 SCC_CONTROL: 32 ADRV SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ NEW_SIGNAL_1 : 64|2@1+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_8 : 170|4@1+ (1,0) [0|15] "" XXX - SG_ ZEROS : 215|48@0+ (1,0) [0|281474976710655] "" XXX - SG_ ZEROS_3 : 191|7@0+ (1,0) [0|127] "" XXX - SG_ ZEROS_4 : 183|4@0+ (1,0) [0|63] "" XXX - SG_ ZEROS_6 : 119|16@0+ (1,0) [0|65535] "" XXX - SG_ ZEROS_8 : 95|5@0+ (1,0) [0|31] "" XXX - SG_ NEW_SIGNAL_3 : 109|2@0+ (1,0) [0|1] "" XXX - SG_ SET_ME_TMP_64 : 55|8@0+ (1,0) [0|63] "" XXX - SG_ SET_ME_2 : 105|3@1+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_6 : 104|1@0+ (1,0) [0|1] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ ZEROS_9 : 71|5@1+ (1,0) [0|15] "" XXX - SG_ ZEROS_10 : 111|2@0+ (1,0) [0|3] "" XXX + SG_ ACC_ObjDist : 24|11@1+ (0.1,0) [0|204.7] "m" XXX + SG_ ACC_ObjRelSpd : 35|9@1+ (0.1,-16.4) [-16.4|34.7] "m/s" XXX SG_ SET_ME_3 : 45|2@0+ (1,0) [0|3] "" XXX SG_ ObjValid : 46|1@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 168|2@1+ (1,0) [0|3] "" XXX - SG_ OBJ_STATUS : 176|3@1+ (1,0) [0|7] "" XXX - SG_ ACC_ObjDist : 24|11@1+ (0.1,0) [0|204.7] "m" XXX + SG_ SET_ME_TMP_64 : 55|8@0+ (1,0) [0|63] "" XXX + SG_ ZEROS_7 : 63|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 64|2@1+ (1,0) [0|3] "" XXX + SG_ MainMode_ACC : 66|1@1+ (1,0) [0|1] "" XXX + SG_ ACCMode : 68|3@1+ (1,0) [0|7] "" XXX + SG_ ZEROS_9 : 71|5@1+ (1,0) [0|15] "" XXX + SG_ CRUISE_STANDSTILL : 76|1@1+ (1,0) [0|1] "" XXX SG_ ZEROS_5 : 77|11@1+ (1,0) [0|2047] "" XXX SG_ DISTANCE_SETTING : 88|3@1+ (1,0) [0|3] "" XXX - SG_ ZEROS_2 : 207|5@0+ (1,0) [0|63] "" XXX - SG_ CRUISE_STANDSTILL : 76|1@1+ (1,0) [0|1] "" XXX - SG_ aReqRaw : 140|11@1+ (0.01,-10.23) [-10.23|10.24] "m/s^2" XXX + SG_ ZEROS_8 : 95|5@0+ (1,0) [0|31] "" XXX + SG_ VSetDis : 103|8@0+ (1,0) [0|255] "km/h or mph" XXX + SG_ NEW_SIGNAL_6 : 104|1@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_2 : 105|3@1+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_3 : 109|2@0+ (1,0) [0|1] "" XXX + SG_ ZEROS_10 : 111|2@0+ (1,0) [0|3] "" XXX + SG_ ZEROS_6 : 119|16@0+ (1,0) [0|65535] "" XXX SG_ aReqValue : 128|11@1+ (0.01,-10.23) [-10.23|10.24] "m/s^2" XXX - SG_ ZEROS_7 : 63|8@0+ (1,0) [0|255] "" XXX - SG_ ACCMode : 68|3@1+ (1,0) [0|7] "" XXX - SG_ ACC_ObjRelSpd : 35|9@1+ (0.1,-16.4) [-16.4|34.7] "m/s" XXX + SG_ aReqRaw : 140|11@1+ (0.01,-10.23) [-10.23|10.24] "m/s^2" XXX + SG_ JerkUpperLimit : 158|7@0+ (0.1,0) [0|0] "" XXX SG_ JerkLowerLimit : 166|7@0+ (0.1,0) [0|12.7] "m/s^3" XXX + SG_ NEW_SIGNAL_2 : 168|2@1+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_8 : 170|4@1+ (1,0) [0|15] "" XXX + SG_ OBJ_STATUS : 176|3@1+ (1,0) [0|7] "" XXX + SG_ ZEROS_4 : 183|4@0+ (1,0) [0|63] "" XXX SG_ StopReq : 184|1@0+ (1,0) [0|1] "" XXX + SG_ ZEROS_3 : 191|7@0+ (1,0) [0|127] "" XXX SG_ NEW_SIGNAL_15 : 192|11@1+ (0.1,0) [0|204.7] "m" XXX - SG_ VSetDis : 103|8@0+ (1,0) [0|255] "km/h or mph" XXX - SG_ MainMode_ACC : 66|1@1+ (1,0) [0|1] "" XXX - SG_ JerkUpperLimit : 158|7@0+ (0.1,0) [0|0] "" XXX + SG_ ZEROS_2 : 207|5@0+ (1,0) [0|63] "" XXX + SG_ ZEROS : 215|48@0+ (1,0) [0|281474976710655] "" XXX BO_ 426 CRUISE_BUTTONS_ALT: 16 XXX SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX @@ -281,8 +391,8 @@ BO_ 426 CRUISE_BUTTONS_ALT: 16 XXX SG_ NEW_SIGNAL_2 : 31|3@1+ (1,0) [0|7] "" XXX SG_ ADAPTIVE_CRUISE_MAIN_BTN : 34|1@1+ (1,0) [0|1] "" XXX SG_ NEW_SIGNAL_3 : 35|1@1+ (1,0) [0|1] "" XXX - SG_ LFA_BTN : 39|1@1+ (1,0) [0|1] "" XXX SG_ CRUISE_BUTTONS : 36|3@1+ (1,0) [0|4] "" XXX + SG_ LFA_BTN : 39|1@1+ (1,0) [0|1] "" XXX SG_ NEW_SIGNAL_4 : 40|1@1+ (1,0) [0|1] "" XXX SG_ NORMAL_CRUISE_MAIN_BTN : 41|1@1+ (1,0) [0|1] "" XXX SG_ NEW_SIGNAL_5 : 42|2@1+ (1,0) [0|3] "" XXX @@ -299,6 +409,29 @@ BO_ 426 CRUISE_BUTTONS_ALT: 16 XXX SG_ BYTE14 : 112|8@1+ (1,0) [0|255] "" XXX SG_ BYTE15 : 120|8@1+ (1,0) [0|255] "" XXX +BO_ 437 CCNC_0x1B5: 32 CCNC + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ LEFT : 24|2@1+ (1,0) [0|3] "" XXX + SG_ LEFT_LDW : 27|1@0+ (1,0) [0|1] "" XXX + SG_ LEFT_1 : 29|9@1+ (1,0) [0|511] "" XXX + SG_ LEFT_2 : 38|5@1+ (1,0) [0|31] "" XXX + SG_ LEFT_3 : 43|10@1- (1,0) [0|1023] "" XXX + SG_ LEFT_4 : 64|16@1- (1,0) [0|65535] "" XXX + SG_ LEFT_5 : 80|16@1- (1,0) [0|65535] "" XXX + SG_ RIGHT : 96|2@1+ (1,0) [0|3] "" XXX + SG_ RIGHT_LDW : 99|1@0+ (1,0) [0|1] "" XXX + SG_ RIGHT_1 : 101|9@1+ (1,0) [0|511] "" XXX + SG_ RIGHT_2 : 110|5@1+ (1,0) [0|31] "" XXX + SG_ RIGHT_3 : 115|10@1- (1,0) [0|1023] "" XXX + SG_ RIGHT_4 : 128|16@1- (1,0) [0|65535] "" XXX + SG_ RIGHT_5 : 144|16@1- (1,0) [0|65535] "" XXX + SG_ LEAD : 192|2@1+ (1,0) [0|3] "" XXX + SG_ LEAD_1 : 194|6@1+ (1,0) [0|63] "" XXX + SG_ LEAD_2 : 200|11@1- (1,0) [0|4095] "" XXX + SG_ LEAD_3 : 211|1@0+ (1,0) [0|1] "" XXX + SG_ LEAD_DISTANCE : 213|11@1+ (0.1,0) [0|204.7] "m" XXX + BO_ 438 CAM_0x1b6: 32 CAMERA SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX @@ -315,16 +448,30 @@ BO_ 441 CAM_0x1b9: 32 CAMERA SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX +BO_ 442 BLINDSPOTS_REAR_CORNERS: 24 XXX + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ LEFT_BLOCKED : 24|1@0+ (1,0) [0|1] "" XXX + SG_ LEFT_MB : 30|1@0+ (1,0) [0|3] "" XXX + SG_ MORE_LEFT_PROB : 32|1@1+ (1,0) [0|3] "" XXX + SG_ FL_INDICATOR : 46|6@0+ (1,0) [0|1] "" XXX + SG_ FR_INDICATOR : 54|6@0+ (1,0) [0|63] "" XXX + SG_ RIGHT_BLOCKED : 64|1@0+ (1,0) [0|1] "" XXX + SG_ COLLISION_AVOIDANCE_ACTIVE : 68|1@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_2 : 96|1@0+ (1,0) [0|1] "" XXX + SG_ FL_INDICATOR_ALT : 138|1@0+ (1,0) [0|1] "" XXX + SG_ FR_INDICATOR_ALT : 141|1@0+ (1,0) [0|1] "" XXX + BO_ 463 CRUISE_BUTTONS: 8 XXX SG_ _CHECKSUM : 0|8@1+ (1,0) [0|65535] "" XXX - SG_ LKAS_BTN : 23|1@1+ (1,0) [0|1] "" XXX - SG_ SET_ME_1 : 29|1@1+ (1,0) [0|1] "" XXX - SG_ ADAPTIVE_CRUISE_MAIN_BTN : 19|1@1+ (1,0) [0|1] "" XXX - SG_ NORMAL_CRUISE_MAIN_BTN : 21|1@1+ (1,0) [0|1] "" XXX SG_ COUNTER : 12|4@1+ (1,0) [0|255] "" XXX SG_ CRUISE_BUTTONS : 16|3@1+ (1,0) [0|3] "" XXX + SG_ ADAPTIVE_CRUISE_MAIN_BTN : 19|1@1+ (1,0) [0|1] "" XXX + SG_ NORMAL_CRUISE_MAIN_BTN : 21|1@1+ (1,0) [0|1] "" XXX + SG_ LKAS_BTN : 23|1@1+ (1,0) [0|1] "" XXX SG_ RIGHT_PADDLE : 25|1@1+ (1,0) [0|1] "" XXX SG_ LEFT_PADDLE : 27|1@1+ (1,0) [0|1] "" XXX + SG_ SET_ME_1 : 29|1@1+ (1,0) [0|1] "" XXX BO_ 474 ADRV_0x1da: 32 ADRV SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX @@ -335,13 +482,26 @@ BO_ 474 ADRV_0x1da: 32 ADRV BO_ 480 LFAHDA_CLUSTER: 16 ADRV SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_4 : 24|1@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_5 : 25|1@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_2 : 30|1@0+ (1,0) [0|1] "" XXX SG_ HDA_ICON : 31|1@1+ (1,0) [0|1] "" XXX - SG_ LFA_ICON : 47|2@1+ (1,0) [0|3] "" XXX SG_ NEW_SIGNAL_1 : 32|3@1+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_2 : 30|1@0+ (1,0) [0|1] "" XXX + SG_ LFA_ICON : 47|2@1+ (1,0) [0|3] "" XXX SG_ NEW_SIGNAL_3 : 49|1@0+ (1,0) [0|1] "" XXX - SG_ NEW_SIGNAL_4 : 24|1@0+ (1,0) [0|1] "" XXX - SG_ NEW_SIGNAL_5 : 25|1@0+ (1,0) [0|1] "" XXX + +BO_ 485 BLINDSPOTS_FRONT_CORNER_1: 16 XXX + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ REVERSING : 24|1@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_5 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_7 : 32|2@1+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_8 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_9 : 55|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_4 : 80|1@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_3 : 88|1@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_2 : 96|1@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_1 : 108|2@0+ (1,0) [0|3] "" XXX BO_ 490 ADRV_0x1ea: 32 ADRV SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX @@ -356,21 +516,34 @@ BO_ 490 ADRV_0x1ea: 32 ADRV SG_ NEW_SIGNAL_7 : 80|5@1+ (1,0) [0|31] "" XXX SG_ NEW_SIGNAL_8 : 88|7@1+ (1,0) [0|127] "" XXX SG_ NEW_SIGNAL_9 : 96|1@0+ (1,0) [0|1] "" XXX + SG_ SET_ME_FF : 120|8@1+ (1,0) [0|255] "" XXX SG_ NEW_SIGNAL_10 : 143|5@0+ (1,0) [0|31] "" XXX SG_ NEW_SIGNAL_11 : 144|3@1+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_12 : 152|6@1+ (1,0) [0|63] "" XXX SG_ NEW_SIGNAL_13 : 160|1@0+ (1,0) [0|1] "" XXX SG_ NEW_SIGNAL_14 : 163|5@1+ (1,0) [0|31] "" XXX - SG_ NEW_SIGNAL_15 : 175|4@0+ (1,0) [0|63] "" XXX SG_ NEW_SIGNAL_16 : 168|3@1+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_15 : 175|4@0+ (1,0) [0|63] "" XXX SG_ NEW_SIGNAL_17 : 176|2@1+ (1,0) [0|3] "" XXX SG_ NEW_SIGNAL_18 : 184|1@0+ (1,0) [0|1] "" XXX SG_ NEW_SIGNAL_19 : 208|3@1+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_20 : 212|1@0+ (1,0) [0|1] "" XXX - SG_ SET_ME_FF : 120|8@1+ (1,0) [0|255] "" XXX SG_ SET_ME_TMP_F : 232|5@1+ (1,0) [0|31] "" XXX SG_ SET_ME_TMP_F_2 : 240|5@1+ (1,0) [0|31] "" XXX +BO_ 506 CLUSTER_SPEED_LIMIT: 32 XXX + SG_ SPEED_LIMIT_1 : 39|7@0+ (1,0) [0|255] "" XXX + SG_ SPEED_LIMIT_2 : 47|7@0+ (1,0) [0|255] "" XXX + SG_ SECONDARY_LIMIT_1 : 79|8@0+ (1,0) [0|127] "" XXX + SG_ SECONDARY_LIMIT_2 : 103|8@0+ (1,0) [0|127] "" XXX + SG_ SPEED_LIMIT_3 : 119|8@0+ (1,0) [0|255] "" XXX + SG_ ARROW_DOWN : 120|1@0+ (1,0) [0|1] "" XXX + SG_ ARROW_UP : 121|1@0+ (1,0) [0|1] "" XXX + SG_ CHIME_2 : 122|2@1+ (1,0) [0|7] "" XXX + SG_ SPEED_CHANGE_BLINKING : 129|1@1+ (1,0) [0|3] "" XXX + SG_ CHIME_1 : 133|1@0+ (1,0) [0|1] "" XXX + SG_ SCHOOL_ZONE : 155|1@0+ (1,0) [0|1] "" XXX + BO_ 507 CAM_0x1fb: 32 CAMERA SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX @@ -558,24 +731,28 @@ BO_ 866 CAM_0x362: 32 CAMERA SG_ BYTE30 : 240|8@1+ (1,0) [0|255] "" XXX SG_ BYTE31 : 248|8@1+ (1,0) [0|255] "" XXX +BO_ 874 BLINDSPOTS_FRONT_CORNER_2: 16 XXX + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + BO_ 961 BLINKER_STALKS: 8 XXX - SG_ COUNTER_ALT : 15|4@0+ (1,0) [0|15] "" XXX SG_ CHECKSUM_MAYBE : 7|8@0+ (1,0) [0|255] "" XXX + SG_ COUNTER_ALT : 15|4@0+ (1,0) [0|15] "" XXX SG_ HIGHBEAM_FORWARD : 18|1@0+ (1,0) [0|1] "" XXX + SG_ LIGHT_KNOB_POSITION : 21|2@0+ (1,0) [0|3] "" XXX SG_ HIGHBEAM_BACKWARD : 26|1@0+ (1,0) [0|1] "" XXX - SG_ RIGHT_BLINKER : 32|1@0+ (1,0) [0|1] "" XXX SG_ LEFT_BLINKER : 30|1@0+ (1,0) [0|1] "" XXX - SG_ LIGHT_KNOB_POSITION : 21|2@0+ (1,0) [0|3] "" XXX + SG_ RIGHT_BLINKER : 32|1@0+ (1,0) [0|1] "" XXX BO_ 1041 DOORS_SEATBELTS: 8 XXX SG_ CHECKSUM_MAYBE : 7|8@0+ (1,0) [0|65535] "" XXX SG_ COUNTER_ALT : 15|4@0+ (1,0) [0|15] "" XXX SG_ DRIVER_DOOR : 24|1@1+ (1,0) [0|1] "" XXX SG_ PASSENGER_DOOR : 34|1@0+ (1,0) [0|1] "" XXX + SG_ PASSENGER_SEATBELT : 36|1@0+ (1,0) [0|1] "" XXX + SG_ DRIVER_SEATBELT : 42|1@0+ (1,0) [0|1] "" XXX SG_ DRIVER_REAR_DOOR : 52|1@0+ (1,0) [0|1] "" XXX SG_ PASSENGER_REAR_DOOR : 56|1@0+ (1,0) [0|1] "" XXX - SG_ DRIVER_SEATBELT : 42|1@0+ (1,0) [0|1] "" XXX - SG_ PASSENGER_SEATBELT : 36|1@0+ (1,0) [0|1] "" XXX BO_ 1043 BLINKERS: 8 XXX SG_ LEFT_STALK : 8|1@0+ (1,0) [0|1] "" XXX @@ -587,53 +764,6 @@ BO_ 1043 BLINKERS: 8 XXX SG_ RIGHT_LAMP_ALT : 61|1@0+ (1,0) [0|1] "" XXX SG_ USE_ALT_LAMP : 62|1@0+ (1,0) [0|1] "" XXX -BO_ 1240 CLUSTER_INFO: 8 XXX - SG_ DISTANCE_UNIT : 0|1@1+ (1,0) [0|1] "" XXX - -BO_ 442 BLINDSPOTS_REAR_CORNERS: 24 XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ NEW_SIGNAL_2 : 96|1@0+ (1,0) [0|1] "" XXX - SG_ COLLISION_AVOIDANCE_ACTIVE : 68|1@0+ (1,0) [0|1] "" XXX - SG_ LEFT_MB : 30|1@0+ (1,0) [0|3] "" XXX - SG_ LEFT_BLOCKED : 24|1@0+ (1,0) [0|1] "" XXX - SG_ MORE_LEFT_PROB : 32|1@1+ (1,0) [0|3] "" XXX - SG_ FL_INDICATOR : 46|6@0+ (1,0) [0|1] "" XXX - SG_ FR_INDICATOR : 54|6@0+ (1,0) [0|63] "" XXX - SG_ RIGHT_BLOCKED : 64|1@0+ (1,0) [0|1] "" XXX - SG_ FL_INDICATOR_ALT : 138|1@0+ (1,0) [0|1] "" XXX - SG_ FR_INDICATOR_ALT : 141|1@0+ (1,0) [0|1] "" XXX - -BO_ 874 BLINDSPOTS_FRONT_CORNER_2: 16 XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - -BO_ 485 BLINDSPOTS_FRONT_CORNER_1: 16 XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ NEW_SIGNAL_1 : 108|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 96|1@0+ (1,0) [0|1] "" XXX - SG_ NEW_SIGNAL_3 : 88|1@0+ (1,0) [0|1] "" XXX - SG_ NEW_SIGNAL_4 : 80|1@0+ (1,0) [0|1] "" XXX - SG_ NEW_SIGNAL_5 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ REVERSING : 24|1@0+ (1,0) [0|1] "" XXX - SG_ NEW_SIGNAL_7 : 32|2@1+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_8 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_9 : 55|8@0+ (1,0) [0|255] "" XXX - -BO_ 506 CLUSTER_SPEED_LIMIT: 32 XXX - SG_ SPEED_LIMIT_3 : 119|8@0+ (1,0) [0|255] "" XXX - SG_ SPEED_LIMIT_2 : 47|7@0+ (1,0) [0|255] "" XXX - SG_ SPEED_LIMIT_1 : 39|7@0+ (1,0) [0|255] "" XXX - SG_ SPEED_CHANGE_BLINKING : 129|1@1+ (1,0) [0|3] "" XXX - SG_ CHIME_2 : 122|2@1+ (1,0) [0|7] "" XXX - SG_ CHIME_1 : 133|1@0+ (1,0) [0|1] "" XXX - SG_ ARROW_DOWN : 120|1@0+ (1,0) [0|1] "" XXX - SG_ ARROW_UP : 121|1@0+ (1,0) [0|1] "" XXX - SG_ SECONDARY_LIMIT_1 : 79|8@0+ (1,0) [0|127] "" XXX - SG_ SECONDARY_LIMIT_2 : 103|8@0+ (1,0) [0|127] "" XXX - SG_ SCHOOL_ZONE : 155|1@0+ (1,0) [0|1] "" XXX - BO_ 1144 DRIVE_MODE: 8 XXX SG_ DRIVE_MODE : 0|16@1+ (1,-61611) [0|61611] "" XXX SG_ DRIVE_MODE2 : 28|3@1+ (1,0) [1|3] "" XXX @@ -651,6 +781,9 @@ BO_ 1151 HVAC_TOUCH_BUTTONS: 8 XXX SG_ RECIRC_BUTTON : 48|1@0+ (1,0) [0|1] "" XXX SG_ HEAT_BUTTON : 52|1@0+ (1,0) [0|1] "" XXX +BO_ 1240 CLUSTER_INFO: 8 XXX + SG_ DISTANCE_UNIT : 0|1@1+ (1,0) [0|1] "" XXX + BO_ 1259 LOCAL_TIME2: 8 XXX SG_ HOURS : 15|5@0+ (1,0) [0|31] "" XXX SG_ MINUTES : 21|6@0+ (1,0) [0|63] "" XXX @@ -662,153 +795,15 @@ BO_ 1264 LOCAL_TIME: 8 XXX SG_ MINUTES : 21|6@0+ (1,0) [0|63] "" XXX SG_ SECONDS : 31|8@0+ (1,0) [0|59] "" XXX -BO_ 353 CCNC_0x161: 32 CCNC - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ FCA_ICON : 24|3@1+ (1,0) [0|7] "" XXX - SG_ FCA_ALT_ICON : 27|3@1+ (1,0) [0|7] "" XXX - SG_ LKA_ICON : 30|3@1+ (1,0) [0|3] "" XXX - SG_ HBA_ICON : 33|3@1+ (1,0) [0|7] "" XXX - SG_ ZEROS_1 : 36|4@1+ (1,0) [0|15] "" XXX - SG_ ZEROS_2 : 40|2@1+ (1,0) [0|3] "" XXX - SG_ FCA_IMAGE : 42|3@1+ (1,0) [0|7] "" XXX - SG_ ZEROS_3 : 45|3@1+ (1,0) [0|7] "" XXX - SG_ ZEROS_4 : 48|3@1+ (1,0) [0|7] "" XXX - SG_ BCA_LEFT : 51|3@1+ (1,0) [0|7] "" XXX - SG_ BCA_RIGHT : 54|3@1+ (1,0) [0|7] "" XXX - SG_ LCA_LEFT_ARROW : 57|3@1+ (1,0) [0|7] "" XXX - SG_ LCA_RIGHT_ARROW : 60|3@1+ (1,0) [0|7] "" XXX - SG_ ZEROS_5 : 63|1@0+ (1,0) [0|1] "" XXX - SG_ CENTERLINE : 64|2@1+ (1,0) [0|3] "" XXX - SG_ TARGET : 66|3@1+ (1,0) [0|7] "" XXX - SG_ TARGET_DISTANCE : 69|11@1+ (0.1,0) [0|204.7] "m" XXX - SG_ LANELINE_LEFT : 80|4@1+ (1,0) [0|15] "" XXX - SG_ LANELINE_LEFT_POSITION : 84|6@1+ (1,0) [0|15] "" XXX - SG_ LANELINE_RIGHT : 90|4@1+ (1,0) [0|15] "" XXX - SG_ LANELINE_RIGHT_POSITION : 94|6@1+ (1,0) [0|3] "" XXX - SG_ LANELINE_CURVATURE : 100|5@1- (1,15) [0|31] "" XXX - SG_ LANE_HIGHLIGHT : 105|4@1+ (1,0) [0|15] "" XXX - SG_ LANE_HIGHLIGHT_DISTANCE : 109|11@1+ (0.1,0) [0|204.7] "m" XXX - SG_ LANE_LEFT : 120|3@1+ (1,0) [0|7] "" XXX - SG_ LANE_RIGHT : 123|3@1+ (1,0) [0|7] "" XXX - SG_ LANE_ZOOM : 126|2@1+ (1,0) [0|3] "" XXX - SG_ ALERTS_1 : 128|6@1+ (1,0) [0|63] "" XXX - SG_ ALERTS_2 : 134|5@1+ (1,0) [0|3] "" XXX - SG_ ALERTS_3 : 139|5@1+ (1,0) [0|15] "" XXX - SG_ ALERTS_4 : 144|8@1+ (1,0) [0|511] "" XXX - SG_ ALERTS_5 : 152|5@1+ (1,0) [0|7] "" XXX - SG_ MUTE : 157|3@1+ (1,0) [0|7] "" XXX - SG_ SOUNDS_1 : 160|4@1+ (1,0) [0|3] "" XXX - SG_ SOUNDS_2 : 164|4@1+ (1,0) [0|3] "" XXX - SG_ SOUNDS_3 : 168|4@1+ (1,0) [0|15] "" XXX - SG_ SOUNDS_4 : 172|3@1+ (1,0) [0|7] "" XXX - SG_ ZEROS_6 : 175|1@0+ (1,0) [0|1] "" XXX - SG_ ZEROS_7 : 176|5@1+ (1,0) [0|31] "" XXX - SG_ SETSPEED_HUD : 181|3@1+ (1,0) [0|3] "" XXX - SG_ DISTANCE_LEAD : 184|5@1+ (1,0) [0|31] "" XXX - SG_ DISTANCE_CAR : 189|3@1+ (1,0) [0|7] "" XXX - SG_ DISTANCE_SPACING : 192|4@1+ (1,0) [0|15] "" XXX - SG_ DISTANCE : 196|4@1+ (1,0) [0|7] "" XXX - SG_ SETSPEED_SPEED : 200|8@1+ (1,0) [0|255] "" XXX - SG_ SETSPEED : 208|4@1+ (1,0) [0|3] "" XXX - SG_ HDA_ICON : 212|4@1+ (1,0) [0|3] "" XXX - SG_ SLA_ICON : 216|4@1+ (1,0) [0|15] "" XXX - SG_ NAV_ICON : 220|4@1+ (1,0) [0|3] "" XXX - SG_ LFA_ICON : 224|4@1+ (1,0) [0|3] "" XXX - SG_ LCA_LEFT_ICON : 228|4@1+ (1,0) [0|15] "" XXX - SG_ LCA_RIGHT_ICON : 232|4@1+ (1,0) [0|15] "" XXX - SG_ BACKGROUND : 236|4@1+ (1,0) [0|15] "" XXX - SG_ DAW_ICON : 240|3@1+ (1,0) [0|7] "" XXX - SG_ CAR_CIRCLE : 243|3@1+ (1,0) [0|7] "" XXX - SG_ ZEROS_8 : 246|2@1+ (1,0) [0|3] "" XXX - SG_ ZEROS_9 : 248|8@1+ (1,0) [0|255] "" XXX - -BO_ 354 CCNC_0x162: 32 CCNC - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ COUNTRY : 24|4@1+ (1,0) [0|7] "" XXX - SG_ SPEEDLIMIT_FLASH : 28|4@1+ (1,0) [0|15] "" XXX - SG_ SPEEDLIMIT : 32|8@1+ (1,0) [0|255] "" XXX - SG_ SIGNS : 40|8@1+ (1,0) [0|15] "" XXX - SG_ SPEEDLIMIT_WEATHER : 48|4@1+ (1,0) [0|15] "" XXX - SG_ VIBRATE : 52|3@1+ (1,0) [0|7] "" XXX - SG_ ZEROS_1 : 55|1@0+ (1,0) [0|1] "" XXX - SG_ ZEROS_2 : 56|8@1+ (1,0) [0|255] "" XXX - SG_ LEAD : 64|5@1+ (1,0) [0|31] "" XXX - SG_ LEAD_DISTANCE : 69|11@1+ (0.1,0) [0|204.7] "m" XXX - SG_ LEAD_LATERAL : 80|7@1+ (1,0) [0|127] "" XXX - SG_ ZEROS_3 : 87|1@0+ (1,0) [0|1] "" XXX - SG_ LEAD_ALT : 88|5@1+ (1,0) [0|31] "" XXX - SG_ LEAD_ALT_DISTANCE : 93|11@1+ (0.1,0) [0|204.7] "m" XXX - SG_ LEAD_ALT_LATERAL : 104|7@1+ (1,0) [0|127] "" XXX - SG_ ZEROS_4 : 111|1@0+ (1,0) [0|1] "" XXX - SG_ LEAD_LEFT : 112|5@1+ (1,0) [0|31] "" XXX - SG_ LEAD_LEFT_DISTANCE : 117|11@1+ (0.1,0) [0|204.7] "m" XXX - SG_ LEAD_LEFT_LATERAL : 128|7@1+ (1,0) [0|127] "" XXX - SG_ ZEROS_5 : 135|1@0+ (1,0) [0|1] "" XXX - SG_ LEAD_RIGHT : 136|5@1+ (1,0) [0|31] "" XXX - SG_ LEAD_RIGHT_DISTANCE : 141|11@1+ (0.1,0) [0|204.7] "m" XXX - SG_ LEAD_RIGHT_LATERAL : 152|7@1+ (1,0) [0|127] "" XXX - SG_ ZEROS_6 : 159|1@0+ (1,0) [0|1] "" XXX - SG_ ZEROS_7 : 160|8@1+ (1,0) [0|255] "" XXX - SG_ ZEROS_8 : 168|8@1+ (1,0) [0|255] "" XXX - SG_ ZEROS_9 : 176|8@1+ (1,0) [0|255] "" XXX - SG_ ZEROS_10 : 184|8@1+ (1,0) [0|255] "" XXX - SG_ ZEROS_11 : 192|8@1+ (1,0) [0|255] "" XXX - SG_ ZEROS_12 : 200|8@1+ (1,0) [0|255] "" XXX - SG_ ZEROS_13 : 208|5@1+ (1,0) [0|31] "" XXX - SG_ FAULT_FSS : 213|3@1+ (1,0) [0|7] "" XXX - SG_ FAULT_FCA : 216|3@1+ (1,0) [0|7] "" XXX - SG_ FAULT_LSS : 219|3@1+ (1,0) [0|7] "" XXX - SG_ FAULT_SLA : 222|3@1+ (1,0) [0|7] "" XXX - SG_ FAULT_DAW : 225|3@1+ (1,0) [0|7] "" XXX - SG_ FAULT_HBA : 228|3@1+ (1,0) [0|7] "" XXX - SG_ FAULT_SCC : 231|3@1+ (1,0) [0|7] "" XXX - SG_ FAULT_LFA : 234|3@1+ (1,0) [0|7] "" XXX - SG_ FAULT_HDA : 237|3@1+ (1,0) [0|7] "" XXX - SG_ FAULT_LCA : 240|3@1+ (1,0) [0|7] "" XXX - SG_ FAULT_HDP : 243|3@1+ (1,0) [0|7] "" XXX - SG_ FAULT_DAS : 246|3@1+ (1,0) [0|7] "" XXX - SG_ FAULT_ESS : 249|3@1+ (1,0) [0|7] "" XXX - SG_ ZEROS_14 : 252|4@1+ (1,0) [0|15] "" XXX - -BO_ 437 CCNC_0x1B5: 32 CCNC - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ LEFT : 24|2@1+ (1,0) [0|3] "" XXX - SG_ LEFT_LDW : 27|1@0+ (1,0) [0|1] "" XXX - SG_ LEFT_1 : 29|9@1+ (1,0) [0|511] "" XXX - SG_ LEFT_2 : 38|5@1+ (1,0) [0|31] "" XXX - SG_ LEFT_3 : 43|10@1- (1,0) [0|1023] "" XXX - SG_ LEFT_4 : 64|16@1- (1,0) [0|65535] "" XXX - SG_ LEFT_5 : 80|16@1- (1,0) [0|65535] "" XXX - SG_ RIGHT : 96|2@1+ (1,0) [0|3] "" XXX - SG_ RIGHT_LDW : 99|1@0+ (1,0) [0|1] "" XXX - SG_ RIGHT_1 : 101|9@1+ (1,0) [0|511] "" XXX - SG_ RIGHT_2 : 110|5@1+ (1,0) [0|31] "" XXX - SG_ RIGHT_3 : 115|10@1- (1,0) [0|1023] "" XXX - SG_ RIGHT_4 : 128|16@1- (1,0) [0|65535] "" XXX - SG_ RIGHT_5 : 144|16@1- (1,0) [0|65535] "" XXX - SG_ LEAD : 192|2@1+ (1,0) [0|3] "" XXX - SG_ LEAD_1 : 194|6@1+ (1,0) [0|63] "" XXX - SG_ LEAD_2 : 200|11@1- (1,0) [0|4095] "" XXX - SG_ LEAD_3 : 211|1@0+ (1,0) [0|1] "" XXX - SG_ LEAD_DISTANCE : 213|11@1+ (0.1,0) [0|204.7] "m" XXX - -CM_ 272 "Alternative LKAS message, used on cars such as 2023 Ioniq 6, 2nd gen Kona. Matches LKAS except size is 32 bytes"; -CM_ 676 "Contains signals with detailed lane line information. Used by ADAS ECU on HDA 2 vehicles to operate LFA."; -CM_ 866 "Contains signals with detailed lane line information. Used by ADAS ECU on HDA 2 vehicles to operate LFA. Used on cars that use message 272."; -CM_ 1043 "Lamp signals do not seem universal on cars that use LKAS_ALT, but stalk signals do."; - CM_ SG_ 80 HAS_LANE_SAFETY "If 0, hides LKAS 'Lane Safety' menu from vehicle settings"; CM_ SG_ 96 BRAKE_PRESSURE "User applied brake pedal pressure. Ramps from computer applied pressure on falling edge of cruise. Cruise cancels if !=0"; CM_ SG_ 101 BRAKE_POSITION "User applied brake pedal position, max is ~700. Signed on some vehicles"; CM_ SG_ 298 NEW_SIGNAL_4 "todo: figure out why always set to 9"; -CM_ SG_ 373 PROBABLY_EQUIP "aeb equip?"; +CM_ SG_ 352 SET_ME_9 "has something to do with AEB settings"; CM_ SG_ 373 ACCEnable "Likely a copy of CAN's TCS13->ACCEnable"; CM_ SG_ 373 DriverBraking "Likely derived from BRAKE->BRAKE_POSITION"; CM_ SG_ 373 DriverBrakingLowSens "Higher threshold version of DriverBraking"; -CM_ SG_ 352 SET_ME_9 "has something to do with AEB settings"; +CM_ SG_ 373 PROBABLY_EQUIP "aeb equip?"; CM_ SG_ 416 VSetDis "set speed in display units"; CM_ SG_ 480 NEW_SIGNAL_5 "todo: figure out why always set to 1"; CM_ SG_ 676 LEFT_LANE_LINE "Left lane line confidence"; @@ -820,42 +815,22 @@ CM_ SG_ 961 COUNTER_ALT "only increments on change"; CM_ SG_ 1041 COUNTER_ALT "only increments on change"; CM_ SG_ 1043 COUNTER_ALT "only increments on change"; CM_ SG_ 1043 USE_ALT_LAMP "likely 1 on cars that use alt lamp signals"; -VAL_ 53 GEAR 0 "P" 5 "D" 6 "N" 7 "R" ; -VAL_ 64 GEAR 0 "P" 5 "D" 6 "N" 7 "R" ; -VAL_ 69 GEAR 0 "P" 5 "D" 6 "N" 7 "R" ; -VAL_ 112 GEAR 0 "P" 5 "D" 6 "N" 7 "R" ; -VAL_ 80 LKA_ICON 0 "hidden" 1 "grey" 2 "green" 3 "flashing green" ; -VAL_ 80 LKA_MODE 1 "warning only" 2 "assist" 6 "off" ; +VAL_ 53 GEAR 0 "P" 5 "D" 6 "N" 7 "R"; +VAL_ 64 GEAR 0 "P" 5 "D" 6 "N" 7 "R"; +VAL_ 69 GEAR 0 "P" 5 "D" 6 "N" 7 "R"; +VAL_ 80 LKA_MODE 1 "warning only" 2 "assist" 6 "off"; +VAL_ 80 LKA_ICON 0 "hidden" 1 "grey" 2 "green" 3 "flashing green"; VAL_ 96 TRACTION_AND_STABILITY_CONTROL 0 "On" 5 "Limited" 1 "Off"; -VAL_ 234 LKA_FAULT 0 "ok" 1 "lka fault" ; -VAL_ 272 LKA_ICON 0 "hidden" 1 "grey" 2 "green" 3 "flashing green" ; -VAL_ 272 LKA_MODE 1 "warning only" 2 "assist" 6 "off" ; -VAL_ 298 LKA_ICON 0 "hidden" 1 "grey" 2 "green" 3 "flashing green" ; -VAL_ 298 LKA_MODE 1 "warning only" 2 "assist" 6 "off" ; +VAL_ 112 GEAR 0 "P" 5 "D" 6 "N" 7 "R"; +VAL_ 234 LKA_FAULT 0 "ok" 1 "lka fault"; +VAL_ 272 LKA_MODE 1 "warning only" 2 "assist" 6 "off"; +VAL_ 272 LKA_ICON 0 "hidden" 1 "grey" 2 "green" 3 "flashing green"; +VAL_ 298 LKA_MODE 1 "warning only" 2 "assist" 6 "off"; +VAL_ 298 LKA_ICON 0 "hidden" 1 "grey" 2 "green" 3 "flashing green"; VAL_ 304 PARK_BUTTON 1 "Pressed" 2 "Not Pressed"; VAL_ 304 KNOB_POSITION 1 "R" 2 "N (on R side)" 3 "Centered" 4 "N (on D side)" 5 "D"; -VAL_ 304 GEAR 1 "P" 2 "R" 3 "N" 4 "D" ; -VAL_ 352 AEB_SETTING 1 "off" 2 "warning only" 3 "active assist" ; -VAL_ 362 BLINKER_CONTROL 1 "hazards" 2 "hazards button backlight" 3 "left blinkers" 4 "right blinkers"; -VAL_ 373 ACCEnable 0 "SCC ready" 1 "SCC temp fault" 2 "SCC permanent fault" 3 "SCC permanent fault, communication issue"; -VAL_ 416 ACCMode 0 "off" 1 "enabled" 2 "driver_override" 3 "off_maybe_fault" 4 "cancelled" ; -VAL_ 426 CRUISE_BUTTONS 0 "none" 1 "res_accel" 2 "set_decel" 3 "gap_distance" 4 "pause_resume" ; -VAL_ 463 CRUISE_BUTTONS 0 "none" 1 "res_accel" 2 "set_decel" 3 "gap_distance" 4 "pause_resume" ; -VAL_ 463 RIGHT_PADDLE 0 "Not Pulled" 1 "Pulled"; -VAL_ 463 LEFT_PADDLE 0 "Not Pulled" 1 "Pulled"; -VAL_ 676 LEFT_LANE_LINE 0 "Not Detected" 1 "Low Confidence" 2 "Medium Confidence" 3 "High Confidence"; -VAL_ 676 RIGHT_LANE_LINE 0 "Not Detected" 1 "Low Confidence" 2 "Medium Confidence" 3 "High Confidence"; -VAL_ 736 MSLA_STATUS 0 "disabled" 1 "active" 2 "paused"; -VAL_ 866 LEFT_LANE_LINE 0 "Not Detected" 1 "Low Confidence" 2 "Medium Confidence" 3 "High Confidence"; -VAL_ 866 RIGHT_LANE_LINE 0 "Not Detected" 1 "Low Confidence" 2 "Medium Confidence" 3 "High Confidence"; -VAL_ 1041 DRIVER_DOOR 0 "Closed" 1 "Opened"; -VAL_ 1041 PASSENGER_DOOR 0 "Closed" 1 "Opened"; -VAL_ 1041 DRIVER_REAR_DOOR 0 "Closed" 1 "Opened"; -VAL_ 1041 PASSENGER_REAR_DOOR 0 "Closed" 1 "Opened"; -VAL_ 1041 DRIVER_SEATBELT 0 "Unlatched" 1 "Latched"; -VAL_ 1041 PASSENGER_SEATBELT 0 "Unlatched" 1 "Latched"; -VAL_ 1144 DRIVE_MODE2 3 "Set Sport" 1 "Set Normal" 2 "Set Eco"; -VAL_ 1240 DISTANCE_UNIT 1 "Miles" 0 "Kilometers"; +VAL_ 304 GEAR 1 "P" 2 "R" 3 "N" 4 "D"; +VAL_ 352 AEB_SETTING 1 "off" 2 "warning only" 3 "active assist"; VAL_ 353 FCA_ICON 0 "HIDDEN" 1 "ORANGE" 2 "RED"; VAL_ 353 FCA_ALT_ICON 0 "HIDDEN" 1 "ORANGE" 3 "RED"; VAL_ 353 LKA_ICON 0 "HIDDEN" 1 "ORANGE" 3 "GRAY" 4 "GREEN"; @@ -919,3 +894,23 @@ VAL_ 354 FAULT_LCA 0 "HIDDEN" 1 "CHECK_LANE_CHANGE_ASSIST_FUNCTION" 2 "LANE_CHAN VAL_ 354 FAULT_HDP 0 "HIDDEN" 1 "CHECK_HIGHWAY_DRIVING_PILOT_SYSTEM" 2 "HIGHWAY_DRIVING_PILOT_DISABLED_CAMERA_OBSCURED" 3 "HIGHWAY_DRIVING_PILOT_DISABLED_RADAR_BLOCKED" 4 "HIGHWAY_DRIVING_PILOT_DISABLED_LIDAR_BLOCKED"; VAL_ 354 FAULT_DAS 0 "HIDDEN" 1 "CHECK_DRIVER_ASSISTANCE_SYSTEM" 2 "DRIVER_ASSISTANCE_SYSTEM_LIMITED_CAMERA_OBSCURED" 3 "DRIVER_ASSISTANCE_SYSTEM_LIMITED_RADAR_BLOCKED" 4 "DRIVER_ASSISTANCE_SYSTEM_LIMITED_CAMERA_OBSCURED_AND_RADAR_BLOCKED"; VAL_ 354 FAULT_ESS 0 "HIDDEN" 1 "CHECK_EMERGENCY_STOPPING_FUNCTION" 2 "EMERGENCY_STOPPING_FUNCTION_DISABLED_CAMERA_OBSCURED" 3 "EMERGENCY_STOPPING_FUNCTION_DISABLED_RADAR_BLOCKED"; +VAL_ 362 BLINKER_CONTROL 1 "hazards" 2 "hazards button backlight" 3 "left blinkers" 4 "right blinkers"; +VAL_ 373 ACCEnable 0 "SCC ready" 1 "SCC temp fault" 2 "SCC permanent fault" 3 "SCC permanent fault, communication issue"; +VAL_ 416 ACCMode 0 "off" 1 "enabled" 2 "driver_override" 3 "off_maybe_fault" 4 "cancelled"; +VAL_ 426 CRUISE_BUTTONS 0 "none" 1 "res_accel" 2 "set_decel" 3 "gap_distance" 4 "pause_resume"; +VAL_ 463 CRUISE_BUTTONS 0 "none" 1 "res_accel" 2 "set_decel" 3 "gap_distance" 4 "pause_resume"; +VAL_ 463 RIGHT_PADDLE 0 "Not Pulled" 1 "Pulled"; +VAL_ 463 LEFT_PADDLE 0 "Not Pulled" 1 "Pulled"; +VAL_ 676 LEFT_LANE_LINE 0 "Not Detected" 1 "Low Confidence" 2 "Medium Confidence" 3 "High Confidence"; +VAL_ 676 RIGHT_LANE_LINE 0 "Not Detected" 1 "Low Confidence" 2 "Medium Confidence" 3 "High Confidence"; +VAL_ 736 MSLA_STATUS 0 "disabled" 1 "active" 2 "paused"; +VAL_ 866 LEFT_LANE_LINE 0 "Not Detected" 1 "Low Confidence" 2 "Medium Confidence" 3 "High Confidence"; +VAL_ 866 RIGHT_LANE_LINE 0 "Not Detected" 1 "Low Confidence" 2 "Medium Confidence" 3 "High Confidence"; +VAL_ 1041 DRIVER_DOOR 0 "Closed" 1 "Opened"; +VAL_ 1041 PASSENGER_DOOR 0 "Closed" 1 "Opened"; +VAL_ 1041 PASSENGER_SEATBELT 0 "Unlatched" 1 "Latched"; +VAL_ 1041 DRIVER_SEATBELT 0 "Unlatched" 1 "Latched"; +VAL_ 1041 DRIVER_REAR_DOOR 0 "Closed" 1 "Opened"; +VAL_ 1041 PASSENGER_REAR_DOOR 0 "Closed" 1 "Opened"; +VAL_ 1144 DRIVE_MODE2 3 "Set Sport" 1 "Set Normal" 2 "Set Eco"; +VAL_ 1240 DISTANCE_UNIT 1 "Miles" 0 "Kilometers"; From d98b239e2c1ac0efe9873edd65a1c694e31325c7 Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 12 Feb 2025 16:19:13 -0500 Subject: [PATCH 094/316] LEAD_SPEED --- opendbc/dbc/hyundai_canfd.dbc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/dbc/hyundai_canfd.dbc b/opendbc/dbc/hyundai_canfd.dbc index f3251b94863..69f3c720ade 100644 --- a/opendbc/dbc/hyundai_canfd.dbc +++ b/opendbc/dbc/hyundai_canfd.dbc @@ -428,7 +428,7 @@ BO_ 437 CCNC_0x1B5: 32 CCNC SG_ RIGHT_5 : 144|16@1- (1,0) [0|65535] "" XXX SG_ LEAD : 192|2@1+ (1,0) [0|3] "" XXX SG_ LEAD_1 : 194|6@1+ (1,0) [0|63] "" XXX - SG_ LEAD_2 : 200|11@1- (1,0) [0|4095] "" XXX + SG_ LEAD_SPEED : 200|11@1- (1,48) [0|4095] "" XXX SG_ LEAD_3 : 211|1@0+ (1,0) [0|1] "" XXX SG_ LEAD_DISTANCE : 213|11@1+ (0.1,0) [0|204.7] "m" XXX From 43e150be5fd499a45d8a30d754c0cee0e56470eb Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 12 Feb 2025 16:31:29 -0500 Subject: [PATCH 095/316] CURVATURE --- opendbc/dbc/hyundai_canfd.dbc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opendbc/dbc/hyundai_canfd.dbc b/opendbc/dbc/hyundai_canfd.dbc index 69f3c720ade..4897be2adfe 100644 --- a/opendbc/dbc/hyundai_canfd.dbc +++ b/opendbc/dbc/hyundai_canfd.dbc @@ -417,14 +417,14 @@ BO_ 437 CCNC_0x1B5: 32 CCNC SG_ LEFT_1 : 29|9@1+ (1,0) [0|511] "" XXX SG_ LEFT_2 : 38|5@1+ (1,0) [0|31] "" XXX SG_ LEFT_3 : 43|10@1- (1,0) [0|1023] "" XXX - SG_ LEFT_4 : 64|16@1- (1,0) [0|65535] "" XXX + SG_ LEFT_CURVATURE : 64|16@1- (1,0) [0|65535] "" XXX SG_ LEFT_5 : 80|16@1- (1,0) [0|65535] "" XXX SG_ RIGHT : 96|2@1+ (1,0) [0|3] "" XXX SG_ RIGHT_LDW : 99|1@0+ (1,0) [0|1] "" XXX SG_ RIGHT_1 : 101|9@1+ (1,0) [0|511] "" XXX SG_ RIGHT_2 : 110|5@1+ (1,0) [0|31] "" XXX SG_ RIGHT_3 : 115|10@1- (1,0) [0|1023] "" XXX - SG_ RIGHT_4 : 128|16@1- (1,0) [0|65535] "" XXX + SG_ RIGHT_CURVATURE : 128|16@1- (1,0) [0|65535] "" XXX SG_ RIGHT_5 : 144|16@1- (1,0) [0|65535] "" XXX SG_ LEAD : 192|2@1+ (1,0) [0|3] "" XXX SG_ LEAD_1 : 194|6@1+ (1,0) [0|63] "" XXX From 7ea99b02c61bf0f497903febb0665f9b7ec9f404 Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 13 Feb 2025 22:24:18 -0500 Subject: [PATCH 096/316] no trig --- opendbc/car/hyundai/radar_interface.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/opendbc/car/hyundai/radar_interface.py b/opendbc/car/hyundai/radar_interface.py index f91e0e28cb3..0cb8cdea8af 100644 --- a/opendbc/car/hyundai/radar_interface.py +++ b/opendbc/car/hyundai/radar_interface.py @@ -66,10 +66,9 @@ def _update(self, updated_messages): valid = msg['STATE'] in (3, 4) if valid: - azimuth = math.radians(msg['AZIMUTH']) self.pts[addr].measured = True - self.pts[addr].dRel = math.cos(azimuth) * msg['LONG_DIST'] - self.pts[addr].yRel = 0.5 * -math.sin(azimuth) * msg['LONG_DIST'] + self.pts[addr].dRel = msg['LONG_DIST'] + self.pts[addr].yRel = msg['AZIMUTH'] * 0.25 self.pts[addr].vRel = msg['REL_SPEED'] self.pts[addr].aRel = msg['REL_ACCEL'] self.pts[addr].yvRel = float('nan') From e07eee5c5cac94387e56c46fe50fb0f004838740 Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 13 Feb 2025 22:33:09 -0500 Subject: [PATCH 097/316] LAT_DIST --- opendbc/car/hyundai/radar_interface.py | 2 +- .../generator/hyundai/hyundai_canfd_radar.dbc | 128 +++++++++--------- .../generator/hyundai/hyundai_canfd_radar.py | 4 +- 3 files changed, 67 insertions(+), 67 deletions(-) diff --git a/opendbc/car/hyundai/radar_interface.py b/opendbc/car/hyundai/radar_interface.py index 0cb8cdea8af..f01550d8539 100644 --- a/opendbc/car/hyundai/radar_interface.py +++ b/opendbc/car/hyundai/radar_interface.py @@ -68,7 +68,7 @@ def _update(self, updated_messages): if valid: self.pts[addr].measured = True self.pts[addr].dRel = msg['LONG_DIST'] - self.pts[addr].yRel = msg['AZIMUTH'] * 0.25 + self.pts[addr].yRel = msg['LAT_DIST'] * 0.25 self.pts[addr].vRel = msg['REL_SPEED'] self.pts[addr].aRel = msg['REL_ACCEL'] self.pts[addr].yvRel = float('nan') diff --git a/opendbc/dbc/generator/hyundai/hyundai_canfd_radar.dbc b/opendbc/dbc/generator/hyundai/hyundai_canfd_radar.dbc index 15f6cb50398..007639b0930 100644 --- a/opendbc/dbc/generator/hyundai/hyundai_canfd_radar.dbc +++ b/opendbc/dbc/generator/hyundai/hyundai_canfd_radar.dbc @@ -48,10 +48,10 @@ BO_ 933 RADAR_TRACK_3a5: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -67,10 +67,10 @@ BO_ 934 RADAR_TRACK_3a6: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -86,10 +86,10 @@ BO_ 935 RADAR_TRACK_3a7: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -105,10 +105,10 @@ BO_ 936 RADAR_TRACK_3a8: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -124,10 +124,10 @@ BO_ 937 RADAR_TRACK_3a9: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -143,10 +143,10 @@ BO_ 938 RADAR_TRACK_3aa: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -162,10 +162,10 @@ BO_ 939 RADAR_TRACK_3ab: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -181,10 +181,10 @@ BO_ 940 RADAR_TRACK_3ac: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -200,10 +200,10 @@ BO_ 941 RADAR_TRACK_3ad: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -219,10 +219,10 @@ BO_ 942 RADAR_TRACK_3ae: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -238,10 +238,10 @@ BO_ 943 RADAR_TRACK_3af: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -257,10 +257,10 @@ BO_ 944 RADAR_TRACK_3b0: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -276,10 +276,10 @@ BO_ 945 RADAR_TRACK_3b1: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -295,10 +295,10 @@ BO_ 946 RADAR_TRACK_3b2: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -314,10 +314,10 @@ BO_ 947 RADAR_TRACK_3b3: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -333,10 +333,10 @@ BO_ 948 RADAR_TRACK_3b4: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -352,10 +352,10 @@ BO_ 949 RADAR_TRACK_3b5: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -371,10 +371,10 @@ BO_ 950 RADAR_TRACK_3b6: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -390,10 +390,10 @@ BO_ 951 RADAR_TRACK_3b7: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -409,10 +409,10 @@ BO_ 952 RADAR_TRACK_3b8: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -428,10 +428,10 @@ BO_ 953 RADAR_TRACK_3b9: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -447,10 +447,10 @@ BO_ 954 RADAR_TRACK_3ba: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -466,10 +466,10 @@ BO_ 955 RADAR_TRACK_3bb: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -485,10 +485,10 @@ BO_ 956 RADAR_TRACK_3bc: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -504,10 +504,10 @@ BO_ 957 RADAR_TRACK_3bd: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -523,10 +523,10 @@ BO_ 958 RADAR_TRACK_3be: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -542,10 +542,10 @@ BO_ 959 RADAR_TRACK_3bf: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -561,10 +561,10 @@ BO_ 960 RADAR_TRACK_3c0: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -580,10 +580,10 @@ BO_ 961 RADAR_TRACK_3c1: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -599,10 +599,10 @@ BO_ 962 RADAR_TRACK_3c2: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -618,10 +618,10 @@ BO_ 963 RADAR_TRACK_3c3: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -637,10 +637,10 @@ BO_ 964 RADAR_TRACK_3c4: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX \ No newline at end of file diff --git a/opendbc/dbc/generator/hyundai/hyundai_canfd_radar.py b/opendbc/dbc/generator/hyundai/hyundai_canfd_radar.py index c28d5b6a1f9..e974042ce9f 100755 --- a/opendbc/dbc/generator/hyundai/hyundai_canfd_radar.py +++ b/opendbc/dbc/generator/hyundai/hyundai_canfd_radar.py @@ -58,10 +58,10 @@ SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ AZIMUTH : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX """) From 3cdc786d23d891f6420648f4e8e7e16da6a856dc Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 13 Feb 2025 22:33:21 -0500 Subject: [PATCH 098/316] mathless for now --- opendbc/car/hyundai/radar_interface.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/opendbc/car/hyundai/radar_interface.py b/opendbc/car/hyundai/radar_interface.py index f01550d8539..84668feb3af 100644 --- a/opendbc/car/hyundai/radar_interface.py +++ b/opendbc/car/hyundai/radar_interface.py @@ -1,5 +1,3 @@ -import math - from opendbc.can.parser import CANParser from opendbc.car import Bus, structs from opendbc.car.interfaces import RadarInterfaceBase From 0ad7bb7ff999a97536f49e18e4c845b37da445c2 Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 13 Feb 2025 22:33:51 -0500 Subject: [PATCH 099/316] gate later --- opendbc/car/hyundai/radar_interface.py | 1 + 1 file changed, 1 insertion(+) diff --git a/opendbc/car/hyundai/radar_interface.py b/opendbc/car/hyundai/radar_interface.py index 84668feb3af..c0a89c61801 100644 --- a/opendbc/car/hyundai/radar_interface.py +++ b/opendbc/car/hyundai/radar_interface.py @@ -64,6 +64,7 @@ def _update(self, updated_messages): valid = msg['STATE'] in (3, 4) if valid: + # todo: gate for ccnc and undo changes self.pts[addr].measured = True self.pts[addr].dRel = msg['LONG_DIST'] self.pts[addr].yRel = msg['LAT_DIST'] * 0.25 From f128b83823929f05f58aa4210c71135fbd8bc69f Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 13 Feb 2025 22:57:16 -0500 Subject: [PATCH 100/316] LAT_DIST factor --- opendbc/car/hyundai/radar_interface.py | 2 +- .../generator/hyundai/hyundai_canfd_radar.dbc | 128 +++++++++--------- .../generator/hyundai/hyundai_canfd_radar.py | 4 +- 3 files changed, 67 insertions(+), 67 deletions(-) diff --git a/opendbc/car/hyundai/radar_interface.py b/opendbc/car/hyundai/radar_interface.py index c0a89c61801..5126dbc989e 100644 --- a/opendbc/car/hyundai/radar_interface.py +++ b/opendbc/car/hyundai/radar_interface.py @@ -67,7 +67,7 @@ def _update(self, updated_messages): # todo: gate for ccnc and undo changes self.pts[addr].measured = True self.pts[addr].dRel = msg['LONG_DIST'] - self.pts[addr].yRel = msg['LAT_DIST'] * 0.25 + self.pts[addr].yRel = msg['LAT_DIST'] self.pts[addr].vRel = msg['REL_SPEED'] self.pts[addr].aRel = msg['REL_ACCEL'] self.pts[addr].yvRel = float('nan') diff --git a/opendbc/dbc/generator/hyundai/hyundai_canfd_radar.dbc b/opendbc/dbc/generator/hyundai/hyundai_canfd_radar.dbc index 007639b0930..d9fa7ec0746 100644 --- a/opendbc/dbc/generator/hyundai/hyundai_canfd_radar.dbc +++ b/opendbc/dbc/generator/hyundai/hyundai_canfd_radar.dbc @@ -48,10 +48,10 @@ BO_ 933 RADAR_TRACK_3a5: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -67,10 +67,10 @@ BO_ 934 RADAR_TRACK_3a6: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -86,10 +86,10 @@ BO_ 935 RADAR_TRACK_3a7: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -105,10 +105,10 @@ BO_ 936 RADAR_TRACK_3a8: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -124,10 +124,10 @@ BO_ 937 RADAR_TRACK_3a9: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -143,10 +143,10 @@ BO_ 938 RADAR_TRACK_3aa: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -162,10 +162,10 @@ BO_ 939 RADAR_TRACK_3ab: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -181,10 +181,10 @@ BO_ 940 RADAR_TRACK_3ac: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -200,10 +200,10 @@ BO_ 941 RADAR_TRACK_3ad: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -219,10 +219,10 @@ BO_ 942 RADAR_TRACK_3ae: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -238,10 +238,10 @@ BO_ 943 RADAR_TRACK_3af: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -257,10 +257,10 @@ BO_ 944 RADAR_TRACK_3b0: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -276,10 +276,10 @@ BO_ 945 RADAR_TRACK_3b1: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -295,10 +295,10 @@ BO_ 946 RADAR_TRACK_3b2: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -314,10 +314,10 @@ BO_ 947 RADAR_TRACK_3b3: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -333,10 +333,10 @@ BO_ 948 RADAR_TRACK_3b4: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -352,10 +352,10 @@ BO_ 949 RADAR_TRACK_3b5: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -371,10 +371,10 @@ BO_ 950 RADAR_TRACK_3b6: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -390,10 +390,10 @@ BO_ 951 RADAR_TRACK_3b7: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -409,10 +409,10 @@ BO_ 952 RADAR_TRACK_3b8: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -428,10 +428,10 @@ BO_ 953 RADAR_TRACK_3b9: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -447,10 +447,10 @@ BO_ 954 RADAR_TRACK_3ba: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -466,10 +466,10 @@ BO_ 955 RADAR_TRACK_3bb: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -485,10 +485,10 @@ BO_ 956 RADAR_TRACK_3bc: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -504,10 +504,10 @@ BO_ 957 RADAR_TRACK_3bd: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -523,10 +523,10 @@ BO_ 958 RADAR_TRACK_3be: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -542,10 +542,10 @@ BO_ 959 RADAR_TRACK_3bf: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -561,10 +561,10 @@ BO_ 960 RADAR_TRACK_3c0: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -580,10 +580,10 @@ BO_ 961 RADAR_TRACK_3c1: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -599,10 +599,10 @@ BO_ 962 RADAR_TRACK_3c2: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -618,10 +618,10 @@ BO_ 963 RADAR_TRACK_3c3: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX @@ -637,10 +637,10 @@ BO_ 964 RADAR_TRACK_3c4: 24 RADAR SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX \ No newline at end of file diff --git a/opendbc/dbc/generator/hyundai/hyundai_canfd_radar.py b/opendbc/dbc/generator/hyundai/hyundai_canfd_radar.py index e974042ce9f..6159cd2b4bb 100755 --- a/opendbc/dbc/generator/hyundai/hyundai_canfd_radar.py +++ b/opendbc/dbc/generator/hyundai/hyundai_canfd_radar.py @@ -58,10 +58,10 @@ SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.2,0) [0|127] "" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ AZIMUTH : 104|13@1- (1,0) [0|8191] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX """) From 99bbaae9fe415731bc080ea7ac8d3114ff15d299 Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 13 Feb 2025 23:59:01 -0500 Subject: [PATCH 101/316] ccnc gate --- opendbc/car/hyundai/radar_interface.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/opendbc/car/hyundai/radar_interface.py b/opendbc/car/hyundai/radar_interface.py index 5126dbc989e..1252bb10e2c 100644 --- a/opendbc/car/hyundai/radar_interface.py +++ b/opendbc/car/hyundai/radar_interface.py @@ -1,3 +1,5 @@ +import math + from opendbc.can.parser import CANParser from opendbc.car import Bus, structs from opendbc.car.interfaces import RadarInterfaceBase @@ -64,10 +66,14 @@ def _update(self, updated_messages): valid = msg['STATE'] in (3, 4) if valid: - # todo: gate for ccnc and undo changes + if CP.flags & HyundaiFlags.CANFD: + self.pts[addr].dRel = msg['LONG_DIST'] + self.pts[addr].yRel = msg['LAT_DIST'] + else: + azimuth = math.radians(msg['AZIMUTH']) + self.pts[addr].dRel = math.cos(azimuth) * msg['LONG_DIST'] + self.pts[addr].yRel = 0.5 * -math.sin(azimuth) * msg['LONG_DIST'] self.pts[addr].measured = True - self.pts[addr].dRel = msg['LONG_DIST'] - self.pts[addr].yRel = msg['LAT_DIST'] self.pts[addr].vRel = msg['REL_SPEED'] self.pts[addr].aRel = msg['REL_ACCEL'] self.pts[addr].yvRel = float('nan') From d488ba9bdd21536630b52739c03e50b3ece46eac Mon Sep 17 00:00:00 2001 From: royjr Date: Fri, 14 Feb 2025 00:09:12 -0500 Subject: [PATCH 102/316] fix CP --- opendbc/car/hyundai/radar_interface.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/opendbc/car/hyundai/radar_interface.py b/opendbc/car/hyundai/radar_interface.py index 1252bb10e2c..093c40ba7cf 100644 --- a/opendbc/car/hyundai/radar_interface.py +++ b/opendbc/car/hyundai/radar_interface.py @@ -22,7 +22,8 @@ def get_radar_can_parser(CP, RADAR_START_ADDR): class RadarInterface(RadarInterfaceBase): def __init__(self, CP): super().__init__(CP) - self.RADAR_START_ADDR = RADAR_START_ADDR_CANFD if CP.flags & HyundaiFlags.CANFD else RADAR_START_ADDR_CAN + self.CP_flags = CP.flags + self.RADAR_START_ADDR = RADAR_START_ADDR_CANFD if self.CP_flags & HyundaiFlags.CANFD else RADAR_START_ADDR_CAN self.updated_messages = set() self.trigger_msg = self.RADAR_START_ADDR + RADAR_MSG_COUNT - 1 self.track_id = 0 @@ -66,7 +67,7 @@ def _update(self, updated_messages): valid = msg['STATE'] in (3, 4) if valid: - if CP.flags & HyundaiFlags.CANFD: + if self.CP.flags & HyundaiFlags.CANFD: self.pts[addr].dRel = msg['LONG_DIST'] self.pts[addr].yRel = msg['LAT_DIST'] else: From 8852aaa0800216eb2a62dd54436f2d7665b8c672 Mon Sep 17 00:00:00 2001 From: royjr Date: Sun, 16 Feb 2025 14:27:43 -0500 Subject: [PATCH 103/316] fix lead distance after scaling --- opendbc/car/hyundai/hyundaicanfd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 8082d2ffc94..b5d4cbca759 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -193,7 +193,7 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): # LEAD msg_162.update({ "LEAD": 2 if enabled and hud.leadVisible else 1 if hud.leadVisible else 0, - "LEAD_DISTANCE": 150, + "LEAD_DISTANCE": 10, }) ret.append(packer.make_can_msg("LFAHDA_CLUSTER", CAN.ECAN, lfahda_cluster)) From 924d44482fcb27a8d7be626378cf09ed1f6590de Mon Sep 17 00:00:00 2001 From: royjr Date: Mon, 17 Feb 2025 02:26:20 -0500 Subject: [PATCH 104/316] more radar, check later --- .../hyundai/hyundai_can_ev_radar.dbc | 182 ++++++ .../generator/hyundai/hyundai_can_ev_radar.py | 58 ++ .../generator/hyundai/hyundai_can_radar.dbc | 550 ++++++++++++++++++ .../generator/hyundai/hyundai_can_radar.py | 80 +++ 4 files changed, 870 insertions(+) create mode 100644 opendbc/dbc/generator/hyundai/hyundai_can_ev_radar.dbc create mode 100755 opendbc/dbc/generator/hyundai/hyundai_can_ev_radar.py create mode 100644 opendbc/dbc/generator/hyundai/hyundai_can_radar.dbc create mode 100755 opendbc/dbc/generator/hyundai/hyundai_can_radar.py diff --git a/opendbc/dbc/generator/hyundai/hyundai_can_ev_radar.dbc b/opendbc/dbc/generator/hyundai/hyundai_can_ev_radar.dbc new file mode 100644 index 00000000000..6cbab29b197 --- /dev/null +++ b/opendbc/dbc/generator/hyundai/hyundai_can_ev_radar.dbc @@ -0,0 +1,182 @@ + +VERSION "" + + +NS_ : + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + VAL_TABLE_ + SIG_GROUP_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BS_: + +BU_: XXX + +BO_ 1538 RADAR_TRACK_602: 8 RADAR + SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX + SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX + SG_ SPEED : 21|9@1- (1,0) [0|63] "" XXX + SG_ NEW_SIGNAL_3 : 31|10@1+ (1,0) [0|511] "" XXX + SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX + SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX + +BO_ 1539 RADAR_TRACK_603: 8 RADAR + SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX + SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX + SG_ SPEED : 21|9@1- (1,0) [0|63] "" XXX + SG_ NEW_SIGNAL_3 : 31|10@1+ (1,0) [0|511] "" XXX + SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX + SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX + +BO_ 1540 RADAR_TRACK_604: 8 RADAR + SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX + SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX + SG_ SPEED : 21|9@1- (1,0) [0|63] "" XXX + SG_ NEW_SIGNAL_3 : 31|10@1+ (1,0) [0|511] "" XXX + SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX + SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX + +BO_ 1541 RADAR_TRACK_605: 8 RADAR + SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX + SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX + SG_ SPEED : 21|9@1- (1,0) [0|63] "" XXX + SG_ NEW_SIGNAL_3 : 31|10@1+ (1,0) [0|511] "" XXX + SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX + SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX + +BO_ 1542 RADAR_TRACK_606: 8 RADAR + SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX + SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX + SG_ SPEED : 21|9@1- (1,0) [0|63] "" XXX + SG_ NEW_SIGNAL_3 : 31|10@1+ (1,0) [0|511] "" XXX + SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX + SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX + +BO_ 1543 RADAR_TRACK_607: 8 RADAR + SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX + SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX + SG_ SPEED : 21|9@1- (1,0) [0|63] "" XXX + SG_ NEW_SIGNAL_3 : 31|10@1+ (1,0) [0|511] "" XXX + SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX + SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX + +BO_ 1544 RADAR_TRACK_608: 8 RADAR + SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX + SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX + SG_ SPEED : 21|9@1- (1,0) [0|63] "" XXX + SG_ NEW_SIGNAL_3 : 31|10@1+ (1,0) [0|511] "" XXX + SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX + SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX + +BO_ 1545 RADAR_TRACK_609: 8 RADAR + SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX + SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX + SG_ SPEED : 21|9@1- (1,0) [0|63] "" XXX + SG_ NEW_SIGNAL_3 : 31|10@1+ (1,0) [0|511] "" XXX + SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX + SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX + +BO_ 1546 RADAR_TRACK_60a: 8 RADAR + SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX + SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX + SG_ SPEED : 21|9@1- (1,0) [0|63] "" XXX + SG_ NEW_SIGNAL_3 : 31|10@1+ (1,0) [0|511] "" XXX + SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX + SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX + +BO_ 1547 RADAR_TRACK_60b: 8 RADAR + SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX + SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX + SG_ SPEED : 21|9@1- (1,0) [0|63] "" XXX + SG_ NEW_SIGNAL_3 : 31|10@1+ (1,0) [0|511] "" XXX + SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX + SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX + +BO_ 1548 RADAR_TRACK_60c: 8 RADAR + SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX + SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX + SG_ SPEED : 21|9@1- (1,0) [0|63] "" XXX + SG_ NEW_SIGNAL_3 : 31|10@1+ (1,0) [0|511] "" XXX + SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX + SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX + +BO_ 1549 RADAR_TRACK_60d: 8 RADAR + SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX + SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX + SG_ SPEED : 21|9@1- (1,0) [0|63] "" XXX + SG_ NEW_SIGNAL_3 : 31|10@1+ (1,0) [0|511] "" XXX + SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX + SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX + +BO_ 1550 RADAR_TRACK_60e: 8 RADAR + SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX + SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX + SG_ SPEED : 21|9@1- (1,0) [0|63] "" XXX + SG_ NEW_SIGNAL_3 : 31|10@1+ (1,0) [0|511] "" XXX + SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX + SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX + +BO_ 1551 RADAR_TRACK_60f: 8 RADAR + SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX + SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX + SG_ SPEED : 21|9@1- (1,0) [0|63] "" XXX + SG_ NEW_SIGNAL_3 : 31|10@1+ (1,0) [0|511] "" XXX + SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX + SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX + +BO_ 1552 RADAR_TRACK_610: 8 RADAR + SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX + SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX + SG_ SPEED : 21|9@1- (1,0) [0|63] "" XXX + SG_ NEW_SIGNAL_3 : 31|10@1+ (1,0) [0|511] "" XXX + SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX + SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX + +BO_ 1553 RADAR_TRACK_611: 8 RADAR + SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX + SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX + SG_ SPEED : 21|9@1- (1,0) [0|63] "" XXX + SG_ NEW_SIGNAL_3 : 31|10@1+ (1,0) [0|511] "" XXX + SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX + SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX + diff --git a/opendbc/dbc/generator/hyundai/hyundai_can_ev_radar.py b/opendbc/dbc/generator/hyundai/hyundai_can_ev_radar.py new file mode 100755 index 00000000000..37fc61be34f --- /dev/null +++ b/opendbc/dbc/generator/hyundai/hyundai_can_ev_radar.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python3 +import os + +if __name__ == "__main__": + dbc_name = os.path.basename(__file__).replace(".py", ".dbc") + hyundai_path = os.path.dirname(os.path.realpath(__file__)) + with open(os.path.join(hyundai_path, dbc_name), "w", encoding='utf-8') as f: + f.write(""" +VERSION "" + + +NS_ : + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + VAL_TABLE_ + SIG_GROUP_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BS_: + +BU_: XXX + """) + + # note: 0x501/0x502 seem to be special in 0x5XX range + for a in range(0x602, 0x602 + 16): + f.write(f""" +BO_ {a} RADAR_TRACK_{a:x}: 8 RADAR + SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX + SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX + SG_ SPEED : 21|9@1- (1,0) [0|63] "" XXX + SG_ NEW_SIGNAL_3 : 31|10@1+ (1,0) [0|511] "" XXX + SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX + SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX + """) diff --git a/opendbc/dbc/generator/hyundai/hyundai_can_radar.dbc b/opendbc/dbc/generator/hyundai/hyundai_can_radar.dbc new file mode 100644 index 00000000000..812faa3304a --- /dev/null +++ b/opendbc/dbc/generator/hyundai/hyundai_can_radar.dbc @@ -0,0 +1,550 @@ + +VERSION "" + + +NS_ : + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + VAL_TABLE_ + SIG_GROUP_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BS_: + +BU_: XXX + +BO_ 528 RADAR_TRACK_210: 32 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|13@1+ (0.05,0) [0|8191] "m" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + SG_ NEW_SIGNAL_1_2 : 153|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3_2 : 156|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2_2 : 166|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256_2 : 175|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6_2 : 179|4@0+ (1,0) [0|15] "" XXX + SG_ STATE_2 : 182|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8_2 : 190|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST_2 : 191|13@1+ (0.05,0) [0|8191] "m" XXX + SG_ LAT_DIST_2 : 204|12@1- (0.05,0) [0|127] "" XXX + SG_ REL_SPEED_2 : 216|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4_2 : 231|2@0+ (1,0) [0|3] "" XXX + SG_ LAT_DIST_ACCEL_2 : 232|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL_2 : 246|10@1- (0.02,0) [0|1023] "" XXX + +BO_ 529 RADAR_TRACK_211: 32 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|13@1+ (0.05,0) [0|8191] "m" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + SG_ NEW_SIGNAL_1_2 : 153|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3_2 : 156|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2_2 : 166|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256_2 : 175|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6_2 : 179|4@0+ (1,0) [0|15] "" XXX + SG_ STATE_2 : 182|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8_2 : 190|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST_2 : 191|13@1+ (0.05,0) [0|8191] "m" XXX + SG_ LAT_DIST_2 : 204|12@1- (0.05,0) [0|127] "" XXX + SG_ REL_SPEED_2 : 216|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4_2 : 231|2@0+ (1,0) [0|3] "" XXX + SG_ LAT_DIST_ACCEL_2 : 232|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL_2 : 246|10@1- (0.02,0) [0|1023] "" XXX + +BO_ 530 RADAR_TRACK_212: 32 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|13@1+ (0.05,0) [0|8191] "m" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + SG_ NEW_SIGNAL_1_2 : 153|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3_2 : 156|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2_2 : 166|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256_2 : 175|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6_2 : 179|4@0+ (1,0) [0|15] "" XXX + SG_ STATE_2 : 182|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8_2 : 190|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST_2 : 191|13@1+ (0.05,0) [0|8191] "m" XXX + SG_ LAT_DIST_2 : 204|12@1- (0.05,0) [0|127] "" XXX + SG_ REL_SPEED_2 : 216|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4_2 : 231|2@0+ (1,0) [0|3] "" XXX + SG_ LAT_DIST_ACCEL_2 : 232|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL_2 : 246|10@1- (0.02,0) [0|1023] "" XXX + +BO_ 531 RADAR_TRACK_213: 32 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|13@1+ (0.05,0) [0|8191] "m" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + SG_ NEW_SIGNAL_1_2 : 153|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3_2 : 156|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2_2 : 166|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256_2 : 175|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6_2 : 179|4@0+ (1,0) [0|15] "" XXX + SG_ STATE_2 : 182|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8_2 : 190|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST_2 : 191|13@1+ (0.05,0) [0|8191] "m" XXX + SG_ LAT_DIST_2 : 204|12@1- (0.05,0) [0|127] "" XXX + SG_ REL_SPEED_2 : 216|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4_2 : 231|2@0+ (1,0) [0|3] "" XXX + SG_ LAT_DIST_ACCEL_2 : 232|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL_2 : 246|10@1- (0.02,0) [0|1023] "" XXX + +BO_ 532 RADAR_TRACK_214: 32 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|13@1+ (0.05,0) [0|8191] "m" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + SG_ NEW_SIGNAL_1_2 : 153|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3_2 : 156|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2_2 : 166|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256_2 : 175|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6_2 : 179|4@0+ (1,0) [0|15] "" XXX + SG_ STATE_2 : 182|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8_2 : 190|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST_2 : 191|13@1+ (0.05,0) [0|8191] "m" XXX + SG_ LAT_DIST_2 : 204|12@1- (0.05,0) [0|127] "" XXX + SG_ REL_SPEED_2 : 216|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4_2 : 231|2@0+ (1,0) [0|3] "" XXX + SG_ LAT_DIST_ACCEL_2 : 232|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL_2 : 246|10@1- (0.02,0) [0|1023] "" XXX + +BO_ 533 RADAR_TRACK_215: 32 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|13@1+ (0.05,0) [0|8191] "m" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + SG_ NEW_SIGNAL_1_2 : 153|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3_2 : 156|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2_2 : 166|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256_2 : 175|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6_2 : 179|4@0+ (1,0) [0|15] "" XXX + SG_ STATE_2 : 182|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8_2 : 190|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST_2 : 191|13@1+ (0.05,0) [0|8191] "m" XXX + SG_ LAT_DIST_2 : 204|12@1- (0.05,0) [0|127] "" XXX + SG_ REL_SPEED_2 : 216|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4_2 : 231|2@0+ (1,0) [0|3] "" XXX + SG_ LAT_DIST_ACCEL_2 : 232|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL_2 : 246|10@1- (0.02,0) [0|1023] "" XXX + +BO_ 534 RADAR_TRACK_216: 32 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|13@1+ (0.05,0) [0|8191] "m" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + SG_ NEW_SIGNAL_1_2 : 153|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3_2 : 156|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2_2 : 166|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256_2 : 175|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6_2 : 179|4@0+ (1,0) [0|15] "" XXX + SG_ STATE_2 : 182|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8_2 : 190|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST_2 : 191|13@1+ (0.05,0) [0|8191] "m" XXX + SG_ LAT_DIST_2 : 204|12@1- (0.05,0) [0|127] "" XXX + SG_ REL_SPEED_2 : 216|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4_2 : 231|2@0+ (1,0) [0|3] "" XXX + SG_ LAT_DIST_ACCEL_2 : 232|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL_2 : 246|10@1- (0.02,0) [0|1023] "" XXX + +BO_ 535 RADAR_TRACK_217: 32 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|13@1+ (0.05,0) [0|8191] "m" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + SG_ NEW_SIGNAL_1_2 : 153|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3_2 : 156|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2_2 : 166|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256_2 : 175|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6_2 : 179|4@0+ (1,0) [0|15] "" XXX + SG_ STATE_2 : 182|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8_2 : 190|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST_2 : 191|13@1+ (0.05,0) [0|8191] "m" XXX + SG_ LAT_DIST_2 : 204|12@1- (0.05,0) [0|127] "" XXX + SG_ REL_SPEED_2 : 216|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4_2 : 231|2@0+ (1,0) [0|3] "" XXX + SG_ LAT_DIST_ACCEL_2 : 232|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL_2 : 246|10@1- (0.02,0) [0|1023] "" XXX + +BO_ 536 RADAR_TRACK_218: 32 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|13@1+ (0.05,0) [0|8191] "m" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + SG_ NEW_SIGNAL_1_2 : 153|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3_2 : 156|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2_2 : 166|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256_2 : 175|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6_2 : 179|4@0+ (1,0) [0|15] "" XXX + SG_ STATE_2 : 182|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8_2 : 190|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST_2 : 191|13@1+ (0.05,0) [0|8191] "m" XXX + SG_ LAT_DIST_2 : 204|12@1- (0.05,0) [0|127] "" XXX + SG_ REL_SPEED_2 : 216|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4_2 : 231|2@0+ (1,0) [0|3] "" XXX + SG_ LAT_DIST_ACCEL_2 : 232|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL_2 : 246|10@1- (0.02,0) [0|1023] "" XXX + +BO_ 537 RADAR_TRACK_219: 32 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|13@1+ (0.05,0) [0|8191] "m" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + SG_ NEW_SIGNAL_1_2 : 153|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3_2 : 156|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2_2 : 166|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256_2 : 175|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6_2 : 179|4@0+ (1,0) [0|15] "" XXX + SG_ STATE_2 : 182|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8_2 : 190|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST_2 : 191|13@1+ (0.05,0) [0|8191] "m" XXX + SG_ LAT_DIST_2 : 204|12@1- (0.05,0) [0|127] "" XXX + SG_ REL_SPEED_2 : 216|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4_2 : 231|2@0+ (1,0) [0|3] "" XXX + SG_ LAT_DIST_ACCEL_2 : 232|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL_2 : 246|10@1- (0.02,0) [0|1023] "" XXX + +BO_ 538 RADAR_TRACK_21a: 32 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|13@1+ (0.05,0) [0|8191] "m" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + SG_ NEW_SIGNAL_1_2 : 153|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3_2 : 156|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2_2 : 166|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256_2 : 175|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6_2 : 179|4@0+ (1,0) [0|15] "" XXX + SG_ STATE_2 : 182|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8_2 : 190|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST_2 : 191|13@1+ (0.05,0) [0|8191] "m" XXX + SG_ LAT_DIST_2 : 204|12@1- (0.05,0) [0|127] "" XXX + SG_ REL_SPEED_2 : 216|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4_2 : 231|2@0+ (1,0) [0|3] "" XXX + SG_ LAT_DIST_ACCEL_2 : 232|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL_2 : 246|10@1- (0.02,0) [0|1023] "" XXX + +BO_ 539 RADAR_TRACK_21b: 32 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|13@1+ (0.05,0) [0|8191] "m" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + SG_ NEW_SIGNAL_1_2 : 153|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3_2 : 156|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2_2 : 166|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256_2 : 175|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6_2 : 179|4@0+ (1,0) [0|15] "" XXX + SG_ STATE_2 : 182|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8_2 : 190|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST_2 : 191|13@1+ (0.05,0) [0|8191] "m" XXX + SG_ LAT_DIST_2 : 204|12@1- (0.05,0) [0|127] "" XXX + SG_ REL_SPEED_2 : 216|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4_2 : 231|2@0+ (1,0) [0|3] "" XXX + SG_ LAT_DIST_ACCEL_2 : 232|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL_2 : 246|10@1- (0.02,0) [0|1023] "" XXX + +BO_ 540 RADAR_TRACK_21c: 32 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|13@1+ (0.05,0) [0|8191] "m" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + SG_ NEW_SIGNAL_1_2 : 153|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3_2 : 156|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2_2 : 166|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256_2 : 175|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6_2 : 179|4@0+ (1,0) [0|15] "" XXX + SG_ STATE_2 : 182|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8_2 : 190|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST_2 : 191|13@1+ (0.05,0) [0|8191] "m" XXX + SG_ LAT_DIST_2 : 204|12@1- (0.05,0) [0|127] "" XXX + SG_ REL_SPEED_2 : 216|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4_2 : 231|2@0+ (1,0) [0|3] "" XXX + SG_ LAT_DIST_ACCEL_2 : 232|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL_2 : 246|10@1- (0.02,0) [0|1023] "" XXX + +BO_ 541 RADAR_TRACK_21d: 32 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|13@1+ (0.05,0) [0|8191] "m" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + SG_ NEW_SIGNAL_1_2 : 153|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3_2 : 156|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2_2 : 166|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256_2 : 175|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6_2 : 179|4@0+ (1,0) [0|15] "" XXX + SG_ STATE_2 : 182|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8_2 : 190|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST_2 : 191|13@1+ (0.05,0) [0|8191] "m" XXX + SG_ LAT_DIST_2 : 204|12@1- (0.05,0) [0|127] "" XXX + SG_ REL_SPEED_2 : 216|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4_2 : 231|2@0+ (1,0) [0|3] "" XXX + SG_ LAT_DIST_ACCEL_2 : 232|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL_2 : 246|10@1- (0.02,0) [0|1023] "" XXX + +BO_ 542 RADAR_TRACK_21e: 32 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|13@1+ (0.05,0) [0|8191] "m" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + SG_ NEW_SIGNAL_1_2 : 153|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3_2 : 156|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2_2 : 166|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256_2 : 175|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6_2 : 179|4@0+ (1,0) [0|15] "" XXX + SG_ STATE_2 : 182|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8_2 : 190|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST_2 : 191|13@1+ (0.05,0) [0|8191] "m" XXX + SG_ LAT_DIST_2 : 204|12@1- (0.05,0) [0|127] "" XXX + SG_ REL_SPEED_2 : 216|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4_2 : 231|2@0+ (1,0) [0|3] "" XXX + SG_ LAT_DIST_ACCEL_2 : 232|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL_2 : 246|10@1- (0.02,0) [0|1023] "" XXX + +BO_ 543 RADAR_TRACK_21f: 32 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|13@1+ (0.05,0) [0|8191] "m" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + SG_ NEW_SIGNAL_1_2 : 153|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3_2 : 156|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2_2 : 166|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256_2 : 175|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6_2 : 179|4@0+ (1,0) [0|15] "" XXX + SG_ STATE_2 : 182|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8_2 : 190|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST_2 : 191|13@1+ (0.05,0) [0|8191] "m" XXX + SG_ LAT_DIST_2 : 204|12@1- (0.05,0) [0|127] "" XXX + SG_ REL_SPEED_2 : 216|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4_2 : 231|2@0+ (1,0) [0|3] "" XXX + SG_ LAT_DIST_ACCEL_2 : 232|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL_2 : 246|10@1- (0.02,0) [0|1023] "" XXX + \ No newline at end of file diff --git a/opendbc/dbc/generator/hyundai/hyundai_can_radar.py b/opendbc/dbc/generator/hyundai/hyundai_can_radar.py new file mode 100755 index 00000000000..491ac329f78 --- /dev/null +++ b/opendbc/dbc/generator/hyundai/hyundai_can_radar.py @@ -0,0 +1,80 @@ +#!/usr/bin/env python3 +import os + +if __name__ == "__main__": + dbc_name = os.path.basename(__file__).replace(".py", ".dbc") + hyundai_path = os.path.dirname(os.path.realpath(__file__)) + with open(os.path.join(hyundai_path, dbc_name), "w", encoding='utf-8') as f: + f.write(""" +VERSION "" + + +NS_ : + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + VAL_TABLE_ + SIG_GROUP_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BS_: + +BU_: XXX + """) + + for a in range(0x210, 0x210 + 16): + f.write(f""" +BO_ {a} RADAR_TRACK_{a:x}: 32 RADAR + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX + SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX + SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST : 63|13@1+ (0.05,0) [0|8191] "m" XXX + SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX + SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX + SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX + SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX + SG_ NEW_SIGNAL_1_2 : 153|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_3_2 : 156|2@0+ (1,0) [0|3] "" XXX + SG_ NEW_SIGNAL_2_2 : 166|7@0- (1,0) [0|127] "" XXX + SG_ COUNTER_256_2 : 175|8@0+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_6_2 : 179|4@0+ (1,0) [0|15] "" XXX + SG_ STATE_2 : 182|3@0+ (1,0) [0|7] "" XXX + SG_ NEW_SIGNAL_8_2 : 190|7@0- (1,0) [0|127] "" XXX + SG_ LONG_DIST_2 : 191|13@1+ (0.05,0) [0|8191] "m" XXX + SG_ LAT_DIST_2 : 204|12@1- (0.05,0) [0|127] "" XXX + SG_ REL_SPEED_2 : 216|14@1- (0.01,0) [0|16383] "" XXX + SG_ NEW_SIGNAL_4_2 : 231|2@0+ (1,0) [0|3] "" XXX + SG_ LAT_DIST_ACCEL_2 : 232|13@1- (1,0) [0|8191] "" XXX + SG_ REL_ACCEL_2 : 246|10@1- (0.02,0) [0|1023] "" XXX + """) From 85c17fe83009a8e6877a220a949fcb5de4e3c127 Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 18 Feb 2025 11:59:31 -0500 Subject: [PATCH 105/316] TARGET_DISTANCE --- opendbc/dbc/hyundai_canfd.dbc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/dbc/hyundai_canfd.dbc b/opendbc/dbc/hyundai_canfd.dbc index 4897be2adfe..02ad7d7b0ff 100644 --- a/opendbc/dbc/hyundai_canfd.dbc +++ b/opendbc/dbc/hyundai_canfd.dbc @@ -378,7 +378,7 @@ BO_ 416 SCC_CONTROL: 32 ADRV SG_ ZEROS_4 : 183|4@0+ (1,0) [0|63] "" XXX SG_ StopReq : 184|1@0+ (1,0) [0|1] "" XXX SG_ ZEROS_3 : 191|7@0+ (1,0) [0|127] "" XXX - SG_ NEW_SIGNAL_15 : 192|11@1+ (0.1,0) [0|204.7] "m" XXX + SG_ TARGET_DISTANCE : 192|11@1+ (0.1,0) [0|204.7] "m" XXX SG_ ZEROS_2 : 207|5@0+ (1,0) [0|63] "" XXX SG_ ZEROS : 215|48@0+ (1,0) [0|281474976710655] "" XXX From 6e8591796f41d18cd70f6b28769c699fb576bbe9 Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 18 Feb 2025 12:13:29 -0500 Subject: [PATCH 106/316] JerkUpperLimit --- opendbc/car/hyundai/hyundaicanfd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index b5d4cbca759..db6a9b2202c 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -223,7 +223,7 @@ def create_ccnc_acc_control(packer, CAN, enabled, accel_last, accel, stopping, g "aReqRaw": a_raw, "VSetDis": set_speed, "JerkLowerLimit": jerk if enabled else 1, - "JerkUpperLimit": 3.0, + "JerkUpperLimit": 0.5, "ObjValid": 0, "OBJ_STATUS": 2, From 41cbf5d145709032dd674c0b28e4882671c86f11 Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 18 Feb 2025 12:13:58 -0500 Subject: [PATCH 107/316] 0 when not enabled --- opendbc/car/hyundai/hyundaicanfd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index db6a9b2202c..397fb6ad835 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -223,7 +223,7 @@ def create_ccnc_acc_control(packer, CAN, enabled, accel_last, accel, stopping, g "aReqRaw": a_raw, "VSetDis": set_speed, "JerkLowerLimit": jerk if enabled else 1, - "JerkUpperLimit": 0.5, + "JerkUpperLimit": 0.5 if enabled else 0, "ObjValid": 0, "OBJ_STATUS": 2, From 18aeba5b3f069ebdf38f102846998385593b6e89 Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 18 Feb 2025 12:14:14 -0500 Subject: [PATCH 108/316] same here --- opendbc/car/hyundai/hyundaicanfd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 397fb6ad835..27520187ec0 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -222,7 +222,7 @@ def create_ccnc_acc_control(packer, CAN, enabled, accel_last, accel, stopping, g "aReqValue": a_val, "aReqRaw": a_raw, "VSetDis": set_speed, - "JerkLowerLimit": jerk if enabled else 1, + "JerkLowerLimit": jerk if enabled else 0, "JerkUpperLimit": 0.5 if enabled else 0, "ObjValid": 0, From 73e7541229061c349e9efad9641ef5755e16e71d Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 18 Feb 2025 12:15:08 -0500 Subject: [PATCH 109/316] JerkLowerLimit but keep jn as is for now --- opendbc/car/hyundai/hyundaicanfd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 27520187ec0..ac35d8f97d6 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -222,7 +222,7 @@ def create_ccnc_acc_control(packer, CAN, enabled, accel_last, accel, stopping, g "aReqValue": a_val, "aReqRaw": a_raw, "VSetDis": set_speed, - "JerkLowerLimit": jerk if enabled else 0, + "JerkLowerLimit": 0.5 if enabled else 0, "JerkUpperLimit": 0.5 if enabled else 0, "ObjValid": 0, From 347e6901446a3b9579b779a9a3932d66cabf68d9 Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 18 Feb 2025 12:39:25 -0500 Subject: [PATCH 110/316] simplify --- opendbc/car/hyundai/hyundaicanfd.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index ac35d8f97d6..fee62d005e3 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -203,8 +203,7 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): return ret def create_ccnc_acc_control(packer, CAN, enabled, accel_last, accel, stopping, gas_override, set_speed, hud_control, cruise_info): - jerk = 5 - jn = jerk / 50 + jn = 0.1 if not enabled or gas_override: a_val, a_raw = 0, 0 else: From 390d12fef8e5332173ff9e114b0ed6e20f506d2a Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 18 Feb 2025 12:46:01 -0500 Subject: [PATCH 111/316] move down --- opendbc/car/hyundai/hyundaicanfd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index fee62d005e3..6267713f508 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -203,11 +203,11 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): return ret def create_ccnc_acc_control(packer, CAN, enabled, accel_last, accel, stopping, gas_override, set_speed, hud_control, cruise_info): - jn = 0.1 if not enabled or gas_override: a_val, a_raw = 0, 0 else: a_raw = accel + jn = 0.1 a_val = np.clip(accel, accel_last - jn, accel_last + jn) values = {s: cruise_info[s] for s in [ From ff676ed4af9cbcd1d017c7f4f6a92d5ffe3d7d12 Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 18 Feb 2025 12:47:23 -0500 Subject: [PATCH 112/316] match JerkLowerLimit to stock avg --- opendbc/car/hyundai/hyundaicanfd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 6267713f508..a267706a894 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -221,7 +221,7 @@ def create_ccnc_acc_control(packer, CAN, enabled, accel_last, accel, stopping, g "aReqValue": a_val, "aReqRaw": a_raw, "VSetDis": set_speed, - "JerkLowerLimit": 0.5 if enabled else 0, + "JerkLowerLimit": 1.5 if enabled else 0, "JerkUpperLimit": 0.5 if enabled else 0, "ObjValid": 0, From b1f48d275a5d8285009b82499376d9881b162a54 Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 19 Feb 2025 00:20:37 -0500 Subject: [PATCH 113/316] more signals --- opendbc/dbc/hyundai_canfd.dbc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/opendbc/dbc/hyundai_canfd.dbc b/opendbc/dbc/hyundai_canfd.dbc index 02ad7d7b0ff..5fa107b053f 100644 --- a/opendbc/dbc/hyundai_canfd.dbc +++ b/opendbc/dbc/hyundai_canfd.dbc @@ -154,10 +154,11 @@ BO_ 298 LFA: 16 ADRV SG_ NEW_SIGNAL_1 : 27|2@1+ (1,0) [0|255] "" XXX SG_ LKA_WARNING : 32|1@1+ (1,0) [0|1] "" XXX SG_ LKA_ICON : 38|2@1+ (1,0) [0|255] "" XXX + SG_ NEW_SIGNAL_5 : 40|1@0+ (1,0) [0|1] "" XXX SG_ TORQUE_REQUEST : 41|11@1+ (1,-1024) [0|4095] "" XXX SG_ STEER_REQ : 52|1@1+ (1,0) [0|1] "" XXX SG_ LFA_BUTTON : 56|1@1+ (1,0) [0|255] "" XXX - SG_ LKA_ASSIST : 62|1@1+ (1,0) [0|1] "" XXX + SG_ LKA_ASSIST : 60|4@1+ (1,0) [0|15] "" XXX SG_ STEER_MODE : 65|3@1+ (1,0) [0|1] "" XXX SG_ NEW_SIGNAL_2 : 70|2@0+ (1,0) [0|3] "" XXX SG_ NEW_SIGNAL_4 : 72|4@1+ (1,0) [0|15] "" XXX @@ -484,6 +485,7 @@ BO_ 480 LFAHDA_CLUSTER: 16 ADRV SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX SG_ NEW_SIGNAL_4 : 24|1@0+ (1,0) [0|1] "" XXX SG_ NEW_SIGNAL_5 : 25|1@0+ (1,0) [0|1] "" XXX + SG_ NEW_SIGNAL_6 : 26|1@0+ (1,0) [0|1] "" XXX SG_ NEW_SIGNAL_2 : 30|1@0+ (1,0) [0|1] "" XXX SG_ HDA_ICON : 31|1@1+ (1,0) [0|1] "" XXX SG_ NEW_SIGNAL_1 : 32|3@1+ (1,0) [0|7] "" XXX From b366571509c5aa747727b69e9ef958d54d3c06f3 Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 20 Feb 2025 15:49:11 -0500 Subject: [PATCH 114/316] panda -> opendbc --- opendbc/safety/safety/safety_hyundai_canfd.h | 7 ++++++- opendbc/safety/tests/test_hyundai_canfd.py | 8 ++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/opendbc/safety/safety/safety_hyundai_canfd.h b/opendbc/safety/safety/safety_hyundai_canfd.h index b42889bb0ed..b631fb31311 100644 --- a/opendbc/safety/safety/safety_hyundai_canfd.h +++ b/opendbc/safety/safety/safety_hyundai_canfd.h @@ -215,7 +215,10 @@ static int hyundai_canfd_fwd_hook(int bus_num, int addr) { // CRUISE_INFO for non-HDA2, we send our own longitudinal commands bool is_scc_msg = ((addr == 0x1a0) && hyundai_longitudinal && !hyundai_canfd_hda2); - bool block_msg = is_lkas_msg || is_lfa_msg || is_lfahda_msg || is_scc_msg; + // CCNC messages + bool is_ccnc_msg = (addr == 0x161) || (addr == 0x162); + + bool block_msg = is_lkas_msg || is_lfa_msg || is_lfahda_msg || is_scc_msg || is_ccnc_msg; if (!block_msg) { bus_fwd = 0; } @@ -261,6 +264,8 @@ static safety_config hyundai_canfd_init(uint16_t param) { {0x1A0, 0, 32}, // CRUISE_INFO {0x1CF, 2, 8}, // CRUISE_BUTTON {0x1E0, 0, 16}, // LFAHDA_CLUSTER + {0x161, 0, 32}, // CCNC_0x161 + {0x162, 0, 32}, // CCNC_0x162 }; diff --git a/opendbc/safety/tests/test_hyundai_canfd.py b/opendbc/safety/tests/test_hyundai_canfd.py index f564a4d01c0..28832c94641 100755 --- a/opendbc/safety/tests/test_hyundai_canfd.py +++ b/opendbc/safety/tests/test_hyundai_canfd.py @@ -85,7 +85,7 @@ class TestHyundaiCanfdHDA1Base(TestHyundaiCanfdBase): TX_MSGS = [[0x12A, 0], [0x1A0, 1], [0x1CF, 0], [0x1E0, 0]] RELAY_MALFUNCTION_ADDRS = {0: (0x12A,)} # LFA - FWD_BLACKLISTED_ADDRS = {2: [0x12A, 0x1E0]} + FWD_BLACKLISTED_ADDRS = {2: [0x12A, 0x1E0, 0x161, 0x162]} FWD_BUS_LOOKUP = {0: 2, 2: 0} STEER_MSG = "LFA" @@ -170,7 +170,7 @@ class TestHyundaiCanfdHDA2EV(TestHyundaiCanfdBase): TX_MSGS = [[0x50, 0], [0x1CF, 1], [0x2A4, 0]] RELAY_MALFUNCTION_ADDRS = {0: (0x50,)} # LKAS - FWD_BLACKLISTED_ADDRS = {2: [0x50, 0x2a4]} + FWD_BLACKLISTED_ADDRS = {2: [0x50, 0x2a4, 0x161, 0x162]} FWD_BUS_LOOKUP = {0: 2, 2: 0} PT_BUS = 1 @@ -190,7 +190,7 @@ class TestHyundaiCanfdHDA2EVAltSteering(TestHyundaiCanfdBase): TX_MSGS = [[0x110, 0], [0x1CF, 1], [0x362, 0]] RELAY_MALFUNCTION_ADDRS = {0: (0x110,)} # LKAS_ALT - FWD_BLACKLISTED_ADDRS = {2: [0x110, 0x362]} + FWD_BLACKLISTED_ADDRS = {2: [0x110, 0x362, 0x161, 0x162]} FWD_BUS_LOOKUP = {0: 2, 2: 0} PT_BUS = 1 @@ -244,7 +244,7 @@ def _accel_msg(self, accel, aeb_req=False, aeb_decel=0): ]) class TestHyundaiCanfdHDA1Long(HyundaiLongitudinalBase, TestHyundaiCanfdHDA1Base): - FWD_BLACKLISTED_ADDRS = {2: [0x12a, 0x1e0, 0x1a0]} + FWD_BLACKLISTED_ADDRS = {2: [0x12a, 0x1e0, 0x1a0, 0x161, 0x162]} RELAY_MALFUNCTION_ADDRS = {0: (0x12A, 0x1a0)} # LFA, SCC_CONTROL From 6aad2ac04ea99961e198f9ed54cd4655a9161bf9 Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 20 Feb 2025 15:54:52 -0500 Subject: [PATCH 115/316] Update hyundai_can_ev_radar.dbc --- .../hyundai/hyundai_can_ev_radar.dbc | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/opendbc/dbc/generator/hyundai/hyundai_can_ev_radar.dbc b/opendbc/dbc/generator/hyundai/hyundai_can_ev_radar.dbc index 6cbab29b197..82694d01a37 100644 --- a/opendbc/dbc/generator/hyundai/hyundai_can_ev_radar.dbc +++ b/opendbc/dbc/generator/hyundai/hyundai_can_ev_radar.dbc @@ -44,7 +44,7 @@ BO_ 1538 RADAR_TRACK_602: 8 RADAR SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX - + BO_ 1539 RADAR_TRACK_603: 8 RADAR SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX @@ -53,7 +53,7 @@ BO_ 1539 RADAR_TRACK_603: 8 RADAR SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX - + BO_ 1540 RADAR_TRACK_604: 8 RADAR SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX @@ -62,7 +62,7 @@ BO_ 1540 RADAR_TRACK_604: 8 RADAR SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX - + BO_ 1541 RADAR_TRACK_605: 8 RADAR SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX @@ -71,7 +71,7 @@ BO_ 1541 RADAR_TRACK_605: 8 RADAR SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX - + BO_ 1542 RADAR_TRACK_606: 8 RADAR SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX @@ -80,7 +80,7 @@ BO_ 1542 RADAR_TRACK_606: 8 RADAR SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX - + BO_ 1543 RADAR_TRACK_607: 8 RADAR SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX @@ -89,7 +89,7 @@ BO_ 1543 RADAR_TRACK_607: 8 RADAR SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX - + BO_ 1544 RADAR_TRACK_608: 8 RADAR SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX @@ -98,7 +98,7 @@ BO_ 1544 RADAR_TRACK_608: 8 RADAR SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX - + BO_ 1545 RADAR_TRACK_609: 8 RADAR SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX @@ -107,7 +107,7 @@ BO_ 1545 RADAR_TRACK_609: 8 RADAR SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX - + BO_ 1546 RADAR_TRACK_60a: 8 RADAR SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX @@ -116,7 +116,7 @@ BO_ 1546 RADAR_TRACK_60a: 8 RADAR SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX - + BO_ 1547 RADAR_TRACK_60b: 8 RADAR SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX @@ -125,7 +125,7 @@ BO_ 1547 RADAR_TRACK_60b: 8 RADAR SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX - + BO_ 1548 RADAR_TRACK_60c: 8 RADAR SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX @@ -134,7 +134,7 @@ BO_ 1548 RADAR_TRACK_60c: 8 RADAR SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX - + BO_ 1549 RADAR_TRACK_60d: 8 RADAR SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX @@ -143,7 +143,7 @@ BO_ 1549 RADAR_TRACK_60d: 8 RADAR SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX - + BO_ 1550 RADAR_TRACK_60e: 8 RADAR SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX @@ -152,7 +152,7 @@ BO_ 1550 RADAR_TRACK_60e: 8 RADAR SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX - + BO_ 1551 RADAR_TRACK_60f: 8 RADAR SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX @@ -161,7 +161,7 @@ BO_ 1551 RADAR_TRACK_60f: 8 RADAR SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX - + BO_ 1552 RADAR_TRACK_610: 8 RADAR SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX @@ -170,7 +170,7 @@ BO_ 1552 RADAR_TRACK_610: 8 RADAR SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX - + BO_ 1553 RADAR_TRACK_611: 8 RADAR SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX @@ -179,4 +179,4 @@ BO_ 1553 RADAR_TRACK_611: 8 RADAR SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX - + \ No newline at end of file From 53acb21805dc099097e5915c9ff3cd2046c4f800 Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 22 Feb 2025 20:29:29 -0500 Subject: [PATCH 116/316] add KIA_K5_2025 route --- opendbc/car/tests/routes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/tests/routes.py b/opendbc/car/tests/routes.py index 3392b7b8ab1..1c1053bb832 100644 --- a/opendbc/car/tests/routes.py +++ b/opendbc/car/tests/routes.py @@ -171,7 +171,7 @@ class CarTestRoute(NamedTuple): CarTestRoute("68d6a96e703c00c9|2022-09-10--16-09-39", HYUNDAI.KIA_EV6), # LFA steering CarTestRoute("9b25e8c1484a1b67|2023-04-13--10-41-45", HYUNDAI.KIA_EV6), CarTestRoute("007d5e4ad9f86d13|2021-09-30--15-09-23", HYUNDAI.KIA_K5_2021), - CarTestRoute("todo", HYUNDAI.KIA_K5_2025), + CarTestRoute("c4a804b067623789/0000007c--163f831540", HYUNDAI.KIA_K5_2025), CarTestRoute("c58dfc9fc16590e0|2023-01-14--13-51-48", HYUNDAI.KIA_K5_HEV_2020), CarTestRoute("78ad5150de133637|2023-09-13--16-15-57", HYUNDAI.KIA_K8_HEV_1ST_GEN), CarTestRoute("50c6c9b85fd1ff03|2020-10-26--17-56-06", HYUNDAI.KIA_NIRO_EV), From 250d62623ed5b82aac0d4057f4b0d832ea5902c6 Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 22 Feb 2025 20:34:53 -0500 Subject: [PATCH 117/316] fix HyundaiFlags --- opendbc/car/hyundai/carcontroller.py | 4 ++-- opendbc/car/hyundai/carstate.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/opendbc/car/hyundai/carcontroller.py b/opendbc/car/hyundai/carcontroller.py index bccf24ba5bd..1949946b9c2 100644 --- a/opendbc/car/hyundai/carcontroller.py +++ b/opendbc/car/hyundai/carcontroller.py @@ -116,7 +116,7 @@ def update(self, CC, CS, now_nanos): # LFA and HDA icons if self.frame % 5 == 0 and (not lka_steering or lka_steering_long): - if self.CP.flags & HyundaiFlags.CCNC and not hda2: + if self.CP.flags & HyundaiFlags.CCNC and not lka_steering: can_sends.extend(hyundaicanfd.create_ccnc(self.packer, self.CAN, self.frame, self.CP, CC, CS)) else: can_sends.append(hyundaicanfd.create_lfahda_cluster(self.packer, self.CAN, CC.enabled)) @@ -129,7 +129,7 @@ def update(self, CC, CS, now_nanos): if lka_steering: can_sends.extend(hyundaicanfd.create_adrv_messages(self.packer, self.CAN, self.frame)) if self.frame % 2 == 0: - if self.CP.flags & HyundaiFlags.CCNC and not hda2: + if self.CP.flags & HyundaiFlags.CCNC and not lka_steering: can_sends.append(hyundaicanfd.create_ccnc_acc_control(self.packer, self.CAN, CC.enabled, self.accel_last, accel, stopping, CC.cruiseControl.override, set_speed_in_units, hud_control, CS.cruise_info)) else: diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index 12a08cc708d..ee04625e814 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -232,13 +232,13 @@ def update_canfd(self, can_parsers) -> structs.CarState: ret.steeringPressed = self.update_steering_pressed(abs(ret.steeringTorque) > self.params.STEER_THRESHOLD, 5) ret.steerFaultTemporary = cp.vl["MDPS"]["LKA_FAULT"] != 0 - if self.CP.flags & HyundaiFlags.CCNC and not self.CP.flags & HyundaiFlags.CANFD_HDA2: + if self.CP.flags & HyundaiFlags.CCNC and not self.CP.flags & HyundaiFlags.CANFD_LKA_STEERING: self.msg_161 = copy.copy(cp_cam.vl["CCNC_0x161"]) self.msg_162 = copy.copy(cp_cam.vl["CCNC_0x162"]) cp_cruise_info = cp_cam if self.CP.flags & HyundaiFlags.CANFD_CAMERA_SCC else cp self.cruise_info = copy.copy(cp_cruise_info.vl["SCC_CONTROL"]) - alt = "_ALT" if self.CP.flags & HyundaiFlags.CCNC and not self.CP.flags & HyundaiFlags.CANFD_HDA2 else "" + alt = "_ALT" if self.CP.flags & HyundaiFlags.CCNC and not self.CP.flags & HyundaiFlags.CANFD_LKA_STEERING else "" ret.leftBlinker, ret.rightBlinker = self.update_blinker_from_lamp(50, cp.vl["BLINKERS"][f"LEFT_LAMP{alt}"], cp.vl["BLINKERS"][f"RIGHT_LAMP{alt}"]) if self.CP.enableBsm: @@ -330,7 +330,7 @@ def get_can_parsers_canfd(self, CP): cam_messages += [ ("SCC_CONTROL", 50), ] - if self.CP.flags & HyundaiFlags.CCNC and not self.CP.flags & HyundaiFlags.CANFD_HDA2: + if self.CP.flags & HyundaiFlags.CCNC and not self.CP.flags & HyundaiFlags.CANFD_LKA_STEERING: cam_messages += [ ("CCNC_0x161", 20), ("CCNC_0x162", 20), From ccf325ced6d9ccffc09bfec8dc0adeb18e9e650b Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 22 Feb 2025 21:54:01 -0500 Subject: [PATCH 118/316] add HYUNDAI_TUCSON_2025 route --- opendbc/car/tests/routes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/tests/routes.py b/opendbc/car/tests/routes.py index 1c1053bb832..7e8f40cc339 100644 --- a/opendbc/car/tests/routes.py +++ b/opendbc/car/tests/routes.py @@ -140,7 +140,7 @@ class CarTestRoute(NamedTuple): CarTestRoute("fb3fd42f0baaa2f8|2022-03-30--15-25-05", HYUNDAI.HYUNDAI_TUCSON), CarTestRoute("db68bbe12250812c|2022-12-05--00-54-12", HYUNDAI.HYUNDAI_TUCSON_4TH_GEN), # 2023 CarTestRoute("36e10531feea61a4|2022-07-25--13-37-42", HYUNDAI.HYUNDAI_TUCSON_4TH_GEN), # hybrid - CarTestRoute("todo", HYUNDAI.HYUNDAI_TUCSON_2025), + CarTestRoute("1fdabac52eef67f1/00000046--b958f8057a", HYUNDAI.HYUNDAI_TUCSON_2025), CarTestRoute("5875672fc1d4bf57|2020-07-23--21-33-28", HYUNDAI.KIA_SORENTO), CarTestRoute("1d0d000db3370fd0|2023-01-04--22-28-42", HYUNDAI.KIA_SORENTO_4TH_GEN, segment=5), CarTestRoute("60380edf6d76cb45/00000004--e450afc26c", HYUNDAI.KIA_SORENTO_2024), From 7145d3b004bd678b215c6918a8a0d574fb9995a6 Mon Sep 17 00:00:00 2001 From: royjr Date: Sun, 23 Feb 2025 14:39:31 -0500 Subject: [PATCH 119/316] stop KEEP_HANDS_ON_STEERING_WHEEL by blocking MDPS --- opendbc/car/hyundai/hyundaicanfd.py | 4 +++- opendbc/safety/safety/safety_hyundai_canfd.h | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index ae14081405c..ff4fda16001 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -138,7 +138,7 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): hud = CC.hudControl # HIDE FAULTS - for f in ("FAULT_LSS", "FAULT_HDA", "FAULT_DAS", "FAULT_LFA"): + for f in ("FAULT_LSS", "FAULT_HDA", "FAULT_DAS", "FAULT_LFA", "FAULT_DAW"): msg_162[f] = 0 # HIDE ALERTS @@ -160,6 +160,8 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): if msg_161.get("SOUNDS_4") == 2 and msg_161.get("LFA_ICON") in (3, 0,): # LFA BEEPS msg_161["SOUNDS_4"] = 0 + msg_161["DAW_ICON"] = 0 # ALWAYS HIDE NOW THAT WE BLOCK MDPS + # ICONS, LANELINES msg_161.update({ "CENTERLINE": 1 if enabled else 0, diff --git a/opendbc/safety/safety/safety_hyundai_canfd.h b/opendbc/safety/safety/safety_hyundai_canfd.h index 39c18f8bb64..610c0a41654 100644 --- a/opendbc/safety/safety/safety_hyundai_canfd.h +++ b/opendbc/safety/safety/safety_hyundai_canfd.h @@ -197,7 +197,10 @@ static int hyundai_canfd_fwd_hook(int bus_num, int addr) { int bus_fwd = -1; if (bus_num == 0) { - bus_fwd = 2; + bool is_mdps_msg = (addr == 0xEA); + if (!is_mdps_msg) { + bus_fwd = 2; + } } if (bus_num == 2) { // LKAS for cars with LKAS and LFA messages, LFA for cars with no LKAS messages From 81fb5c67e60496b758567d4f3da665a9ddb50f75 Mon Sep 17 00:00:00 2001 From: royjr Date: Sun, 23 Feb 2025 17:34:56 -0500 Subject: [PATCH 120/316] disable HYUNDAI_SONATA_HEV_2024 radar for now --- opendbc/car/hyundai/values.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/values.py b/opendbc/car/hyundai/values.py index 67743bd0b1f..59d4db7e526 100644 --- a/opendbc/car/hyundai/values.py +++ b/opendbc/car/hyundai/values.py @@ -341,7 +341,7 @@ class CAR(Platforms): HYUNDAI_SONATA_HEV_2024 = HyundaiCanFDPlatformConfig( [HyundaiCarDocs("Hyundai Sonata Hybrid 2024", "All", car_parts=CarParts.common([CarHarness.hyundai_a]))], CarSpecs(mass=1616, wheelbase=2.84, steerRatio=13.27), - flags=HyundaiFlags.CCNC | HyundaiFlags.MANDO_RADAR, + flags=HyundaiFlags.CCNC, ) HYUNDAI_IONIQ_5 = HyundaiCanFDPlatformConfig( [ From 0a224d7feb343ab5d50c8f746399c9a6c1c46aa7 Mon Sep 17 00:00:00 2001 From: royjr Date: Sun, 23 Feb 2025 17:37:16 -0500 Subject: [PATCH 121/316] remove can radar stuff --- .../hyundai/hyundai_can_ev_radar.dbc | 182 ------ .../generator/hyundai/hyundai_can_ev_radar.py | 58 -- .../generator/hyundai/hyundai_can_radar.dbc | 550 ------------------ .../generator/hyundai/hyundai_can_radar.py | 80 --- 4 files changed, 870 deletions(-) delete mode 100644 opendbc/dbc/generator/hyundai/hyundai_can_ev_radar.dbc delete mode 100755 opendbc/dbc/generator/hyundai/hyundai_can_ev_radar.py delete mode 100644 opendbc/dbc/generator/hyundai/hyundai_can_radar.dbc delete mode 100755 opendbc/dbc/generator/hyundai/hyundai_can_radar.py diff --git a/opendbc/dbc/generator/hyundai/hyundai_can_ev_radar.dbc b/opendbc/dbc/generator/hyundai/hyundai_can_ev_radar.dbc deleted file mode 100644 index 82694d01a37..00000000000 --- a/opendbc/dbc/generator/hyundai/hyundai_can_ev_radar.dbc +++ /dev/null @@ -1,182 +0,0 @@ - -VERSION "" - - -NS_ : - NS_DESC_ - CM_ - BA_DEF_ - BA_ - VAL_ - CAT_DEF_ - CAT_ - FILTER - BA_DEF_DEF_ - EV_DATA_ - ENVVAR_DATA_ - SGTYPE_ - SGTYPE_VAL_ - BA_DEF_SGTYPE_ - BA_SGTYPE_ - SIG_TYPE_REF_ - VAL_TABLE_ - SIG_GROUP_ - SIG_VALTYPE_ - SIGTYPE_VALTYPE_ - BO_TX_BU_ - BA_DEF_REL_ - BA_REL_ - BA_DEF_DEF_REL_ - BU_SG_REL_ - BU_EV_REL_ - BU_BO_REL_ - SG_MUL_VAL_ - -BS_: - -BU_: XXX - -BO_ 1538 RADAR_TRACK_602: 8 RADAR - SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX - SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX - SG_ SPEED : 21|9@1- (1,0) [0|63] "" XXX - SG_ NEW_SIGNAL_3 : 31|10@1+ (1,0) [0|511] "" XXX - SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX - SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX - -BO_ 1539 RADAR_TRACK_603: 8 RADAR - SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX - SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX - SG_ SPEED : 21|9@1- (1,0) [0|63] "" XXX - SG_ NEW_SIGNAL_3 : 31|10@1+ (1,0) [0|511] "" XXX - SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX - SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX - -BO_ 1540 RADAR_TRACK_604: 8 RADAR - SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX - SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX - SG_ SPEED : 21|9@1- (1,0) [0|63] "" XXX - SG_ NEW_SIGNAL_3 : 31|10@1+ (1,0) [0|511] "" XXX - SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX - SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX - -BO_ 1541 RADAR_TRACK_605: 8 RADAR - SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX - SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX - SG_ SPEED : 21|9@1- (1,0) [0|63] "" XXX - SG_ NEW_SIGNAL_3 : 31|10@1+ (1,0) [0|511] "" XXX - SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX - SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX - -BO_ 1542 RADAR_TRACK_606: 8 RADAR - SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX - SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX - SG_ SPEED : 21|9@1- (1,0) [0|63] "" XXX - SG_ NEW_SIGNAL_3 : 31|10@1+ (1,0) [0|511] "" XXX - SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX - SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX - -BO_ 1543 RADAR_TRACK_607: 8 RADAR - SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX - SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX - SG_ SPEED : 21|9@1- (1,0) [0|63] "" XXX - SG_ NEW_SIGNAL_3 : 31|10@1+ (1,0) [0|511] "" XXX - SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX - SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX - -BO_ 1544 RADAR_TRACK_608: 8 RADAR - SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX - SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX - SG_ SPEED : 21|9@1- (1,0) [0|63] "" XXX - SG_ NEW_SIGNAL_3 : 31|10@1+ (1,0) [0|511] "" XXX - SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX - SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX - -BO_ 1545 RADAR_TRACK_609: 8 RADAR - SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX - SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX - SG_ SPEED : 21|9@1- (1,0) [0|63] "" XXX - SG_ NEW_SIGNAL_3 : 31|10@1+ (1,0) [0|511] "" XXX - SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX - SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX - -BO_ 1546 RADAR_TRACK_60a: 8 RADAR - SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX - SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX - SG_ SPEED : 21|9@1- (1,0) [0|63] "" XXX - SG_ NEW_SIGNAL_3 : 31|10@1+ (1,0) [0|511] "" XXX - SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX - SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX - -BO_ 1547 RADAR_TRACK_60b: 8 RADAR - SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX - SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX - SG_ SPEED : 21|9@1- (1,0) [0|63] "" XXX - SG_ NEW_SIGNAL_3 : 31|10@1+ (1,0) [0|511] "" XXX - SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX - SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX - -BO_ 1548 RADAR_TRACK_60c: 8 RADAR - SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX - SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX - SG_ SPEED : 21|9@1- (1,0) [0|63] "" XXX - SG_ NEW_SIGNAL_3 : 31|10@1+ (1,0) [0|511] "" XXX - SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX - SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX - -BO_ 1549 RADAR_TRACK_60d: 8 RADAR - SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX - SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX - SG_ SPEED : 21|9@1- (1,0) [0|63] "" XXX - SG_ NEW_SIGNAL_3 : 31|10@1+ (1,0) [0|511] "" XXX - SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX - SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX - -BO_ 1550 RADAR_TRACK_60e: 8 RADAR - SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX - SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX - SG_ SPEED : 21|9@1- (1,0) [0|63] "" XXX - SG_ NEW_SIGNAL_3 : 31|10@1+ (1,0) [0|511] "" XXX - SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX - SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX - -BO_ 1551 RADAR_TRACK_60f: 8 RADAR - SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX - SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX - SG_ SPEED : 21|9@1- (1,0) [0|63] "" XXX - SG_ NEW_SIGNAL_3 : 31|10@1+ (1,0) [0|511] "" XXX - SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX - SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX - -BO_ 1552 RADAR_TRACK_610: 8 RADAR - SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX - SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX - SG_ SPEED : 21|9@1- (1,0) [0|63] "" XXX - SG_ NEW_SIGNAL_3 : 31|10@1+ (1,0) [0|511] "" XXX - SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX - SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX - -BO_ 1553 RADAR_TRACK_611: 8 RADAR - SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX - SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX - SG_ SPEED : 21|9@1- (1,0) [0|63] "" XXX - SG_ NEW_SIGNAL_3 : 31|10@1+ (1,0) [0|511] "" XXX - SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX - SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX - \ No newline at end of file diff --git a/opendbc/dbc/generator/hyundai/hyundai_can_ev_radar.py b/opendbc/dbc/generator/hyundai/hyundai_can_ev_radar.py deleted file mode 100755 index 37fc61be34f..00000000000 --- a/opendbc/dbc/generator/hyundai/hyundai_can_ev_radar.py +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env python3 -import os - -if __name__ == "__main__": - dbc_name = os.path.basename(__file__).replace(".py", ".dbc") - hyundai_path = os.path.dirname(os.path.realpath(__file__)) - with open(os.path.join(hyundai_path, dbc_name), "w", encoding='utf-8') as f: - f.write(""" -VERSION "" - - -NS_ : - NS_DESC_ - CM_ - BA_DEF_ - BA_ - VAL_ - CAT_DEF_ - CAT_ - FILTER - BA_DEF_DEF_ - EV_DATA_ - ENVVAR_DATA_ - SGTYPE_ - SGTYPE_VAL_ - BA_DEF_SGTYPE_ - BA_SGTYPE_ - SIG_TYPE_REF_ - VAL_TABLE_ - SIG_GROUP_ - SIG_VALTYPE_ - SIGTYPE_VALTYPE_ - BO_TX_BU_ - BA_DEF_REL_ - BA_REL_ - BA_DEF_DEF_REL_ - BU_SG_REL_ - BU_EV_REL_ - BU_BO_REL_ - SG_MUL_VAL_ - -BS_: - -BU_: XXX - """) - - # note: 0x501/0x502 seem to be special in 0x5XX range - for a in range(0x602, 0x602 + 16): - f.write(f""" -BO_ {a} RADAR_TRACK_{a:x}: 8 RADAR - SG_ DISTANCE : 0|10@1+ (0.1,0) [-128|127] "" XXX - SG_ LATERAL : 10|10@1- (1,0) [0|511] "" XXX - SG_ SPEED : 21|9@1- (1,0) [0|63] "" XXX - SG_ NEW_SIGNAL_3 : 31|10@1+ (1,0) [0|511] "" XXX - SG_ NEW_SIGNAL_4 : 41|10@1- (1,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 52|9@1- (1,0) [0|15] "" XXX - SG_ COUNTER : 62|2@1+ (1,0) [0|3] "" XXX - """) diff --git a/opendbc/dbc/generator/hyundai/hyundai_can_radar.dbc b/opendbc/dbc/generator/hyundai/hyundai_can_radar.dbc deleted file mode 100644 index 812faa3304a..00000000000 --- a/opendbc/dbc/generator/hyundai/hyundai_can_radar.dbc +++ /dev/null @@ -1,550 +0,0 @@ - -VERSION "" - - -NS_ : - NS_DESC_ - CM_ - BA_DEF_ - BA_ - VAL_ - CAT_DEF_ - CAT_ - FILTER - BA_DEF_DEF_ - EV_DATA_ - ENVVAR_DATA_ - SGTYPE_ - SGTYPE_VAL_ - BA_DEF_SGTYPE_ - BA_SGTYPE_ - SIG_TYPE_REF_ - VAL_TABLE_ - SIG_GROUP_ - SIG_VALTYPE_ - SIGTYPE_VALTYPE_ - BO_TX_BU_ - BA_DEF_REL_ - BA_REL_ - BA_DEF_DEF_REL_ - BU_SG_REL_ - BU_EV_REL_ - BU_BO_REL_ - SG_MUL_VAL_ - -BS_: - -BU_: XXX - -BO_ 528 RADAR_TRACK_210: 32 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|13@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - SG_ NEW_SIGNAL_1_2 : 153|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3_2 : 156|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2_2 : 166|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256_2 : 175|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6_2 : 179|4@0+ (1,0) [0|15] "" XXX - SG_ STATE_2 : 182|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8_2 : 190|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST_2 : 191|13@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST_2 : 204|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED_2 : 216|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4_2 : 231|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL_2 : 232|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL_2 : 246|10@1- (0.02,0) [0|1023] "" XXX - -BO_ 529 RADAR_TRACK_211: 32 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|13@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - SG_ NEW_SIGNAL_1_2 : 153|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3_2 : 156|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2_2 : 166|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256_2 : 175|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6_2 : 179|4@0+ (1,0) [0|15] "" XXX - SG_ STATE_2 : 182|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8_2 : 190|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST_2 : 191|13@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST_2 : 204|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED_2 : 216|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4_2 : 231|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL_2 : 232|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL_2 : 246|10@1- (0.02,0) [0|1023] "" XXX - -BO_ 530 RADAR_TRACK_212: 32 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|13@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - SG_ NEW_SIGNAL_1_2 : 153|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3_2 : 156|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2_2 : 166|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256_2 : 175|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6_2 : 179|4@0+ (1,0) [0|15] "" XXX - SG_ STATE_2 : 182|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8_2 : 190|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST_2 : 191|13@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST_2 : 204|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED_2 : 216|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4_2 : 231|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL_2 : 232|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL_2 : 246|10@1- (0.02,0) [0|1023] "" XXX - -BO_ 531 RADAR_TRACK_213: 32 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|13@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - SG_ NEW_SIGNAL_1_2 : 153|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3_2 : 156|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2_2 : 166|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256_2 : 175|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6_2 : 179|4@0+ (1,0) [0|15] "" XXX - SG_ STATE_2 : 182|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8_2 : 190|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST_2 : 191|13@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST_2 : 204|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED_2 : 216|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4_2 : 231|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL_2 : 232|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL_2 : 246|10@1- (0.02,0) [0|1023] "" XXX - -BO_ 532 RADAR_TRACK_214: 32 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|13@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - SG_ NEW_SIGNAL_1_2 : 153|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3_2 : 156|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2_2 : 166|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256_2 : 175|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6_2 : 179|4@0+ (1,0) [0|15] "" XXX - SG_ STATE_2 : 182|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8_2 : 190|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST_2 : 191|13@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST_2 : 204|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED_2 : 216|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4_2 : 231|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL_2 : 232|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL_2 : 246|10@1- (0.02,0) [0|1023] "" XXX - -BO_ 533 RADAR_TRACK_215: 32 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|13@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - SG_ NEW_SIGNAL_1_2 : 153|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3_2 : 156|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2_2 : 166|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256_2 : 175|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6_2 : 179|4@0+ (1,0) [0|15] "" XXX - SG_ STATE_2 : 182|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8_2 : 190|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST_2 : 191|13@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST_2 : 204|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED_2 : 216|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4_2 : 231|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL_2 : 232|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL_2 : 246|10@1- (0.02,0) [0|1023] "" XXX - -BO_ 534 RADAR_TRACK_216: 32 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|13@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - SG_ NEW_SIGNAL_1_2 : 153|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3_2 : 156|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2_2 : 166|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256_2 : 175|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6_2 : 179|4@0+ (1,0) [0|15] "" XXX - SG_ STATE_2 : 182|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8_2 : 190|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST_2 : 191|13@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST_2 : 204|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED_2 : 216|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4_2 : 231|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL_2 : 232|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL_2 : 246|10@1- (0.02,0) [0|1023] "" XXX - -BO_ 535 RADAR_TRACK_217: 32 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|13@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - SG_ NEW_SIGNAL_1_2 : 153|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3_2 : 156|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2_2 : 166|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256_2 : 175|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6_2 : 179|4@0+ (1,0) [0|15] "" XXX - SG_ STATE_2 : 182|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8_2 : 190|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST_2 : 191|13@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST_2 : 204|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED_2 : 216|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4_2 : 231|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL_2 : 232|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL_2 : 246|10@1- (0.02,0) [0|1023] "" XXX - -BO_ 536 RADAR_TRACK_218: 32 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|13@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - SG_ NEW_SIGNAL_1_2 : 153|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3_2 : 156|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2_2 : 166|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256_2 : 175|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6_2 : 179|4@0+ (1,0) [0|15] "" XXX - SG_ STATE_2 : 182|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8_2 : 190|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST_2 : 191|13@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST_2 : 204|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED_2 : 216|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4_2 : 231|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL_2 : 232|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL_2 : 246|10@1- (0.02,0) [0|1023] "" XXX - -BO_ 537 RADAR_TRACK_219: 32 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|13@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - SG_ NEW_SIGNAL_1_2 : 153|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3_2 : 156|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2_2 : 166|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256_2 : 175|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6_2 : 179|4@0+ (1,0) [0|15] "" XXX - SG_ STATE_2 : 182|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8_2 : 190|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST_2 : 191|13@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST_2 : 204|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED_2 : 216|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4_2 : 231|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL_2 : 232|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL_2 : 246|10@1- (0.02,0) [0|1023] "" XXX - -BO_ 538 RADAR_TRACK_21a: 32 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|13@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - SG_ NEW_SIGNAL_1_2 : 153|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3_2 : 156|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2_2 : 166|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256_2 : 175|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6_2 : 179|4@0+ (1,0) [0|15] "" XXX - SG_ STATE_2 : 182|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8_2 : 190|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST_2 : 191|13@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST_2 : 204|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED_2 : 216|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4_2 : 231|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL_2 : 232|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL_2 : 246|10@1- (0.02,0) [0|1023] "" XXX - -BO_ 539 RADAR_TRACK_21b: 32 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|13@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - SG_ NEW_SIGNAL_1_2 : 153|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3_2 : 156|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2_2 : 166|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256_2 : 175|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6_2 : 179|4@0+ (1,0) [0|15] "" XXX - SG_ STATE_2 : 182|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8_2 : 190|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST_2 : 191|13@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST_2 : 204|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED_2 : 216|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4_2 : 231|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL_2 : 232|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL_2 : 246|10@1- (0.02,0) [0|1023] "" XXX - -BO_ 540 RADAR_TRACK_21c: 32 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|13@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - SG_ NEW_SIGNAL_1_2 : 153|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3_2 : 156|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2_2 : 166|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256_2 : 175|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6_2 : 179|4@0+ (1,0) [0|15] "" XXX - SG_ STATE_2 : 182|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8_2 : 190|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST_2 : 191|13@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST_2 : 204|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED_2 : 216|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4_2 : 231|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL_2 : 232|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL_2 : 246|10@1- (0.02,0) [0|1023] "" XXX - -BO_ 541 RADAR_TRACK_21d: 32 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|13@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - SG_ NEW_SIGNAL_1_2 : 153|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3_2 : 156|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2_2 : 166|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256_2 : 175|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6_2 : 179|4@0+ (1,0) [0|15] "" XXX - SG_ STATE_2 : 182|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8_2 : 190|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST_2 : 191|13@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST_2 : 204|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED_2 : 216|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4_2 : 231|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL_2 : 232|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL_2 : 246|10@1- (0.02,0) [0|1023] "" XXX - -BO_ 542 RADAR_TRACK_21e: 32 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|13@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - SG_ NEW_SIGNAL_1_2 : 153|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3_2 : 156|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2_2 : 166|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256_2 : 175|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6_2 : 179|4@0+ (1,0) [0|15] "" XXX - SG_ STATE_2 : 182|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8_2 : 190|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST_2 : 191|13@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST_2 : 204|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED_2 : 216|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4_2 : 231|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL_2 : 232|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL_2 : 246|10@1- (0.02,0) [0|1023] "" XXX - -BO_ 543 RADAR_TRACK_21f: 32 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|13@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - SG_ NEW_SIGNAL_1_2 : 153|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3_2 : 156|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2_2 : 166|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256_2 : 175|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6_2 : 179|4@0+ (1,0) [0|15] "" XXX - SG_ STATE_2 : 182|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8_2 : 190|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST_2 : 191|13@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST_2 : 204|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED_2 : 216|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4_2 : 231|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL_2 : 232|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL_2 : 246|10@1- (0.02,0) [0|1023] "" XXX - \ No newline at end of file diff --git a/opendbc/dbc/generator/hyundai/hyundai_can_radar.py b/opendbc/dbc/generator/hyundai/hyundai_can_radar.py deleted file mode 100755 index 491ac329f78..00000000000 --- a/opendbc/dbc/generator/hyundai/hyundai_can_radar.py +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/env python3 -import os - -if __name__ == "__main__": - dbc_name = os.path.basename(__file__).replace(".py", ".dbc") - hyundai_path = os.path.dirname(os.path.realpath(__file__)) - with open(os.path.join(hyundai_path, dbc_name), "w", encoding='utf-8') as f: - f.write(""" -VERSION "" - - -NS_ : - NS_DESC_ - CM_ - BA_DEF_ - BA_ - VAL_ - CAT_DEF_ - CAT_ - FILTER - BA_DEF_DEF_ - EV_DATA_ - ENVVAR_DATA_ - SGTYPE_ - SGTYPE_VAL_ - BA_DEF_SGTYPE_ - BA_SGTYPE_ - SIG_TYPE_REF_ - VAL_TABLE_ - SIG_GROUP_ - SIG_VALTYPE_ - SIGTYPE_VALTYPE_ - BO_TX_BU_ - BA_DEF_REL_ - BA_REL_ - BA_DEF_DEF_REL_ - BU_SG_REL_ - BU_EV_REL_ - BU_BO_REL_ - SG_MUL_VAL_ - -BS_: - -BU_: XXX - """) - - for a in range(0x210, 0x210 + 16): - f.write(f""" -BO_ {a} RADAR_TRACK_{a:x}: 32 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|13@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - SG_ NEW_SIGNAL_1_2 : 153|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3_2 : 156|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2_2 : 166|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256_2 : 175|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6_2 : 179|4@0+ (1,0) [0|15] "" XXX - SG_ STATE_2 : 182|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8_2 : 190|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST_2 : 191|13@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST_2 : 204|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED_2 : 216|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4_2 : 231|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL_2 : 232|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL_2 : 246|10@1- (0.02,0) [0|1023] "" XXX - """) From 88ac50576cd06c30d76836d9f9363764ef1ceb70 Mon Sep 17 00:00:00 2001 From: royjr Date: Sun, 23 Feb 2025 17:45:14 -0500 Subject: [PATCH 122/316] updates years --- opendbc/car/hyundai/values.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/opendbc/car/hyundai/values.py b/opendbc/car/hyundai/values.py index 59d4db7e526..7b7d1115934 100644 --- a/opendbc/car/hyundai/values.py +++ b/opendbc/car/hyundai/values.py @@ -244,7 +244,7 @@ class CAR(Platforms): flags=HyundaiFlags.CLUSTER_GEARS | HyundaiFlags.ALT_LIMITS, ) HYUNDAI_KONA_2ND_GEN = HyundaiCanFDPlatformConfig( - [HyundaiCarDocs("Hyundai Kona 2024", car_parts=CarParts.common([CarHarness.hyundai_l]))], + [HyundaiCarDocs("Hyundai Kona 2024-25", car_parts=CarParts.common([CarHarness.hyundai_l]))], CarSpecs(mass=1590, wheelbase=2.66, steerRatio=13.6, tireStiffnessFactor=0.385), flags=HyundaiFlags.CCNC, ) @@ -298,7 +298,7 @@ class CAR(Platforms): flags=HyundaiFlags.MANDO_RADAR | HyundaiFlags.CHECKSUM_CRC8, ) HYUNDAI_SONATA_2024 = HyundaiCanFDPlatformConfig( - [HyundaiCarDocs("Hyundai Sonata 2024", "All", car_parts=CarParts.common([CarHarness.hyundai_a]))], + [HyundaiCarDocs("Hyundai Sonata 2024-25", "All", car_parts=CarParts.common([CarHarness.hyundai_a]))], CarSpecs(mass=1556, wheelbase=2.84, steerRatio=12.81), flags=HyundaiFlags.CCNC, ) @@ -339,7 +339,7 @@ class CAR(Platforms): flags=HyundaiFlags.MANDO_RADAR | HyundaiFlags.CHECKSUM_CRC8 | HyundaiFlags.HYBRID, ) HYUNDAI_SONATA_HEV_2024 = HyundaiCanFDPlatformConfig( - [HyundaiCarDocs("Hyundai Sonata Hybrid 2024", "All", car_parts=CarParts.common([CarHarness.hyundai_a]))], + [HyundaiCarDocs("Hyundai Sonata Hybrid 2024-25", "All", car_parts=CarParts.common([CarHarness.hyundai_a]))], CarSpecs(mass=1616, wheelbase=2.84, steerRatio=13.27), flags=HyundaiFlags.CCNC, ) @@ -504,7 +504,7 @@ class CAR(Platforms): flags=HyundaiFlags.RADAR_SCC, ) KIA_SORENTO_2024 = HyundaiCanFDPlatformConfig( - [HyundaiCarDocs("Kia Sorento 2024", car_parts=CarParts.common([CarHarness.hyundai_a]))], + [HyundaiCarDocs("Kia Sorento 2024-25", car_parts=CarParts.common([CarHarness.hyundai_a]))], CarSpecs(mass=3957 * CV.LB_TO_KG, wheelbase=2.81, steerRatio=13.5), flags=HyundaiFlags.CCNC, ) From 82f32e805bb89cc35120bcc6239728e64a2d1c29 Mon Sep 17 00:00:00 2001 From: royjr Date: Sun, 23 Feb 2025 17:46:42 -0500 Subject: [PATCH 123/316] do we need LFAHDA_CLUSTER? --- opendbc/car/hyundai/hyundaicanfd.py | 1 + 1 file changed, 1 insertion(+) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index ff4fda16001..ec14541c3ab 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -172,6 +172,7 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): }) # LFAHDA_CLUSTER + # todo: do we need this? lfahda_cluster = { "NEW_SIGNAL_5": 1, "LFA_ICON": 2 if enabled else 0, From bf8c76da671994eda5ee0dc2e31645a809f14b40 Mon Sep 17 00:00:00 2001 From: royjr Date: Sun, 23 Feb 2025 17:48:46 -0500 Subject: [PATCH 124/316] sort fp --- opendbc/car/hyundai/fingerprints.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opendbc/car/hyundai/fingerprints.py b/opendbc/car/hyundai/fingerprints.py index b477b03da80..0b0823d0022 100644 --- a/opendbc/car/hyundai/fingerprints.py +++ b/opendbc/car/hyundai/fingerprints.py @@ -202,8 +202,8 @@ }, CAR.HYUNDAI_SONATA_2024: { (Ecu.fwdCamera, 0x7c4, None): [ - b'\xf1\x00DN8 MFC AT USA LHD 1.00 1.01 99211-L1800 230512', b'\xf1\x00DN8 MFC AT KOR LHD 1.00 1.01 99211-L1800 230512', + b'\xf1\x00DN8 MFC AT USA LHD 1.00 1.01 99211-L1800 230512', ], (Ecu.fwdRadar, 0x7d0, None): [ b'\xf1\x00DN8_ RDR ----- 1.00 1.00 99110-L1800 ', @@ -990,8 +990,8 @@ }, CAR.HYUNDAI_SONATA_HEV_2024: { (Ecu.fwdCamera, 0x7c4, None): [ - b'\xf1\x00DN8HMFC AT USA LHD 1.00 1.01 99211-L1800 230512', b'\xf1\x00DN8HMFC AT KOR LHD 1.00 1.01 99211-L1800 230512', + b'\xf1\x00DN8HMFC AT USA LHD 1.00 1.01 99211-L1800 230512', ], (Ecu.fwdRadar, 0x7d0, None): [ b'\xf1\x00DN8_ RDR ----- 1.00 1.00 99110-L1800 ', From 94b78677f9bdd17719452bd9af82db5b30d4917c Mon Sep 17 00:00:00 2001 From: royjr Date: Sun, 23 Feb 2025 18:00:54 -0500 Subject: [PATCH 125/316] fix KEEP_HANDS_ON_STEERING_WHEEL tests --- opendbc/safety/tests/test_hyundai_canfd.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/opendbc/safety/tests/test_hyundai_canfd.py b/opendbc/safety/tests/test_hyundai_canfd.py index 2a49b00e5d7..121d990439d 100755 --- a/opendbc/safety/tests/test_hyundai_canfd.py +++ b/opendbc/safety/tests/test_hyundai_canfd.py @@ -14,7 +14,7 @@ class TestHyundaiCanfdBase(HyundaiButtonBase, common.PandaCarSafetyTest, common. TX_MSGS = [[0x50, 0], [0x1CF, 1], [0x2A4, 0]] STANDSTILL_THRESHOLD = 12 # 0.375 kph - FWD_BLACKLISTED_ADDRS = {2: [0x50, 0x2a4]} + FWD_BLACKLISTED_ADDRS = {2: [0x50, 0x2a4], 0: [0xea]} FWD_BUS_LOOKUP = {0: 2, 2: 0} MAX_RATE_UP = 2 @@ -85,7 +85,7 @@ class TestHyundaiCanfdLFASteeringBase(TestHyundaiCanfdBase): TX_MSGS = [[0x12A, 0], [0x1A0, 1], [0x1CF, 0], [0x1E0, 0]] RELAY_MALFUNCTION_ADDRS = {0: (0x12A,)} # LFA - FWD_BLACKLISTED_ADDRS = {2: [0x12A, 0x1E0, 0x161, 0x162]} + FWD_BLACKLISTED_ADDRS = {2: [0x12A, 0x1E0, 0x161, 0x162], 0: [0xea]} FWD_BUS_LOOKUP = {0: 2, 2: 0} STEER_MSG = "LFA" @@ -170,7 +170,7 @@ class TestHyundaiCanfdLKASteeringEV(TestHyundaiCanfdBase): TX_MSGS = [[0x50, 0], [0x1CF, 1], [0x2A4, 0]] RELAY_MALFUNCTION_ADDRS = {0: (0x50,)} # LKAS - FWD_BLACKLISTED_ADDRS = {2: [0x50, 0x2a4, 0x161, 0x162]} + FWD_BLACKLISTED_ADDRS = {2: [0x50, 0x2a4, 0x161, 0x162], 0: [0xea]} FWD_BUS_LOOKUP = {0: 2, 2: 0} PT_BUS = 1 @@ -190,7 +190,7 @@ class TestHyundaiCanfdLKASteeringAltEV(TestHyundaiCanfdBase): TX_MSGS = [[0x110, 0], [0x1CF, 1], [0x362, 0]] RELAY_MALFUNCTION_ADDRS = {0: (0x110,)} # LKAS_ALT - FWD_BLACKLISTED_ADDRS = {2: [0x110, 0x362, 0x161, 0x162]} + FWD_BLACKLISTED_ADDRS = {2: [0x110, 0x362, 0x161, 0x162], 0: [0xea]} FWD_BUS_LOOKUP = {0: 2, 2: 0} PT_BUS = 1 @@ -244,7 +244,7 @@ def _accel_msg(self, accel, aeb_req=False, aeb_decel=0): ]) class TestHyundaiCanfdLFASteeringLong(HyundaiLongitudinalBase, TestHyundaiCanfdLFASteeringBase): - FWD_BLACKLISTED_ADDRS = {2: [0x12a, 0x1e0, 0x1a0, 0x161, 0x162]} + FWD_BLACKLISTED_ADDRS = {2: [0x12a, 0x1e0, 0x1a0, 0x161, 0x162], 0: [0xea]} RELAY_MALFUNCTION_ADDRS = {0: (0x12A, 0x1a0)} # LFA, SCC_CONTROL From 3525b89c08234c5803f6369a886b382b94d2d518 Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 27 Feb 2025 16:13:05 -0500 Subject: [PATCH 126/316] stock steer for now --- opendbc/car/hyundai/hyundaicanfd.py | 40 ++++++++++++++--------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index ec14541c3ab..b7b5c92aa7f 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -39,26 +39,26 @@ def create_steering_messages(packer, CP, CAN, enabled, lat_active, apply_steer): ret = [] - if CP.flags & HyundaiFlags.CCNC: - values = { - "NEW_SIGNAL_1": 3 if lat_active else 1, - "TORQUE_REQUEST": apply_steer, - "STEER_REQ": 1 if lat_active else 0, - "NEW_SIGNAL_4": 9, - "NEW_SIGNAL_3": 10 if lat_active else 100, # TODO: value between 10-32+ sometimes - } - else: - values = { - "LKA_MODE": 2, - "LKA_ICON": 2 if enabled else 1, - "TORQUE_REQUEST": apply_steer, - "LKA_ASSIST": 0, - "STEER_REQ": 1 if lat_active else 0, - "STEER_MODE": 0, - "HAS_LANE_SAFETY": 0, # hide LKAS settings - "NEW_SIGNAL_1": 0, - "NEW_SIGNAL_2": 0, - } + # if CP.flags & HyundaiFlags.CCNC: + # values = { + # "NEW_SIGNAL_1": 3 if lat_active else 1, + # "TORQUE_REQUEST": apply_steer, + # "STEER_REQ": 1 if lat_active else 0, + # "NEW_SIGNAL_4": 9, + # "NEW_SIGNAL_3": 10 if lat_active else 100, # TODO: value between 10-32+ sometimes + # } + # else: + values = { + "LKA_MODE": 2, + "LKA_ICON": 2 if enabled else 1, + "TORQUE_REQUEST": apply_steer, + "LKA_ASSIST": 0, + "STEER_REQ": 1 if lat_active else 0, + "STEER_MODE": 0, + "HAS_LANE_SAFETY": 0, # hide LKAS settings + "NEW_SIGNAL_1": 0, + "NEW_SIGNAL_2": 0, + } if CP.flags & HyundaiFlags.CANFD_LKA_STEERING: lkas_msg = "LKAS_ALT" if CP.flags & HyundaiFlags.CANFD_LKA_STEERING_ALT else "LKAS" From dfa629c95bad6ab12942f28fcbb2d472fa28c34d Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 27 Feb 2025 23:24:17 -0500 Subject: [PATCH 127/316] use exisitng tucson value --- opendbc/car/torque_data/override.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/torque_data/override.toml b/opendbc/car/torque_data/override.toml index 804c59feb40..bcd632501ff 100644 --- a/opendbc/car/torque_data/override.toml +++ b/opendbc/car/torque_data/override.toml @@ -80,7 +80,7 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"] "HYUNDAI_KONA_2ND_GEN" = [2.5, 2.5, 0.1] "KIA_SORENTO_2024" = [2.5, 2.5, 0.1] "KIA_K5_2025" = [2.5, 2.5, 0.1] -"HYUNDAI_TUCSON_2025" = [2.5, 2.5, 0.1] +"HYUNDAI_TUCSON_2025" = [2.960174, 2.860284, 0.108745] # Dashcam or fallback configured as ideal car "MOCK" = [10.0, 10, 0.0] From 040015e4900070b37a6b1866e0d1d7bad7ba3708 Mon Sep 17 00:00:00 2001 From: royjr Date: Fri, 28 Feb 2025 00:10:20 -0500 Subject: [PATCH 128/316] not sure if needed --- opendbc/safety/safety/safety_hyundai_canfd.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/opendbc/safety/safety/safety_hyundai_canfd.h b/opendbc/safety/safety/safety_hyundai_canfd.h index 700b8fda172..4e5b5ca1dc4 100644 --- a/opendbc/safety/safety/safety_hyundai_canfd.h +++ b/opendbc/safety/safety/safety_hyundai_canfd.h @@ -283,6 +283,8 @@ static safety_config hyundai_canfd_init(uint16_t param) { HYUNDAI_CANFD_SCC_CONTROL_COMMON_TX_MSGS(0) {0x160, 0, 16}, // ADRV_0x160 {0x7D0, 0, 8}, // tester present for radar ECU disable + {0x161, 0, 32}, // CCNC_0x161 + {0x162, 0, 32}, // CCNC_0x162 }; static const CanMsg HYUNDAI_CANFD_LFA_STEERING_CAMERA_SCC_TX_MSGS[] = { @@ -290,6 +292,8 @@ static safety_config hyundai_canfd_init(uint16_t param) { HYUNDAI_CANFD_LFA_STEERING_COMMON_TX_MSGS(0) HYUNDAI_CANFD_SCC_CONTROL_COMMON_TX_MSGS(0) {0x160, 0, 16}, // ADRV_0x160 + {0x161, 0, 32}, // CCNC_0x161 + {0x162, 0, 32}, // CCNC_0x162 }; hyundai_common_init(param); From b5ebefdd29835c24c97e09d6afdcb2f255adb298 Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 1 Mar 2025 14:46:11 -0500 Subject: [PATCH 129/316] just be normal --- opendbc/car/hyundai/hyundaicanfd.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index ea30d896193..a4eefbeeac8 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -37,15 +37,6 @@ def CAM(self): def create_steering_messages(packer, CP, CAN, enabled, lat_active, apply_torque): - # if CP.flags & HyundaiFlags.CCNC: - # values = { - # "NEW_SIGNAL_1": 3 if lat_active else 1, - # "TORQUE_REQUEST": apply_steer, - # "STEER_REQ": 1 if lat_active else 0, - # "NEW_SIGNAL_4": 9, - # "NEW_SIGNAL_3": 10 if lat_active else 100, # TODO: value between 10-32+ sometimes - # } - # else: common_values = { "LKA_MODE": 2, "LKA_ICON": 2 if enabled else 1, From 994cf3a2f59e234254ade61db22202bd94de8c31 Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 1 Mar 2025 16:13:00 -0500 Subject: [PATCH 130/316] remove LFAHDA_CLUSTER --- opendbc/car/hyundai/hyundaicanfd.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index a4eefbeeac8..911dc43eb62 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -166,13 +166,6 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): "LKA_ICON": 0, }) - # LFAHDA_CLUSTER - # todo: do we need this? - lfahda_cluster = { - "NEW_SIGNAL_5": 1, - "LFA_ICON": 2 if enabled else 0, - } - # OP LONG if CP.openpilotLongitudinalControl: @@ -194,7 +187,6 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): "LEAD_DISTANCE": 10, }) - ret.append(packer.make_can_msg("LFAHDA_CLUSTER", CAN.ECAN, lfahda_cluster)) ret.append(packer.make_can_msg("CCNC_0x161", CAN.ECAN, msg_161)) ret.append(packer.make_can_msg("CCNC_0x162", CAN.ECAN, msg_162)) From b4e7e2dfc27cacf3001258274ca1d0ecb1e37dd2 Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 1 Mar 2025 16:13:34 -0500 Subject: [PATCH 131/316] deredun DAW_ICON --- opendbc/car/hyundai/hyundaicanfd.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 911dc43eb62..2e05aafacf4 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -150,13 +150,12 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): msg_161["ALERTS_5"] = 0 if msg_161.get("ALERTS_2") == 5: # CONSIDER_TAKING_A_BREAK - msg_161.update({"ALERTS_2": 0, "SOUNDS_2": 0, "DAW_ICON": 0}) + msg_161.update({"ALERTS_2": 0, "SOUNDS_2": 0}) + msg_161["DAW_ICON"] = 0 # ALWAYS HIDE NOW THAT WE BLOCK MDPS if msg_161.get("SOUNDS_4") == 2 and msg_161.get("LFA_ICON") in (3, 0,): # LFA BEEPS msg_161["SOUNDS_4"] = 0 - msg_161["DAW_ICON"] = 0 # ALWAYS HIDE NOW THAT WE BLOCK MDPS - # ICONS, LANELINES msg_161.update({ "CENTERLINE": 1 if enabled else 0, From 5c2e09fae11bcc033645b6892f2908a4732a7fb6 Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 1 Mar 2025 16:13:50 -0500 Subject: [PATCH 132/316] show orange FCA_ICON on op long --- opendbc/car/hyundai/hyundaicanfd.py | 1 + 1 file changed, 1 insertion(+) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 2e05aafacf4..883d0b528ec 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -178,6 +178,7 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): "DISTANCE_LEAD": 2 if enabled and hud.leadVisible else 1 if enabled else 0, "DISTANCE_CAR": 2 if enabled else 1, "ALERTS_3": hud.leadDistanceBars + 6, + "FCA_ICON": 1, }) # LEAD From fc1c7297320b925c2cdc05a4e84f6d8a04de0794 Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 1 Mar 2025 16:33:15 -0500 Subject: [PATCH 133/316] dont send this since we use 161 --- opendbc/car/hyundai/carcontroller.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/opendbc/car/hyundai/carcontroller.py b/opendbc/car/hyundai/carcontroller.py index f2c9593a28e..ba50ddb767c 100644 --- a/opendbc/car/hyundai/carcontroller.py +++ b/opendbc/car/hyundai/carcontroller.py @@ -126,10 +126,11 @@ def update(self, CC, CS, now_nanos): can_sends.extend(hyundaicanfd.create_spas_messages(self.packer, self.CAN, self.frame, CC.leftBlinker, CC.rightBlinker)) if self.CP.openpilotLongitudinalControl: - if lka_steering: - can_sends.extend(hyundaicanfd.create_adrv_messages(self.packer, self.CAN, self.frame)) - else: - can_sends.extend(hyundaicanfd.create_fca_warning_light(self.packer, self.CAN, self.frame)) + if not self.CP.flags & HyundaiFlags.CCNC: + if lka_steering: + can_sends.extend(hyundaicanfd.create_adrv_messages(self.packer, self.CAN, self.frame)) + else: + can_sends.extend(hyundaicanfd.create_fca_warning_light(self.packer, self.CAN, self.frame)) if self.frame % 2 == 0: if self.CP.flags & HyundaiFlags.CCNC and not lka_steering: can_sends.append(hyundaicanfd.create_ccnc_acc_control(self.packer, self.CAN, CC.enabled, self.accel_last, accel, stopping, From b2a523c26efe3a1119ee5dd8c0557dd79d79d46c Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 1 Mar 2025 16:34:02 -0500 Subject: [PATCH 134/316] should be enough for now --- opendbc/car/hyundai/carcontroller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/carcontroller.py b/opendbc/car/hyundai/carcontroller.py index ba50ddb767c..860e1fd6985 100644 --- a/opendbc/car/hyundai/carcontroller.py +++ b/opendbc/car/hyundai/carcontroller.py @@ -132,7 +132,7 @@ def update(self, CC, CS, now_nanos): else: can_sends.extend(hyundaicanfd.create_fca_warning_light(self.packer, self.CAN, self.frame)) if self.frame % 2 == 0: - if self.CP.flags & HyundaiFlags.CCNC and not lka_steering: + if self.CP.flags & HyundaiFlags.CCNC: can_sends.append(hyundaicanfd.create_ccnc_acc_control(self.packer, self.CAN, CC.enabled, self.accel_last, accel, stopping, CC.cruiseControl.override, set_speed_in_units, hud_control, CS.cruise_info)) else: From 366219b7a1791d3df5c51443011dfcd4ba2e8d8c Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 1 Mar 2025 16:39:10 -0500 Subject: [PATCH 135/316] Revert "dont send this since we use 161" This reverts commit fc1c7297320b925c2cdc05a4e84f6d8a04de0794. --- opendbc/car/hyundai/carcontroller.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/opendbc/car/hyundai/carcontroller.py b/opendbc/car/hyundai/carcontroller.py index 860e1fd6985..0169ab30fb6 100644 --- a/opendbc/car/hyundai/carcontroller.py +++ b/opendbc/car/hyundai/carcontroller.py @@ -126,11 +126,10 @@ def update(self, CC, CS, now_nanos): can_sends.extend(hyundaicanfd.create_spas_messages(self.packer, self.CAN, self.frame, CC.leftBlinker, CC.rightBlinker)) if self.CP.openpilotLongitudinalControl: - if not self.CP.flags & HyundaiFlags.CCNC: - if lka_steering: - can_sends.extend(hyundaicanfd.create_adrv_messages(self.packer, self.CAN, self.frame)) - else: - can_sends.extend(hyundaicanfd.create_fca_warning_light(self.packer, self.CAN, self.frame)) + if lka_steering: + can_sends.extend(hyundaicanfd.create_adrv_messages(self.packer, self.CAN, self.frame)) + else: + can_sends.extend(hyundaicanfd.create_fca_warning_light(self.packer, self.CAN, self.frame)) if self.frame % 2 == 0: if self.CP.flags & HyundaiFlags.CCNC: can_sends.append(hyundaicanfd.create_ccnc_acc_control(self.packer, self.CAN, CC.enabled, self.accel_last, accel, stopping, From b16bcd91f2dfc1ee419924890f6cfe8f9f73c5f8 Mon Sep 17 00:00:00 2001 From: royjr Date: Sun, 2 Mar 2025 00:25:05 -0500 Subject: [PATCH 136/316] combine SCC_CONTROL --- opendbc/car/hyundai/carcontroller.py | 9 +-- opendbc/car/hyundai/hyundaicanfd.py | 97 +++++++++++++--------------- 2 files changed, 48 insertions(+), 58 deletions(-) diff --git a/opendbc/car/hyundai/carcontroller.py b/opendbc/car/hyundai/carcontroller.py index 0169ab30fb6..442d349230c 100644 --- a/opendbc/car/hyundai/carcontroller.py +++ b/opendbc/car/hyundai/carcontroller.py @@ -131,12 +131,9 @@ def update(self, CC, CS, now_nanos): else: can_sends.extend(hyundaicanfd.create_fca_warning_light(self.packer, self.CAN, self.frame)) if self.frame % 2 == 0: - if self.CP.flags & HyundaiFlags.CCNC: - can_sends.append(hyundaicanfd.create_ccnc_acc_control(self.packer, self.CAN, CC.enabled, self.accel_last, accel, stopping, - CC.cruiseControl.override, set_speed_in_units, hud_control, CS.cruise_info)) - else: - can_sends.append(hyundaicanfd.create_acc_control(self.packer, self.CAN, CC.enabled, self.accel_last, accel, stopping, CC.cruiseControl.override, - set_speed_in_units, hud_control)) + cruise_info = CS.cruise_info if self.CP.flags & HyundaiFlags.CCNC else None + can_sends.append(hyundaicanfd.create_acc_control(self.packer, self.CAN, CC.enabled, self.accel_last, accel, stopping, + CC.cruiseControl.override, set_speed_in_units, hud_control, cruise_info)) self.accel_last = accel else: # button presses diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 883d0b528ec..6bb3af6706c 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -192,66 +192,59 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): return ret -def create_ccnc_acc_control(packer, CAN, enabled, accel_last, accel, stopping, gas_override, set_speed, hud_control, cruise_info): - if not enabled or gas_override: - a_val, a_raw = 0, 0 +def create_acc_control(packer, CAN, enabled, accel_last, accel, stopping, gas_override, set_speed, hud_control, cruise_info=None): + if cruise_info is None: + jerk = 5 + jn = jerk / 50 else: - a_raw = accel jn = 0.1 - a_val = np.clip(accel, accel_last - jn, accel_last + jn) - - values = {s: cruise_info[s] for s in [ - "ACC_ObjDist", - "ACC_ObjRelSpd", - ]} - values.update({ - "ACCMode": 0 if not enabled else (2 if gas_override else 1), - "MainMode_ACC": 1, - "StopReq": 1 if stopping else 0, - "aReqValue": a_val, - "aReqRaw": a_raw, - "VSetDis": set_speed, - "JerkLowerLimit": 1.5 if enabled else 0, - "JerkUpperLimit": 0.5 if enabled else 0, - - "ObjValid": 0, - "OBJ_STATUS": 2, - "SET_ME_2": 0x4, - "SET_ME_3": 0x3, - "SET_ME_TMP_64": 0x64, - "DISTANCE_SETTING": hud_control.leadDistanceBars, - }) - - return packer.make_can_msg("SCC_CONTROL", CAN.ECAN, values) - - -def create_acc_control(packer, CAN, enabled, accel_last, accel, stopping, gas_override, set_speed, hud_control): - jerk = 5 - jn = jerk / 50 if not enabled or gas_override: a_val, a_raw = 0, 0 else: a_raw = accel a_val = np.clip(accel, accel_last - jn, accel_last + jn) - values = { - "ACCMode": 0 if not enabled else (2 if gas_override else 1), - "MainMode_ACC": 1, - "StopReq": 1 if stopping else 0, - "aReqValue": a_val, - "aReqRaw": a_raw, - "VSetDis": set_speed, - "JerkLowerLimit": jerk if enabled else 1, - "JerkUpperLimit": 3.0, - - "ACC_ObjDist": 1, - "ObjValid": 0, - "OBJ_STATUS": 2, - "SET_ME_2": 0x4, - "SET_ME_3": 0x3, - "SET_ME_TMP_64": 0x64, - "DISTANCE_SETTING": hud_control.leadDistanceBars, - } + if cruise_info is None: + values = { + "ACCMode": 0 if not enabled else (2 if gas_override else 1), + "MainMode_ACC": 1, + "StopReq": 1 if stopping else 0, + "aReqValue": a_val, + "aReqRaw": a_raw, + "VSetDis": set_speed, + "JerkLowerLimit": jerk if enabled else 1, + "JerkUpperLimit": 3.0, + + "ACC_ObjDist": 1, + "ObjValid": 0, + "OBJ_STATUS": 2, + "SET_ME_2": 0x4, + "SET_ME_3": 0x3, + "SET_ME_TMP_64": 0x64, + "DISTANCE_SETTING": hud_control.leadDistanceBars, + } + else: + values = {s: cruise_info[s] for s in [ + "ACC_ObjDist", + "ACC_ObjRelSpd", + ]} + values.update({ + "ACCMode": 0 if not enabled else (2 if gas_override else 1), + "MainMode_ACC": 1, + "StopReq": 1 if stopping else 0, + "aReqValue": a_val, + "aReqRaw": a_raw, + "VSetDis": set_speed, + "JerkLowerLimit": 1.5 if enabled else 0, + "JerkUpperLimit": 0.5 if enabled else 0, + + "ObjValid": 0, + "OBJ_STATUS": 2, + "SET_ME_2": 0x4, + "SET_ME_3": 0x3, + "SET_ME_TMP_64": 0x64, + "DISTANCE_SETTING": hud_control.leadDistanceBars, + }) return packer.make_can_msg("SCC_CONTROL", CAN.ECAN, values) From 4ea789e428184a6cc6a3b5508ea505bc5bba1147 Mon Sep 17 00:00:00 2001 From: royjr Date: Sun, 2 Mar 2025 00:27:09 -0500 Subject: [PATCH 137/316] deredun jerk --- opendbc/car/hyundai/hyundaicanfd.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 6bb3af6706c..66000b9b1ca 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -193,11 +193,8 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): return ret def create_acc_control(packer, CAN, enabled, accel_last, accel, stopping, gas_override, set_speed, hud_control, cruise_info=None): - if cruise_info is None: - jerk = 5 - jn = jerk / 50 - else: - jn = 0.1 + jerk = 5 + jn = jerk / 50 if not enabled or gas_override: a_val, a_raw = 0, 0 else: From 2c03c480183c61b341f5ae37ba4a50399ae9fa9d Mon Sep 17 00:00:00 2001 From: royjr Date: Sun, 2 Mar 2025 00:33:41 -0500 Subject: [PATCH 138/316] better --- opendbc/car/hyundai/hyundaicanfd.py | 50 +++++++++++------------------ 1 file changed, 18 insertions(+), 32 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 66000b9b1ca..dfd67d6a22e 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -201,47 +201,33 @@ def create_acc_control(packer, CAN, enabled, accel_last, accel, stopping, gas_ov a_raw = accel a_val = np.clip(accel, accel_last - jn, accel_last + jn) + values = { + "ACCMode": 0 if not enabled else (2 if gas_override else 1), + "MainMode_ACC": 1, + "StopReq": 1 if stopping else 0, + "aReqValue": a_val, + "aReqRaw": a_raw, + "VSetDis": set_speed, + "ObjValid": 0, + "OBJ_STATUS": 2, + "SET_ME_2": 0x4, + "SET_ME_3": 0x3, + "SET_ME_TMP_64": 0x64, + "DISTANCE_SETTING": hud_control.leadDistanceBars, + } + if cruise_info is None: - values = { - "ACCMode": 0 if not enabled else (2 if gas_override else 1), - "MainMode_ACC": 1, - "StopReq": 1 if stopping else 0, - "aReqValue": a_val, - "aReqRaw": a_raw, - "VSetDis": set_speed, + values.update({ "JerkLowerLimit": jerk if enabled else 1, "JerkUpperLimit": 3.0, - "ACC_ObjDist": 1, - "ObjValid": 0, - "OBJ_STATUS": 2, - "SET_ME_2": 0x4, - "SET_ME_3": 0x3, - "SET_ME_TMP_64": 0x64, - "DISTANCE_SETTING": hud_control.leadDistanceBars, - } + }) else: - values = {s: cruise_info[s] for s in [ - "ACC_ObjDist", - "ACC_ObjRelSpd", - ]} values.update({ - "ACCMode": 0 if not enabled else (2 if gas_override else 1), - "MainMode_ACC": 1, - "StopReq": 1 if stopping else 0, - "aReqValue": a_val, - "aReqRaw": a_raw, - "VSetDis": set_speed, "JerkLowerLimit": 1.5 if enabled else 0, "JerkUpperLimit": 0.5 if enabled else 0, - - "ObjValid": 0, - "OBJ_STATUS": 2, - "SET_ME_2": 0x4, - "SET_ME_3": 0x3, - "SET_ME_TMP_64": 0x64, - "DISTANCE_SETTING": hud_control.leadDistanceBars, }) + values.update({s: cruise_info[s] for s in ["ACC_ObjDist", "ACC_ObjRelSpd"]}) return packer.make_can_msg("SCC_CONTROL", CAN.ECAN, values) From d57532bc02b304f5fb6cd7a33e767922c8f01e36 Mon Sep 17 00:00:00 2001 From: royjr Date: Sun, 2 Mar 2025 00:34:07 -0500 Subject: [PATCH 139/316] better? --- opendbc/car/hyundai/hyundaicanfd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index dfd67d6a22e..24d43bac187 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -226,8 +226,8 @@ def create_acc_control(packer, CAN, enabled, accel_last, accel, stopping, gas_ov values.update({ "JerkLowerLimit": 1.5 if enabled else 0, "JerkUpperLimit": 0.5 if enabled else 0, + **{s: cruise_info[s] for s in ["ACC_ObjDist", "ACC_ObjRelSpd"]} }) - values.update({s: cruise_info[s] for s in ["ACC_ObjDist", "ACC_ObjRelSpd"]}) return packer.make_can_msg("SCC_CONTROL", CAN.ECAN, values) From c1bc043f59e1f6e13dae8d0bd2a25f1f7ece1f31 Mon Sep 17 00:00:00 2001 From: royjr Date: Sun, 2 Mar 2025 01:22:09 -0500 Subject: [PATCH 140/316] HyundaiSafetyFlags --- opendbc/car/hyundai/interface.py | 2 ++ opendbc/car/hyundai/values.py | 1 + opendbc/safety/safety/safety_hyundai_canfd.h | 6 ++++-- opendbc/safety/tests/test_hyundai_canfd.py | 10 +++++----- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/opendbc/car/hyundai/interface.py b/opendbc/car/hyundai/interface.py index 561bc24542b..fcec91eeafb 100644 --- a/opendbc/car/hyundai/interface.py +++ b/opendbc/car/hyundai/interface.py @@ -68,6 +68,8 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experime ret.safetyConfigs[-1].safetyParam |= HyundaiSafetyFlags.CANFD_ALT_BUTTONS.value if ret.flags & HyundaiFlags.CANFD_CAMERA_SCC: ret.safetyConfigs[-1].safetyParam |= HyundaiSafetyFlags.CAMERA_SCC.value + if ret.flags & HyundaiFlags.CCNC: + ret.safetyConfigs[-1].safetyParam |= HyundaiSafetyFlags.CCNC.value else: # Shared configuration for non CAN-FD cars diff --git a/opendbc/car/hyundai/values.py b/opendbc/car/hyundai/values.py index f69a54a9160..f38be7d36b0 100644 --- a/opendbc/car/hyundai/values.py +++ b/opendbc/car/hyundai/values.py @@ -66,6 +66,7 @@ class HyundaiSafetyFlags(IntFlag): CANFD_LKA_STEERING_ALT = 128 FCEV_GAS = 256 ALT_LIMITS_2 = 512 + CCNC = 1024 class HyundaiFlags(IntFlag): diff --git a/opendbc/safety/safety/safety_hyundai_canfd.h b/opendbc/safety/safety/safety_hyundai_canfd.h index 3b78f805374..52bf85c6a1d 100644 --- a/opendbc/safety/safety/safety_hyundai_canfd.h +++ b/opendbc/safety/safety/safety_hyundai_canfd.h @@ -41,6 +41,7 @@ static bool hyundai_canfd_alt_buttons = false; static bool hyundai_canfd_lka_steering_alt = false; +static bool hyundai_ccnc = false; static int hyundai_canfd_get_lka_addr(void) { return hyundai_canfd_lka_steering_alt ? 0x110 : 0x50; @@ -221,8 +222,7 @@ static int hyundai_canfd_fwd_hook(int bus_num, int addr) { int bus_fwd = -1; if (bus_num == 0) { - bool is_mdps_msg = (addr == 0xEA); - if (!is_mdps_msg) { + if (!hyundai_ccnc || addr != 0xEA) { bus_fwd = 2; } } @@ -253,6 +253,7 @@ static int hyundai_canfd_fwd_hook(int bus_num, int addr) { static safety_config hyundai_canfd_init(uint16_t param) { const int HYUNDAI_PARAM_CANFD_LKA_STEERING_ALT = 128; const int HYUNDAI_PARAM_CANFD_ALT_BUTTONS = 32; + const int HYUNDAI_PARAM_CCNC = 1024; static const CanMsg HYUNDAI_CANFD_LKA_STEERING_TX_MSGS[] = { HYUNDAI_CANFD_LKA_STEERING_COMMON_TX_MSGS(0, 1) @@ -307,6 +308,7 @@ static safety_config hyundai_canfd_init(uint16_t param) { gen_crc_lookup_table_16(0x1021, hyundai_canfd_crc_lut); hyundai_canfd_alt_buttons = GET_FLAG(param, HYUNDAI_PARAM_CANFD_ALT_BUTTONS); hyundai_canfd_lka_steering_alt = GET_FLAG(param, HYUNDAI_PARAM_CANFD_LKA_STEERING_ALT); + hyundai_ccnc = GET_FLAG(param, HYUNDAI_PARAM_CCNC); safety_config ret; if (hyundai_longitudinal) { diff --git a/opendbc/safety/tests/test_hyundai_canfd.py b/opendbc/safety/tests/test_hyundai_canfd.py index 3677945a0d7..0b3abcb752f 100755 --- a/opendbc/safety/tests/test_hyundai_canfd.py +++ b/opendbc/safety/tests/test_hyundai_canfd.py @@ -14,7 +14,7 @@ class TestHyundaiCanfdBase(HyundaiButtonBase, common.PandaCarSafetyTest, common. TX_MSGS = [[0x50, 0], [0x1CF, 1], [0x2A4, 0]] STANDSTILL_THRESHOLD = 12 # 0.375 kph - FWD_BLACKLISTED_ADDRS = {2: [0x50, 0x2a4], 0: [0xea]} + FWD_BLACKLISTED_ADDRS = {2: [0x50, 0x2a4]} FWD_BUS_LOOKUP = {0: 2, 2: 0} MAX_RATE_UP = 2 @@ -85,7 +85,7 @@ class TestHyundaiCanfdLFASteeringBase(TestHyundaiCanfdBase): TX_MSGS = [[0x12A, 0], [0x1A0, 1], [0x1CF, 0], [0x1E0, 0]] RELAY_MALFUNCTION_ADDRS = {0: (0x12A,)} # LFA - FWD_BLACKLISTED_ADDRS = {2: [0x12A, 0x1E0, 0x161, 0x162], 0: [0xea]} + FWD_BLACKLISTED_ADDRS = {2: [0x12A, 0x1E0, 0x161, 0x162]} FWD_BUS_LOOKUP = {0: 2, 2: 0} STEER_MSG = "LFA" @@ -166,7 +166,7 @@ class TestHyundaiCanfdLKASteeringEV(TestHyundaiCanfdBase): TX_MSGS = [[0x50, 0], [0x1CF, 1], [0x2A4, 0]] RELAY_MALFUNCTION_ADDRS = {0: (0x50,)} # LKAS - FWD_BLACKLISTED_ADDRS = {2: [0x50, 0x2a4, 0x161, 0x162], 0: [0xea]} + FWD_BLACKLISTED_ADDRS = {2: [0x50, 0x2a4, 0x161, 0x162]} FWD_BUS_LOOKUP = {0: 2, 2: 0} PT_BUS = 1 @@ -186,7 +186,7 @@ class TestHyundaiCanfdLKASteeringAltEV(TestHyundaiCanfdBase): TX_MSGS = [[0x110, 0], [0x1CF, 1], [0x362, 0]] RELAY_MALFUNCTION_ADDRS = {0: (0x110,)} # LKAS_ALT - FWD_BLACKLISTED_ADDRS = {2: [0x110, 0x362, 0x161, 0x162], 0: [0xea]} + FWD_BLACKLISTED_ADDRS = {2: [0x110, 0x362, 0x161, 0x162]} FWD_BUS_LOOKUP = {0: 2, 2: 0} PT_BUS = 1 @@ -244,7 +244,7 @@ def _accel_msg(self, accel, aeb_req=False, aeb_decel=0): ]) class TestHyundaiCanfdLFASteeringLong(HyundaiLongitudinalBase, TestHyundaiCanfdLFASteeringBase): - FWD_BLACKLISTED_ADDRS = {2: [0x12a, 0x1e0, 0x1a0, 0x160, 0x161, 0x162], 0: [0xea]} + FWD_BLACKLISTED_ADDRS = {2: [0x12a, 0x1e0, 0x1a0, 0x160, 0x161, 0x162]} RELAY_MALFUNCTION_ADDRS = {0: (0x12A, 0x1a0)} # LFA, SCC_CONTROL From d75dc851476375395140312a3db7d5044b118493 Mon Sep 17 00:00:00 2001 From: royjr Date: Sun, 2 Mar 2025 12:10:09 -0500 Subject: [PATCH 141/316] fix MIRSA --- opendbc/safety/safety/safety_hyundai_canfd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/safety/safety/safety_hyundai_canfd.h b/opendbc/safety/safety/safety_hyundai_canfd.h index 52bf85c6a1d..8de379192c7 100644 --- a/opendbc/safety/safety/safety_hyundai_canfd.h +++ b/opendbc/safety/safety/safety_hyundai_canfd.h @@ -222,7 +222,7 @@ static int hyundai_canfd_fwd_hook(int bus_num, int addr) { int bus_fwd = -1; if (bus_num == 0) { - if (!hyundai_ccnc || addr != 0xEA) { + if (!(hyundai_ccnc) || (addr != 0xEA)) { bus_fwd = 2; } } From 45fdbdccd7bb749be78104213ad993ef4a088c51 Mon Sep 17 00:00:00 2001 From: royjr Date: Sun, 2 Mar 2025 15:47:43 -0500 Subject: [PATCH 142/316] fix dbc_dict --- opendbc/car/hyundai/values.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/values.py b/opendbc/car/hyundai/values.py index f38be7d36b0..6303867afbb 100644 --- a/opendbc/car/hyundai/values.py +++ b/opendbc/car/hyundai/values.py @@ -165,7 +165,7 @@ class HyundaiCanFDPlatformConfig(PlatformConfig): def init(self): self.flags |= HyundaiFlags.CANFD if self.flags & HyundaiFlags.MANDO_RADAR: - self.dbc_dict = {Bus.pt: "hyundai_canfd", Bus.radar: 'hyundai_canfd_radar_generated'} + self.dbc_dict = {Bus.pt: "hyundai_canfd_generated", Bus.radar: 'hyundai_canfd_radar_generated'} class CAR(Platforms): From 1b4e4803b21ded959cf81568f55b3dc8a122a6f6 Mon Sep 17 00:00:00 2001 From: royjr Date: Sun, 2 Mar 2025 15:50:15 -0500 Subject: [PATCH 143/316] enable MANDO_RADAR --- opendbc/car/hyundai/values.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/opendbc/car/hyundai/values.py b/opendbc/car/hyundai/values.py index 6303867afbb..545e89d0421 100644 --- a/opendbc/car/hyundai/values.py +++ b/opendbc/car/hyundai/values.py @@ -263,7 +263,7 @@ class CAR(Platforms): HYUNDAI_KONA_2ND_GEN = HyundaiCanFDPlatformConfig( [HyundaiCarDocs("Hyundai Kona 2024-25", car_parts=CarParts.common([CarHarness.hyundai_l]))], CarSpecs(mass=1590, wheelbase=2.66, steerRatio=13.6, tireStiffnessFactor=0.385), - flags=HyundaiFlags.CCNC, + flags=HyundaiFlags.CCNC | HyundaiFlags.MANDO_RADAR, ) HYUNDAI_KONA_EV = HyundaiPlatformConfig( [HyundaiCarDocs("Hyundai Kona Electric 2018-21", car_parts=CarParts.common([CarHarness.hyundai_g]))], @@ -279,7 +279,7 @@ class CAR(Platforms): [HyundaiCarDocs("Hyundai Kona Electric (with HDA II, Korea only) 2023", video_link="https://www.youtube.com/watch?v=U2fOCmcQ8hw", car_parts=CarParts.common([CarHarness.hyundai_r]))], CarSpecs(mass=1740, wheelbase=2.66, steerRatio=13.6, tireStiffnessFactor=0.385), - flags=HyundaiFlags.EV | HyundaiFlags.CANFD_NO_RADAR_DISABLE | HyundaiFlags.CCNC, + flags=HyundaiFlags.EV | HyundaiFlags.CANFD_NO_RADAR_DISABLE | HyundaiFlags.CCNC | HyundaiFlags.MANDO_RADAR, ) HYUNDAI_KONA_HEV = HyundaiPlatformConfig( [HyundaiCarDocs("Hyundai Kona Hybrid 2020", car_parts=CarParts.common([CarHarness.hyundai_i]))], # TODO: check packages, @@ -322,7 +322,7 @@ class CAR(Platforms): HYUNDAI_SONATA_2024 = HyundaiCanFDPlatformConfig( [HyundaiCarDocs("Hyundai Sonata 2024-25", "All", car_parts=CarParts.common([CarHarness.hyundai_a]))], CarSpecs(mass=1556, wheelbase=2.84, steerRatio=12.81), - flags=HyundaiFlags.CCNC, + flags=HyundaiFlags.CCNC | HyundaiFlags.MANDO_RADAR, ) HYUNDAI_SONATA_LF = HyundaiPlatformConfig( [HyundaiCarDocs("Hyundai Sonata 2018-19", car_parts=CarParts.common([CarHarness.hyundai_e]))], @@ -363,7 +363,7 @@ class CAR(Platforms): HYUNDAI_SONATA_HEV_2024 = HyundaiCanFDPlatformConfig( [HyundaiCarDocs("Hyundai Sonata Hybrid 2024-25", "All", car_parts=CarParts.common([CarHarness.hyundai_a]))], CarSpecs(mass=1616, wheelbase=2.84, steerRatio=13.27), - flags=HyundaiFlags.CCNC, + flags=HyundaiFlags.CCNC | HyundaiFlags.MANDO_RADAR, ) HYUNDAI_IONIQ_5 = HyundaiCanFDPlatformConfig( [ @@ -391,7 +391,7 @@ class CAR(Platforms): HYUNDAI_TUCSON_2025 = HyundaiCanFDPlatformConfig( [HyundaiCarDocs("Hyundai Tucson 2025", car_parts=CarParts.common([CarHarness.hyundai_n]))], CarSpecs(mass=1630, wheelbase=2.756, steerRatio=13.7, tireStiffnessFactor=0.385), - flags=HyundaiFlags.CCNC, + flags=HyundaiFlags.CCNC | HyundaiFlags.MANDO_RADAR, ) HYUNDAI_SANTA_CRUZ_1ST_GEN = HyundaiCanFDPlatformConfig( [HyundaiCarDocs("Hyundai Santa Cruz 2022-24", car_parts=CarParts.common([CarHarness.hyundai_n]))], @@ -420,7 +420,7 @@ class CAR(Platforms): KIA_K5_2025 = HyundaiCanFDPlatformConfig( [HyundaiCarDocs("Kia K5 2025", "Highway Driving Assist", car_parts=CarParts.common([CarHarness.hyundai_m]))], CarSpecs(mass=3230 * CV.LB_TO_KG, wheelbase=2.85, steerRatio=13.27), - flags=HyundaiFlags.CCNC, + flags=HyundaiFlags.CCNC | HyundaiFlags.MANDO_RADAR, ) KIA_K5_HEV_2020 = HyundaiPlatformConfig( [HyundaiCarDocs("Kia K5 Hybrid 2020-22", car_parts=CarParts.common([CarHarness.hyundai_a]))], @@ -528,7 +528,7 @@ class CAR(Platforms): KIA_SORENTO_2024 = HyundaiCanFDPlatformConfig( [HyundaiCarDocs("Kia Sorento 2024-25", car_parts=CarParts.common([CarHarness.hyundai_a]))], CarSpecs(mass=3957 * CV.LB_TO_KG, wheelbase=2.81, steerRatio=13.5), - flags=HyundaiFlags.CCNC, + flags=HyundaiFlags.CCNC | HyundaiFlags.MANDO_RADAR, ) KIA_SORENTO_HEV_4TH_GEN = HyundaiCanFDPlatformConfig( [ From 8b1b77bbea3bc60bafc2226f270403cedf89a917 Mon Sep 17 00:00:00 2001 From: royjr Date: Sun, 2 Mar 2025 15:58:47 -0500 Subject: [PATCH 144/316] prepare for LaneVisible when the time comes --- opendbc/car/hyundai/hyundaicanfd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 24d43bac187..620ba91a189 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -159,8 +159,8 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): # ICONS, LANELINES msg_161.update({ "CENTERLINE": 1 if enabled else 0, - "LANELINE_LEFT": 2 if enabled else 0, - "LANELINE_RIGHT": 2 if enabled else 0, + "LANELINE_LEFT": 2 if enabled and hud.leftLaneVisible else 0, + "LANELINE_RIGHT": 2 if enabled and hud.rightLaneVisible else 0, "LFA_ICON": 2 if enabled else 0, "LKA_ICON": 0, }) From 4287703ab4664d88455555bb5559be914031c378 Mon Sep 17 00:00:00 2001 From: royjr Date: Sun, 2 Mar 2025 16:09:31 -0500 Subject: [PATCH 145/316] Revert "enable MANDO_RADAR" This reverts commit 1b4e4803b21ded959cf81568f55b3dc8a122a6f6. --- opendbc/car/hyundai/values.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/opendbc/car/hyundai/values.py b/opendbc/car/hyundai/values.py index 545e89d0421..6303867afbb 100644 --- a/opendbc/car/hyundai/values.py +++ b/opendbc/car/hyundai/values.py @@ -263,7 +263,7 @@ class CAR(Platforms): HYUNDAI_KONA_2ND_GEN = HyundaiCanFDPlatformConfig( [HyundaiCarDocs("Hyundai Kona 2024-25", car_parts=CarParts.common([CarHarness.hyundai_l]))], CarSpecs(mass=1590, wheelbase=2.66, steerRatio=13.6, tireStiffnessFactor=0.385), - flags=HyundaiFlags.CCNC | HyundaiFlags.MANDO_RADAR, + flags=HyundaiFlags.CCNC, ) HYUNDAI_KONA_EV = HyundaiPlatformConfig( [HyundaiCarDocs("Hyundai Kona Electric 2018-21", car_parts=CarParts.common([CarHarness.hyundai_g]))], @@ -279,7 +279,7 @@ class CAR(Platforms): [HyundaiCarDocs("Hyundai Kona Electric (with HDA II, Korea only) 2023", video_link="https://www.youtube.com/watch?v=U2fOCmcQ8hw", car_parts=CarParts.common([CarHarness.hyundai_r]))], CarSpecs(mass=1740, wheelbase=2.66, steerRatio=13.6, tireStiffnessFactor=0.385), - flags=HyundaiFlags.EV | HyundaiFlags.CANFD_NO_RADAR_DISABLE | HyundaiFlags.CCNC | HyundaiFlags.MANDO_RADAR, + flags=HyundaiFlags.EV | HyundaiFlags.CANFD_NO_RADAR_DISABLE | HyundaiFlags.CCNC, ) HYUNDAI_KONA_HEV = HyundaiPlatformConfig( [HyundaiCarDocs("Hyundai Kona Hybrid 2020", car_parts=CarParts.common([CarHarness.hyundai_i]))], # TODO: check packages, @@ -322,7 +322,7 @@ class CAR(Platforms): HYUNDAI_SONATA_2024 = HyundaiCanFDPlatformConfig( [HyundaiCarDocs("Hyundai Sonata 2024-25", "All", car_parts=CarParts.common([CarHarness.hyundai_a]))], CarSpecs(mass=1556, wheelbase=2.84, steerRatio=12.81), - flags=HyundaiFlags.CCNC | HyundaiFlags.MANDO_RADAR, + flags=HyundaiFlags.CCNC, ) HYUNDAI_SONATA_LF = HyundaiPlatformConfig( [HyundaiCarDocs("Hyundai Sonata 2018-19", car_parts=CarParts.common([CarHarness.hyundai_e]))], @@ -363,7 +363,7 @@ class CAR(Platforms): HYUNDAI_SONATA_HEV_2024 = HyundaiCanFDPlatformConfig( [HyundaiCarDocs("Hyundai Sonata Hybrid 2024-25", "All", car_parts=CarParts.common([CarHarness.hyundai_a]))], CarSpecs(mass=1616, wheelbase=2.84, steerRatio=13.27), - flags=HyundaiFlags.CCNC | HyundaiFlags.MANDO_RADAR, + flags=HyundaiFlags.CCNC, ) HYUNDAI_IONIQ_5 = HyundaiCanFDPlatformConfig( [ @@ -391,7 +391,7 @@ class CAR(Platforms): HYUNDAI_TUCSON_2025 = HyundaiCanFDPlatformConfig( [HyundaiCarDocs("Hyundai Tucson 2025", car_parts=CarParts.common([CarHarness.hyundai_n]))], CarSpecs(mass=1630, wheelbase=2.756, steerRatio=13.7, tireStiffnessFactor=0.385), - flags=HyundaiFlags.CCNC | HyundaiFlags.MANDO_RADAR, + flags=HyundaiFlags.CCNC, ) HYUNDAI_SANTA_CRUZ_1ST_GEN = HyundaiCanFDPlatformConfig( [HyundaiCarDocs("Hyundai Santa Cruz 2022-24", car_parts=CarParts.common([CarHarness.hyundai_n]))], @@ -420,7 +420,7 @@ class CAR(Platforms): KIA_K5_2025 = HyundaiCanFDPlatformConfig( [HyundaiCarDocs("Kia K5 2025", "Highway Driving Assist", car_parts=CarParts.common([CarHarness.hyundai_m]))], CarSpecs(mass=3230 * CV.LB_TO_KG, wheelbase=2.85, steerRatio=13.27), - flags=HyundaiFlags.CCNC | HyundaiFlags.MANDO_RADAR, + flags=HyundaiFlags.CCNC, ) KIA_K5_HEV_2020 = HyundaiPlatformConfig( [HyundaiCarDocs("Kia K5 Hybrid 2020-22", car_parts=CarParts.common([CarHarness.hyundai_a]))], @@ -528,7 +528,7 @@ class CAR(Platforms): KIA_SORENTO_2024 = HyundaiCanFDPlatformConfig( [HyundaiCarDocs("Kia Sorento 2024-25", car_parts=CarParts.common([CarHarness.hyundai_a]))], CarSpecs(mass=3957 * CV.LB_TO_KG, wheelbase=2.81, steerRatio=13.5), - flags=HyundaiFlags.CCNC | HyundaiFlags.MANDO_RADAR, + flags=HyundaiFlags.CCNC, ) KIA_SORENTO_HEV_4TH_GEN = HyundaiCanFDPlatformConfig( [ From 65842566c08854e882bf0868d7e4ab1f2ad09d15 Mon Sep 17 00:00:00 2001 From: royjr Date: Mon, 3 Mar 2025 13:57:09 -0500 Subject: [PATCH 146/316] revert jerk --- opendbc/car/hyundai/hyundaicanfd.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 620ba91a189..b02052aac30 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -208,6 +208,9 @@ def create_acc_control(packer, CAN, enabled, accel_last, accel, stopping, gas_ov "aReqValue": a_val, "aReqRaw": a_raw, "VSetDis": set_speed, + "JerkLowerLimit": jerk if enabled else 1, + "JerkUpperLimit": 3.0, + "ObjValid": 0, "OBJ_STATUS": 2, "SET_ME_2": 0x4, @@ -216,16 +219,11 @@ def create_acc_control(packer, CAN, enabled, accel_last, accel, stopping, gas_ov "DISTANCE_SETTING": hud_control.leadDistanceBars, } + # fixes auto regen stuck on max for hybrids if cruise_info is None: - values.update({ - "JerkLowerLimit": jerk if enabled else 1, - "JerkUpperLimit": 3.0, - "ACC_ObjDist": 1, - }) + values["ACC_ObjDist"] = 0 else: values.update({ - "JerkLowerLimit": 1.5 if enabled else 0, - "JerkUpperLimit": 0.5 if enabled else 0, **{s: cruise_info[s] for s in ["ACC_ObjDist", "ACC_ObjRelSpd"]} }) From 9cb8164fe77ddc022ceb7da477484997b7887ca1 Mon Sep 17 00:00:00 2001 From: royjr Date: Mon, 3 Mar 2025 22:24:10 -0500 Subject: [PATCH 147/316] better lanelines --- opendbc/car/hyundai/carcontroller.py | 2 +- opendbc/car/hyundai/hyundaicanfd.py | 20 +++++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/opendbc/car/hyundai/carcontroller.py b/opendbc/car/hyundai/carcontroller.py index 442d349230c..c7c85933b66 100644 --- a/opendbc/car/hyundai/carcontroller.py +++ b/opendbc/car/hyundai/carcontroller.py @@ -117,7 +117,7 @@ def update(self, CC, CS, now_nanos): # LFA and HDA icons if self.frame % 5 == 0 and (not lka_steering or lka_steering_long): if self.CP.flags & HyundaiFlags.CCNC and not lka_steering: - can_sends.extend(hyundaicanfd.create_ccnc(self.packer, self.CAN, self.frame, self.CP, CC, CS)) + can_sends.extend(hyundaicanfd.create_ccnc(self.packer, self.CAN, self.frame, self.CP, CC, CS, apply_steer_req)) else: can_sends.append(hyundaicanfd.create_lfahda_cluster(self.packer, self.CAN, CC.enabled)) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index b02052aac30..558594eac64 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -124,7 +124,7 @@ def create_lfahda_cluster(packer, CAN, enabled): } return packer.make_can_msg("LFAHDA_CLUSTER", CAN.ECAN, values) -def create_ccnc(packer, CAN, frame, CP, CC, CS): +def create_ccnc(packer, CAN, frame, CP, CC, CS, lat_active): ret = [] msg_161 = CS.msg_161.copy() @@ -158,10 +158,20 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS): # ICONS, LANELINES msg_161.update({ - "CENTERLINE": 1 if enabled else 0, - "LANELINE_LEFT": 2 if enabled and hud.leftLaneVisible else 0, - "LANELINE_RIGHT": 2 if enabled and hud.rightLaneVisible else 0, - "LFA_ICON": 2 if enabled else 0, + "CENTERLINE": 1 if lat_active else 0, + "LANELINE_LEFT": ( + 1 if not hud.leftLaneVisible else + 4 if hud.leftLaneVisible and hud.leftLaneDepart else + 0 if hud.leftLaneVisible and not lat_active else + 2 if hud.leftLaneVisible and lat_active and (CS.out.leftBlindspot or CS.out.vEgo < 8.94) else 6 + ), + "LANELINE_RIGHT": ( + 1 if not hud.rightLaneVisible else + 4 if hud.rightLaneVisible and hud.rightLaneDepart else + 0 if hud.rightLaneVisible and not lat_active else + 2 if hud.rightLaneVisible and lat_active and (CS.out.rightBlindspot or CS.out.vEgo < 8.94) else 6 + ), + "LFA_ICON": 2 if lat_active else 0, "LKA_ICON": 0, }) From 0db433dedd8e8495868119b50eede7bf070cd704 Mon Sep 17 00:00:00 2001 From: royjr Date: Mon, 3 Mar 2025 22:26:42 -0500 Subject: [PATCH 148/316] simple lanelines --- opendbc/car/hyundai/hyundaicanfd.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 558594eac64..b2f44282ada 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -161,15 +161,15 @@ def create_ccnc(packer, CAN, frame, CP, CC, CS, lat_active): "CENTERLINE": 1 if lat_active else 0, "LANELINE_LEFT": ( 1 if not hud.leftLaneVisible else - 4 if hud.leftLaneVisible and hud.leftLaneDepart else - 0 if hud.leftLaneVisible and not lat_active else - 2 if hud.leftLaneVisible and lat_active and (CS.out.leftBlindspot or CS.out.vEgo < 8.94) else 6 + 4 if hud.leftLaneDepart else + 0 if not lat_active else + 2 if CS.out.leftBlindspot or CS.out.vEgo < 8.94 else 6 ), "LANELINE_RIGHT": ( 1 if not hud.rightLaneVisible else - 4 if hud.rightLaneVisible and hud.rightLaneDepart else - 0 if hud.rightLaneVisible and not lat_active else - 2 if hud.rightLaneVisible and lat_active and (CS.out.rightBlindspot or CS.out.vEgo < 8.94) else 6 + 4 if hud.rightLaneDepart else + 0 if not lat_active else + 2 if CS.out.rightBlindspot or CS.out.vEgo < 8.94 else 6 ), "LFA_ICON": 2 if lat_active else 0, "LKA_ICON": 0, From 0e3be101ac10f289389325ebe7ffedc1ef3483db Mon Sep 17 00:00:00 2001 From: royjr Date: Mon, 3 Mar 2025 23:54:56 -0500 Subject: [PATCH 149/316] whoops --- opendbc/car/hyundai/hyundaicanfd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index b2f44282ada..3df95ca8a07 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -231,7 +231,7 @@ def create_acc_control(packer, CAN, enabled, accel_last, accel, stopping, gas_ov # fixes auto regen stuck on max for hybrids if cruise_info is None: - values["ACC_ObjDist"] = 0 + values["ACC_ObjDist"] = 1 else: values.update({ **{s: cruise_info[s] for s in ["ACC_ObjDist", "ACC_ObjRelSpd"]} From 8c4f3f63ff02af02717af1a6e089691b027a8282 Mon Sep 17 00:00:00 2001 From: royjr Date: Mon, 3 Mar 2025 23:59:20 -0500 Subject: [PATCH 150/316] frame not used --- opendbc/car/hyundai/carcontroller.py | 2 +- opendbc/car/hyundai/hyundaicanfd.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/opendbc/car/hyundai/carcontroller.py b/opendbc/car/hyundai/carcontroller.py index c7c85933b66..8d7516a0634 100644 --- a/opendbc/car/hyundai/carcontroller.py +++ b/opendbc/car/hyundai/carcontroller.py @@ -117,7 +117,7 @@ def update(self, CC, CS, now_nanos): # LFA and HDA icons if self.frame % 5 == 0 and (not lka_steering or lka_steering_long): if self.CP.flags & HyundaiFlags.CCNC and not lka_steering: - can_sends.extend(hyundaicanfd.create_ccnc(self.packer, self.CAN, self.frame, self.CP, CC, CS, apply_steer_req)) + can_sends.extend(hyundaicanfd.create_ccnc(self.packer, self.CAN, self.CP, CC, CS, apply_steer_req)) else: can_sends.append(hyundaicanfd.create_lfahda_cluster(self.packer, self.CAN, CC.enabled)) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 3df95ca8a07..fdaa7aab62f 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -124,7 +124,7 @@ def create_lfahda_cluster(packer, CAN, enabled): } return packer.make_can_msg("LFAHDA_CLUSTER", CAN.ECAN, values) -def create_ccnc(packer, CAN, frame, CP, CC, CS, lat_active): +def create_ccnc(packer, CAN, CP, CC, CS, lat_active): ret = [] msg_161 = CS.msg_161.copy() From a8505e4e7d88c9999cb0fccfd3f6eb31898fd20f Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 4 Mar 2025 00:01:00 -0500 Subject: [PATCH 151/316] deredun --- opendbc/car/hyundai/carcontroller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/carcontroller.py b/opendbc/car/hyundai/carcontroller.py index 8d7516a0634..b482b3651ac 100644 --- a/opendbc/car/hyundai/carcontroller.py +++ b/opendbc/car/hyundai/carcontroller.py @@ -116,7 +116,7 @@ def update(self, CC, CS, now_nanos): # LFA and HDA icons if self.frame % 5 == 0 and (not lka_steering or lka_steering_long): - if self.CP.flags & HyundaiFlags.CCNC and not lka_steering: + if self.CP.flags & HyundaiFlags.CCNC: can_sends.extend(hyundaicanfd.create_ccnc(self.packer, self.CAN, self.CP, CC, CS, apply_steer_req)) else: can_sends.append(hyundaicanfd.create_lfahda_cluster(self.packer, self.CAN, CC.enabled)) From ba6c74f8169121d8323ec63359a66ca8adf58d19 Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 4 Mar 2025 00:07:26 -0500 Subject: [PATCH 152/316] cleaner --- opendbc/car/hyundai/carstate.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index 2a84ed96393..ce4eed4dd96 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -240,10 +240,8 @@ def update_canfd(self, can_parsers) -> structs.CarState: ret.steerFaultTemporary = cp.vl["MDPS"]["LKA_FAULT"] != 0 if self.CP.flags & HyundaiFlags.CCNC and not self.CP.flags & HyundaiFlags.CANFD_LKA_STEERING: - self.msg_161 = copy.copy(cp_cam.vl["CCNC_0x161"]) - self.msg_162 = copy.copy(cp_cam.vl["CCNC_0x162"]) - cp_cruise_info = cp_cam if self.CP.flags & HyundaiFlags.CANFD_CAMERA_SCC else cp - self.cruise_info = copy.copy(cp_cruise_info.vl["SCC_CONTROL"]) + self.msg_161, self.msg_162 = map(copy.copy, (cp_cam.vl["CCNC_0x161"], cp_cam.vl["CCNC_0x162"])) + self.cruise_info = copy.copy((cp_cam if self.CP.flags & HyundaiFlags.CANFD_CAMERA_SCC else cp).vl["SCC_CONTROL"]) alt = "_ALT" if self.CP.flags & HyundaiFlags.CCNC and not self.CP.flags & HyundaiFlags.CANFD_LKA_STEERING else "" ret.leftBlinker, ret.rightBlinker = self.update_blinker_from_lamp(50, cp.vl["BLINKERS"][f"LEFT_LAMP{alt}"], From 3f2bd21bcc4dbc0059ff9669d00480f63cd2b556 Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 4 Mar 2025 00:12:43 -0500 Subject: [PATCH 153/316] cleaner --- opendbc/car/hyundai/carstate.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index ce4eed4dd96..657f7903294 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -238,12 +238,12 @@ def update_canfd(self, can_parsers) -> structs.CarState: ret.steeringTorqueEps = cp.vl["MDPS"]["STEERING_OUT_TORQUE"] ret.steeringPressed = self.update_steering_pressed(abs(ret.steeringTorque) > self.params.STEER_THRESHOLD, 5) ret.steerFaultTemporary = cp.vl["MDPS"]["LKA_FAULT"] != 0 - + alt = "" if self.CP.flags & HyundaiFlags.CCNC and not self.CP.flags & HyundaiFlags.CANFD_LKA_STEERING: self.msg_161, self.msg_162 = map(copy.copy, (cp_cam.vl["CCNC_0x161"], cp_cam.vl["CCNC_0x162"])) self.cruise_info = copy.copy((cp_cam if self.CP.flags & HyundaiFlags.CANFD_CAMERA_SCC else cp).vl["SCC_CONTROL"]) - - alt = "_ALT" if self.CP.flags & HyundaiFlags.CCNC and not self.CP.flags & HyundaiFlags.CANFD_LKA_STEERING else "" + alt = "_ALT" + ret.leftBlinker, ret.rightBlinker = self.update_blinker_from_lamp(50, cp.vl["BLINKERS"][f"LEFT_LAMP{alt}"], cp.vl["BLINKERS"][f"RIGHT_LAMP{alt}"]) if self.CP.enableBsm: From 2de0c04abbdf1736050a8689a2394ee11ea500e1 Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 4 Mar 2025 00:15:14 -0500 Subject: [PATCH 154/316] fix --- opendbc/car/hyundai/carstate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index 657f7903294..c607f50f764 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -238,12 +238,12 @@ def update_canfd(self, can_parsers) -> structs.CarState: ret.steeringTorqueEps = cp.vl["MDPS"]["STEERING_OUT_TORQUE"] ret.steeringPressed = self.update_steering_pressed(abs(ret.steeringTorque) > self.params.STEER_THRESHOLD, 5) ret.steerFaultTemporary = cp.vl["MDPS"]["LKA_FAULT"] != 0 + alt = "" if self.CP.flags & HyundaiFlags.CCNC and not self.CP.flags & HyundaiFlags.CANFD_LKA_STEERING: self.msg_161, self.msg_162 = map(copy.copy, (cp_cam.vl["CCNC_0x161"], cp_cam.vl["CCNC_0x162"])) self.cruise_info = copy.copy((cp_cam if self.CP.flags & HyundaiFlags.CANFD_CAMERA_SCC else cp).vl["SCC_CONTROL"]) alt = "_ALT" - ret.leftBlinker, ret.rightBlinker = self.update_blinker_from_lamp(50, cp.vl["BLINKERS"][f"LEFT_LAMP{alt}"], cp.vl["BLINKERS"][f"RIGHT_LAMP{alt}"]) if self.CP.enableBsm: From 5abdf6b6e15b7ee6178fc8c236aaee623d8672b3 Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 4 Mar 2025 00:20:23 -0500 Subject: [PATCH 155/316] append instead --- opendbc/car/hyundai/carcontroller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/carcontroller.py b/opendbc/car/hyundai/carcontroller.py index b482b3651ac..36321a2dce3 100644 --- a/opendbc/car/hyundai/carcontroller.py +++ b/opendbc/car/hyundai/carcontroller.py @@ -117,7 +117,7 @@ def update(self, CC, CS, now_nanos): # LFA and HDA icons if self.frame % 5 == 0 and (not lka_steering or lka_steering_long): if self.CP.flags & HyundaiFlags.CCNC: - can_sends.extend(hyundaicanfd.create_ccnc(self.packer, self.CAN, self.CP, CC, CS, apply_steer_req)) + can_sends.append(hyundaicanfd.create_ccnc(self.packer, self.CAN, self.CP, CC, CS, apply_steer_req)) else: can_sends.append(hyundaicanfd.create_lfahda_cluster(self.packer, self.CAN, CC.enabled)) From dc18a64604e4f62ca39927f4293da3c0100b741d Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 4 Mar 2025 00:24:03 -0500 Subject: [PATCH 156/316] better --- opendbc/car/hyundai/hyundaicanfd.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index fdaa7aab62f..058cb7bab10 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -230,12 +230,7 @@ def create_acc_control(packer, CAN, enabled, accel_last, accel, stopping, gas_ov } # fixes auto regen stuck on max for hybrids - if cruise_info is None: - values["ACC_ObjDist"] = 1 - else: - values.update({ - **{s: cruise_info[s] for s in ["ACC_ObjDist", "ACC_ObjRelSpd"]} - }) + values.update({"ACC_ObjDist": 1} if cruise_info is None else {s: cruise_info[s] for s in ["ACC_ObjDist", "ACC_ObjRelSpd"]}) return packer.make_can_msg("SCC_CONTROL", CAN.ECAN, values) From 2e9d918c6fbd1949e136e2a217cb5619242a6432 Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 4 Mar 2025 00:24:45 -0500 Subject: [PATCH 157/316] comment --- opendbc/car/hyundai/hyundaicanfd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 058cb7bab10..6842afb41e4 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -229,7 +229,7 @@ def create_acc_control(packer, CAN, enabled, accel_last, accel, stopping, gas_ov "DISTANCE_SETTING": hud_control.leadDistanceBars, } - # fixes auto regen stuck on max for hybrids + # fixes auto regen stuck on max for hybrids, should probably apply to all cars values.update({"ACC_ObjDist": 1} if cruise_info is None else {s: cruise_info[s] for s in ["ACC_ObjDist", "ACC_ObjRelSpd"]}) return packer.make_can_msg("SCC_CONTROL", CAN.ECAN, values) From 89f73538a2c2c13b8d022c43d04a11fd6ac6b70c Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 4 Mar 2025 00:32:40 -0500 Subject: [PATCH 158/316] cleaner --- opendbc/car/hyundai/hyundaicanfd.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 6842afb41e4..80697c904ea 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -127,10 +127,8 @@ def create_lfahda_cluster(packer, CAN, enabled): def create_ccnc(packer, CAN, CP, CC, CS, lat_active): ret = [] - msg_161 = CS.msg_161.copy() - msg_162 = CS.msg_162.copy() - enabled = CC.enabled - hud = CC.hudControl + msg_161, msg_162 = CS.msg_161.copy(), CS.msg_162.copy() + enabled, hud = CC.enabled, CC.hudControl # HIDE FAULTS for f in ("FAULT_LSS", "FAULT_HDA", "FAULT_DAS", "FAULT_LFA", "FAULT_DAW"): From 74c2057f27f73dae49659cfea2338f139ad8b2af Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 4 Mar 2025 00:38:52 -0500 Subject: [PATCH 159/316] useless --- opendbc/car/hyundai/hyundaicanfd.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 80697c904ea..594f0e20102 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -126,15 +126,12 @@ def create_lfahda_cluster(packer, CAN, enabled): def create_ccnc(packer, CAN, CP, CC, CS, lat_active): ret = [] - msg_161, msg_162 = CS.msg_161.copy(), CS.msg_162.copy() enabled, hud = CC.enabled, CC.hudControl - # HIDE FAULTS for f in ("FAULT_LSS", "FAULT_HDA", "FAULT_DAS", "FAULT_LFA", "FAULT_DAW"): msg_162[f] = 0 - # HIDE ALERTS if msg_161.get("ALERTS_3") == 17: # DRIVE_CAREFULLY msg_161["ALERTS_3"] = 0 @@ -149,12 +146,11 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): if msg_161.get("ALERTS_2") == 5: # CONSIDER_TAKING_A_BREAK msg_161.update({"ALERTS_2": 0, "SOUNDS_2": 0}) - msg_161["DAW_ICON"] = 0 # ALWAYS HIDE NOW THAT WE BLOCK MDPS + msg_161["DAW_ICON"] = 0 if msg_161.get("SOUNDS_4") == 2 and msg_161.get("LFA_ICON") in (3, 0,): # LFA BEEPS msg_161["SOUNDS_4"] = 0 - # ICONS, LANELINES msg_161.update({ "CENTERLINE": 1 if lat_active else 0, "LANELINE_LEFT": ( @@ -173,10 +169,7 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): "LKA_ICON": 0, }) - # OP LONG if CP.openpilotLongitudinalControl: - - # SETSPEED, DISTANCE msg_161.update({ "SETSPEED": 3 if enabled else 1, "SETSPEED_HUD": 2 if enabled else 1, @@ -189,7 +182,6 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): "FCA_ICON": 1, }) - # LEAD msg_162.update({ "LEAD": 2 if enabled and hud.leadVisible else 1 if hud.leadVisible else 0, "LEAD_DISTANCE": 10, @@ -197,7 +189,6 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): ret.append(packer.make_can_msg("CCNC_0x161", CAN.ECAN, msg_161)) ret.append(packer.make_can_msg("CCNC_0x162", CAN.ECAN, msg_162)) - return ret def create_acc_control(packer, CAN, enabled, accel_last, accel, stopping, gas_override, set_speed, hud_control, cruise_info=None): From 857777a537cbae01d66c4ab0aaff2fa3e6cb6fc7 Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 4 Mar 2025 00:39:38 -0500 Subject: [PATCH 160/316] combine --- opendbc/car/hyundai/hyundaicanfd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 594f0e20102..6cbc36b887f 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -146,12 +146,12 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): if msg_161.get("ALERTS_2") == 5: # CONSIDER_TAKING_A_BREAK msg_161.update({"ALERTS_2": 0, "SOUNDS_2": 0}) - msg_161["DAW_ICON"] = 0 if msg_161.get("SOUNDS_4") == 2 and msg_161.get("LFA_ICON") in (3, 0,): # LFA BEEPS msg_161["SOUNDS_4"] = 0 msg_161.update({ + "DAW_ICON": 0, "CENTERLINE": 1 if lat_active else 0, "LANELINE_LEFT": ( 1 if not hud.leftLaneVisible else From 77ef598781f3ce307c1a252a15a299f7226b7edd Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 4 Mar 2025 00:44:59 -0500 Subject: [PATCH 161/316] match upstream --- opendbc/car/hyundai/carcontroller.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opendbc/car/hyundai/carcontroller.py b/opendbc/car/hyundai/carcontroller.py index 36321a2dce3..268528395de 100644 --- a/opendbc/car/hyundai/carcontroller.py +++ b/opendbc/car/hyundai/carcontroller.py @@ -132,8 +132,8 @@ def update(self, CC, CS, now_nanos): can_sends.extend(hyundaicanfd.create_fca_warning_light(self.packer, self.CAN, self.frame)) if self.frame % 2 == 0: cruise_info = CS.cruise_info if self.CP.flags & HyundaiFlags.CCNC else None - can_sends.append(hyundaicanfd.create_acc_control(self.packer, self.CAN, CC.enabled, self.accel_last, accel, stopping, - CC.cruiseControl.override, set_speed_in_units, hud_control, cruise_info)) + can_sends.append(hyundaicanfd.create_acc_control(self.packer, self.CAN, CC.enabled, self.accel_last, accel, stopping, CC.cruiseControl.override, + set_speed_in_units, hud_control, cruise_info)) self.accel_last = accel else: # button presses From 8e112a0c6bda20d3332e74c0453788dfefd6bec0 Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 4 Mar 2025 00:49:24 -0500 Subject: [PATCH 162/316] no need on top --- opendbc/car/hyundai/hyundaicanfd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 6cbc36b887f..c2ca441fd1c 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -125,7 +125,6 @@ def create_lfahda_cluster(packer, CAN, enabled): return packer.make_can_msg("LFAHDA_CLUSTER", CAN.ECAN, values) def create_ccnc(packer, CAN, CP, CC, CS, lat_active): - ret = [] msg_161, msg_162 = CS.msg_161.copy(), CS.msg_162.copy() enabled, hud = CC.enabled, CC.hudControl @@ -187,6 +186,7 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): "LEAD_DISTANCE": 10, }) + ret = [] ret.append(packer.make_can_msg("CCNC_0x161", CAN.ECAN, msg_161)) ret.append(packer.make_can_msg("CCNC_0x162", CAN.ECAN, msg_162)) return ret From 6b13860a42079ec6e10018b2b80ca6c482541c1e Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 4 Mar 2025 00:50:10 -0500 Subject: [PATCH 163/316] much better --- opendbc/car/hyundai/hyundaicanfd.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index c2ca441fd1c..b6e241dd83a 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -186,10 +186,7 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): "LEAD_DISTANCE": 10, }) - ret = [] - ret.append(packer.make_can_msg("CCNC_0x161", CAN.ECAN, msg_161)) - ret.append(packer.make_can_msg("CCNC_0x162", CAN.ECAN, msg_162)) - return ret + return [packer.make_can_msg(msg, CAN.ECAN, data) for msg, data in [("CCNC_0x161", msg_161), ("CCNC_0x162", msg_162)]] def create_acc_control(packer, CAN, enabled, accel_last, accel, stopping, gas_override, set_speed, hud_control, cruise_info=None): jerk = 5 From 7a4e84cd1a9975c281f9554ace04b10a9701c763 Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 4 Mar 2025 00:50:36 -0500 Subject: [PATCH 164/316] lineless --- opendbc/car/hyundai/hyundaicanfd.py | 1 - 1 file changed, 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index b6e241dd83a..c62656585d9 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -206,7 +206,6 @@ def create_acc_control(packer, CAN, enabled, accel_last, accel, stopping, gas_ov "VSetDis": set_speed, "JerkLowerLimit": jerk if enabled else 1, "JerkUpperLimit": 3.0, - "ObjValid": 0, "OBJ_STATUS": 2, "SET_ME_2": 0x4, From 4d5f3a6edc494dfb5866cdbe4b0a8cf7d6b894e3 Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 4 Mar 2025 00:53:34 -0500 Subject: [PATCH 165/316] cleaner --- opendbc/car/hyundai/hyundaicanfd.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index c62656585d9..037a0b8fd1e 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -191,11 +191,7 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): def create_acc_control(packer, CAN, enabled, accel_last, accel, stopping, gas_override, set_speed, hud_control, cruise_info=None): jerk = 5 jn = jerk / 50 - if not enabled or gas_override: - a_val, a_raw = 0, 0 - else: - a_raw = accel - a_val = np.clip(accel, accel_last - jn, accel_last + jn) + a_raw, a_val = (0, 0) if not enabled or gas_override else (accel, np.clip(accel, accel_last - jn, accel_last + jn)) values = { "ACCMode": 0 if not enabled else (2 if gas_override else 1), From 58db63a6f50b5871389706ddd9471cd1fc8261b8 Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 4 Mar 2025 00:56:41 -0500 Subject: [PATCH 166/316] near related --- opendbc/car/hyundai/carstate.py | 1 - 1 file changed, 1 deletion(-) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index c607f50f764..301c65cfc0a 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -55,7 +55,6 @@ def __init__(self, CP): self.buttons_counter = 0 self.cruise_info = {} - self.msg_161 = {} self.msg_162 = {} From 7fe673f43b18911c81eb9cfba6e36b6ba2c4f6e1 Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 4 Mar 2025 01:49:56 -0500 Subject: [PATCH 167/316] Revert "append instead" This reverts commit 5abdf6b6e15b7ee6178fc8c236aaee623d8672b3. --- opendbc/car/hyundai/carcontroller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/carcontroller.py b/opendbc/car/hyundai/carcontroller.py index 268528395de..92f2434f067 100644 --- a/opendbc/car/hyundai/carcontroller.py +++ b/opendbc/car/hyundai/carcontroller.py @@ -117,7 +117,7 @@ def update(self, CC, CS, now_nanos): # LFA and HDA icons if self.frame % 5 == 0 and (not lka_steering or lka_steering_long): if self.CP.flags & HyundaiFlags.CCNC: - can_sends.append(hyundaicanfd.create_ccnc(self.packer, self.CAN, self.CP, CC, CS, apply_steer_req)) + can_sends.extend(hyundaicanfd.create_ccnc(self.packer, self.CAN, self.CP, CC, CS, apply_steer_req)) else: can_sends.append(hyundaicanfd.create_lfahda_cluster(self.packer, self.CAN, CC.enabled)) From 1c21c0253f23050dcdb2dc8d7c885400bb488f3e Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 4 Mar 2025 13:10:44 -0500 Subject: [PATCH 168/316] lane change --- opendbc/car/hyundai/hyundaicanfd.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 037a0b8fd1e..f05efe0f1c9 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -164,7 +164,19 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): 0 if not lat_active else 2 if CS.out.rightBlindspot or CS.out.vEgo < 8.94 else 6 ), - "LFA_ICON": 2 if lat_active else 0, + "LCA_LEFT_ICON": ( + 1 if not lat_active else + 4 if CS.out.leftBlindspot or CS.out.vEgo < 8.94 else 2 + ), + "LCA_RIGHT_ICON": ( + 1 if not lat_active else + 4 if CS.out.rightBlindspot or CS.out.vEgo < 8.94 else 2 + ), + "LCA_LEFT_ARROW": 2 if CC.leftBlinker else 0, + "LCA_RIGHT_ARROW": 2 if CC.rightBlinker else 0, + "LANE_LEFT": 1 if CC.leftBlinker else 0, + "LANE_RIGHT": 1 if CC.rightBlinker else 0, + "LFA_ICON": 2 if lat_active else 1, "LKA_ICON": 0, }) From 2ad37a8773d7f2a308ee681eb2e92e8e3c597aa0 Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 4 Mar 2025 14:29:43 -0500 Subject: [PATCH 169/316] better arrows --- opendbc/car/hyundai/hyundaicanfd.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index f05efe0f1c9..3af54a5d1a0 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -165,12 +165,10 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): 2 if CS.out.rightBlindspot or CS.out.vEgo < 8.94 else 6 ), "LCA_LEFT_ICON": ( - 1 if not lat_active else - 4 if CS.out.leftBlindspot or CS.out.vEgo < 8.94 else 2 + 1 if not lat_active or CS.out.leftBlindspot or CS.out.vEgo < 8.94 else 2 ), "LCA_RIGHT_ICON": ( - 1 if not lat_active else - 4 if CS.out.rightBlindspot or CS.out.vEgo < 8.94 else 2 + 1 if not lat_active or CS.out.rightBlindspot or CS.out.vEgo < 8.94 else 2 ), "LCA_LEFT_ARROW": 2 if CC.leftBlinker else 0, "LCA_RIGHT_ARROW": 2 if CC.rightBlinker else 0, From 2ce621eaa100a902084161c88cd376e7dd8057fe Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 4 Mar 2025 14:30:17 -0500 Subject: [PATCH 170/316] curvature --- opendbc/car/hyundai/hyundaicanfd.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 3af54a5d1a0..15c727df6f2 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -149,6 +149,7 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): if msg_161.get("SOUNDS_4") == 2 and msg_161.get("LFA_ICON") in (3, 0,): # LFA BEEPS msg_161["SOUNDS_4"] = 0 + curvature = {i: (31 if i == -1 else 13 - abs(i + 15)) if i < 0 else 15 + i for i in range(-15, 16)} msg_161.update({ "DAW_ICON": 0, "CENTERLINE": 1 if lat_active else 0, @@ -174,6 +175,7 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): "LCA_RIGHT_ARROW": 2 if CC.rightBlinker else 0, "LANE_LEFT": 1 if CC.leftBlinker else 0, "LANE_RIGHT": 1 if CC.rightBlinker else 0, + "LANELINE_CURVATURE": curvature.get(max(-15, min(int(CS.out.steeringAngleDeg / 4), 15)), 14) if lat_active else 15, "LFA_ICON": 2 if lat_active else 1, "LKA_ICON": 0, }) From 86c666b4de2b66a3283bcd3b6fce05f291860189 Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 4 Mar 2025 14:36:11 -0500 Subject: [PATCH 171/316] better match --- opendbc/car/hyundai/hyundaicanfd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 15c727df6f2..790f60de774 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -175,7 +175,7 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): "LCA_RIGHT_ARROW": 2 if CC.rightBlinker else 0, "LANE_LEFT": 1 if CC.leftBlinker else 0, "LANE_RIGHT": 1 if CC.rightBlinker else 0, - "LANELINE_CURVATURE": curvature.get(max(-15, min(int(CS.out.steeringAngleDeg / 4), 15)), 14) if lat_active else 15, + "LANELINE_CURVATURE": curvature.get(max(-15, min(int(CS.out.steeringAngleDeg / 5), 15)), 14) if lat_active else 15, "LFA_ICON": 2 if lat_active else 1, "LKA_ICON": 0, }) From 02edda8efd91bfbac7263bbbb9793aa19097c7fc Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 4 Mar 2025 14:49:32 -0500 Subject: [PATCH 172/316] fix on standstill --- opendbc/car/hyundai/hyundaicanfd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 790f60de774..a631c756f0c 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -152,7 +152,7 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): curvature = {i: (31 if i == -1 else 13 - abs(i + 15)) if i < 0 else 15 + i for i in range(-15, 16)} msg_161.update({ "DAW_ICON": 0, - "CENTERLINE": 1 if lat_active else 0, + "CENTERLINE": 1 if lat_active or enabled else 0, "LANELINE_LEFT": ( 1 if not hud.leftLaneVisible else 4 if hud.leftLaneDepart else @@ -176,7 +176,7 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): "LANE_LEFT": 1 if CC.leftBlinker else 0, "LANE_RIGHT": 1 if CC.rightBlinker else 0, "LANELINE_CURVATURE": curvature.get(max(-15, min(int(CS.out.steeringAngleDeg / 5), 15)), 14) if lat_active else 15, - "LFA_ICON": 2 if lat_active else 1, + "LFA_ICON": 2 if lat_active or enabled else 1, "LKA_ICON": 0, }) From b53f71338f6f9cee59c2a1be426ab0c73b39ae31 Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 4 Mar 2025 15:08:22 -0500 Subject: [PATCH 173/316] always curve --- opendbc/car/hyundai/hyundaicanfd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index a631c756f0c..bfc7f9b4933 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -175,7 +175,7 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): "LCA_RIGHT_ARROW": 2 if CC.rightBlinker else 0, "LANE_LEFT": 1 if CC.leftBlinker else 0, "LANE_RIGHT": 1 if CC.rightBlinker else 0, - "LANELINE_CURVATURE": curvature.get(max(-15, min(int(CS.out.steeringAngleDeg / 5), 15)), 14) if lat_active else 15, + "LANELINE_CURVATURE": curvature.get(max(-15, min(int(CS.out.steeringAngleDeg / 5), 15)), 14) if lat_active or enabled else 15, "LFA_ICON": 2 if lat_active or enabled else 1, "LKA_ICON": 0, }) From 390a0aae42b7d9ea020270c9848122a5772bea00 Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 4 Mar 2025 15:09:00 -0500 Subject: [PATCH 174/316] more curve --- opendbc/car/hyundai/hyundaicanfd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index bfc7f9b4933..b6055435132 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -175,7 +175,7 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): "LCA_RIGHT_ARROW": 2 if CC.rightBlinker else 0, "LANE_LEFT": 1 if CC.leftBlinker else 0, "LANE_RIGHT": 1 if CC.rightBlinker else 0, - "LANELINE_CURVATURE": curvature.get(max(-15, min(int(CS.out.steeringAngleDeg / 5), 15)), 14) if lat_active or enabled else 15, + "LANELINE_CURVATURE": curvature.get(max(-15, min(int(CS.out.steeringAngleDeg / 4.5), 15)), 14) if lat_active or enabled else 15, "LFA_ICON": 2 if lat_active or enabled else 1, "LKA_ICON": 0, }) From dc8664c4f558639750d44ce23604203d6f7ed9b5 Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 4 Mar 2025 17:16:33 -0500 Subject: [PATCH 175/316] both cases --- opendbc/car/hyundai/hyundaicanfd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index b6055435132..9f46149a6b6 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -156,13 +156,13 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): "LANELINE_LEFT": ( 1 if not hud.leftLaneVisible else 4 if hud.leftLaneDepart else - 0 if not lat_active else + 0 if not (lat_active or enabled) else 2 if CS.out.leftBlindspot or CS.out.vEgo < 8.94 else 6 ), "LANELINE_RIGHT": ( 1 if not hud.rightLaneVisible else 4 if hud.rightLaneDepart else - 0 if not lat_active else + 0 if not (lat_active or enabled) else 2 if CS.out.rightBlindspot or CS.out.vEgo < 8.94 else 6 ), "LCA_LEFT_ICON": ( From a6809f5b07c0336b79b89e874a079953d3300255 Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 4 Mar 2025 19:17:26 -0500 Subject: [PATCH 176/316] remove LCA icons --- opendbc/car/hyundai/hyundaicanfd.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 9f46149a6b6..e9a676fc6c2 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -165,12 +165,6 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): 0 if not (lat_active or enabled) else 2 if CS.out.rightBlindspot or CS.out.vEgo < 8.94 else 6 ), - "LCA_LEFT_ICON": ( - 1 if not lat_active or CS.out.leftBlindspot or CS.out.vEgo < 8.94 else 2 - ), - "LCA_RIGHT_ICON": ( - 1 if not lat_active or CS.out.rightBlindspot or CS.out.vEgo < 8.94 else 2 - ), "LCA_LEFT_ARROW": 2 if CC.leftBlinker else 0, "LCA_RIGHT_ARROW": 2 if CC.rightBlinker else 0, "LANE_LEFT": 1 if CC.leftBlinker else 0, From 3520ee73fc8fb5c5bde2c14c5b5e1d28facdca7c Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 4 Mar 2025 21:14:57 -0500 Subject: [PATCH 177/316] ldw --- opendbc/car/hyundai/hyundaicanfd.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index e9a676fc6c2..5eeaebeac8d 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -174,6 +174,9 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): "LKA_ICON": 0, }) + if hud.leftLaneDepart or hud.rightLaneDepart: + msg_162["VIBRATE"] = 1 + if CP.openpilotLongitudinalControl: msg_161.update({ "SETSPEED": 3 if enabled else 1, From dcb0b4e1a7cd94651b3f7994c3de5f4a8b1e24c4 Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 4 Mar 2025 23:43:10 -0500 Subject: [PATCH 178/316] use stock lead distance --- opendbc/car/hyundai/hyundaicanfd.py | 1 - 1 file changed, 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 5eeaebeac8d..95b524d64fc 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -192,7 +192,6 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): msg_162.update({ "LEAD": 2 if enabled and hud.leadVisible else 1 if hud.leadVisible else 0, - "LEAD_DISTANCE": 10, }) return [packer.make_can_msg(msg, CAN.ECAN, data) for msg, data in [("CCNC_0x161", msg_161), ("CCNC_0x162", msg_162)]] From 48342ddff1091588e5f206cd2f577bfbe9623103 Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 4 Mar 2025 23:49:18 -0500 Subject: [PATCH 179/316] no curvature --- opendbc/car/hyundai/hyundaicanfd.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 95b524d64fc..d39b7f56371 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -149,7 +149,6 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): if msg_161.get("SOUNDS_4") == 2 and msg_161.get("LFA_ICON") in (3, 0,): # LFA BEEPS msg_161["SOUNDS_4"] = 0 - curvature = {i: (31 if i == -1 else 13 - abs(i + 15)) if i < 0 else 15 + i for i in range(-15, 16)} msg_161.update({ "DAW_ICON": 0, "CENTERLINE": 1 if lat_active or enabled else 0, @@ -169,7 +168,6 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): "LCA_RIGHT_ARROW": 2 if CC.rightBlinker else 0, "LANE_LEFT": 1 if CC.leftBlinker else 0, "LANE_RIGHT": 1 if CC.rightBlinker else 0, - "LANELINE_CURVATURE": curvature.get(max(-15, min(int(CS.out.steeringAngleDeg / 4.5), 15)), 14) if lat_active or enabled else 15, "LFA_ICON": 2 if lat_active or enabled else 1, "LKA_ICON": 0, }) From 7c861f274373d2d3ffae191c187a6762836389f2 Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 4 Mar 2025 23:58:05 -0500 Subject: [PATCH 180/316] leadless --- opendbc/car/hyundai/hyundaicanfd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index d39b7f56371..e157015fbd8 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -189,7 +189,7 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): }) msg_162.update({ - "LEAD": 2 if enabled and hud.leadVisible else 1 if hud.leadVisible else 0, + "LEAD": 0, }) return [packer.make_can_msg(msg, CAN.ECAN, data) for msg, data in [("CCNC_0x161", msg_161), ("CCNC_0x162", msg_162)]] From 1b623004c475f49b602bc144e5cb551523fd14e2 Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 4 Mar 2025 23:58:39 -0500 Subject: [PATCH 181/316] no distance messages --- opendbc/car/hyundai/hyundaicanfd.py | 1 - 1 file changed, 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index e157015fbd8..cc9d70b2a79 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -184,7 +184,6 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): "DISTANCE_SPACING": 1 if enabled else 0, "DISTANCE_LEAD": 2 if enabled and hud.leadVisible else 1 if enabled else 0, "DISTANCE_CAR": 2 if enabled else 1, - "ALERTS_3": hud.leadDistanceBars + 6, "FCA_ICON": 1, }) From e12e26f1b3c3b07e49b4143f440ea8e6c3ce75f8 Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 4 Mar 2025 23:59:04 -0500 Subject: [PATCH 182/316] no FCA_ICON --- opendbc/car/hyundai/hyundaicanfd.py | 1 - 1 file changed, 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index cc9d70b2a79..d635d3af64a 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -184,7 +184,6 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): "DISTANCE_SPACING": 1 if enabled else 0, "DISTANCE_LEAD": 2 if enabled and hud.leadVisible else 1 if enabled else 0, "DISTANCE_CAR": 2 if enabled else 1, - "FCA_ICON": 1, }) msg_162.update({ From 96a2bd4e10959500cfef68377e6133e075c8de14 Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 4 Mar 2025 23:59:40 -0500 Subject: [PATCH 183/316] better --- opendbc/car/hyundai/hyundaicanfd.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index d635d3af64a..ab70237627a 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -185,10 +185,8 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): "DISTANCE_LEAD": 2 if enabled and hud.leadVisible else 1 if enabled else 0, "DISTANCE_CAR": 2 if enabled else 1, }) - - msg_162.update({ - "LEAD": 0, - }) + + msg_162["LEAD"] = 0 return [packer.make_can_msg(msg, CAN.ECAN, data) for msg, data in [("CCNC_0x161", msg_161), ("CCNC_0x162", msg_162)]] From 078961999664d50d97586a4974c0e5fb91cbea5f Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 5 Mar 2025 00:03:37 -0500 Subject: [PATCH 184/316] fix ws --- opendbc/car/hyundai/hyundaicanfd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index ab70237627a..7990a277a85 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -185,7 +185,7 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): "DISTANCE_LEAD": 2 if enabled and hud.leadVisible else 1 if enabled else 0, "DISTANCE_CAR": 2 if enabled else 1, }) - + msg_162["LEAD"] = 0 return [packer.make_can_msg(msg, CAN.ECAN, data) for msg, data in [("CCNC_0x161", msg_161), ("CCNC_0x162", msg_162)]] From 2b9ace7db182b38d1d5ffdc49e20af393f4fa8fd Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 5 Mar 2025 00:04:26 -0500 Subject: [PATCH 185/316] to signify op long --- opendbc/car/hyundai/hyundaicanfd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 7990a277a85..c7c4053b276 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -183,7 +183,7 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): "DISTANCE": hud.leadDistanceBars, "DISTANCE_SPACING": 1 if enabled else 0, "DISTANCE_LEAD": 2 if enabled and hud.leadVisible else 1 if enabled else 0, - "DISTANCE_CAR": 2 if enabled else 1, + "DISTANCE_CAR": 3 if enabled else 1, }) msg_162["LEAD"] = 0 From ab33ebcc9900189808545bd75616dd9f2d54f2d8 Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 5 Mar 2025 00:08:01 -0500 Subject: [PATCH 186/316] always show spacing --- opendbc/car/hyundai/hyundaicanfd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index c7c4053b276..8b7785f6c52 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -181,7 +181,7 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): "SETSPEED_HUD": 2 if enabled else 1, "SETSPEED_SPEED": 25 if (s := round(CS.out.vCruiseCluster * (1 if CS.is_metric else CV.KPH_TO_MPH))) > 100 else s, "DISTANCE": hud.leadDistanceBars, - "DISTANCE_SPACING": 1 if enabled else 0, + "DISTANCE_SPACING": 1 if enabled else 3, "DISTANCE_LEAD": 2 if enabled and hud.leadVisible else 1 if enabled else 0, "DISTANCE_CAR": 3 if enabled else 1, }) From c4622d373b7c906aa8bd46d9444ff2bf6c966094 Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 5 Mar 2025 00:09:23 -0500 Subject: [PATCH 187/316] white car --- opendbc/car/hyundai/hyundaicanfd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 8b7785f6c52..4b745f31a0a 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -183,7 +183,7 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): "DISTANCE": hud.leadDistanceBars, "DISTANCE_SPACING": 1 if enabled else 3, "DISTANCE_LEAD": 2 if enabled and hud.leadVisible else 1 if enabled else 0, - "DISTANCE_CAR": 3 if enabled else 1, + "DISTANCE_CAR": 2 if enabled else 1, }) msg_162["LEAD"] = 0 From b7a2fef74b102ba57eceba1a367a8fc3e8d89cd8 Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 5 Mar 2025 19:55:51 -0500 Subject: [PATCH 188/316] test --- opendbc/car/hyundai/hyundaicanfd.py | 1 + 1 file changed, 1 insertion(+) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 4b745f31a0a..303c5c60520 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -1,3 +1,4 @@ +# test import copy import numpy as np from opendbc.car import CanBusBase From 961101a8e69b6148b5b9d38218f0cf9e30145759 Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 5 Mar 2025 20:04:24 -0500 Subject: [PATCH 189/316] Revert "test" This reverts commit b7a2fef74b102ba57eceba1a367a8fc3e8d89cd8. --- opendbc/car/hyundai/hyundaicanfd.py | 1 - 1 file changed, 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 303c5c60520..4b745f31a0a 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -1,4 +1,3 @@ -# test import copy import numpy as np from opendbc.car import CanBusBase From e25adb27ea5c4e254ad89a0f3820a335361aed62 Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 6 Mar 2025 15:40:03 -0500 Subject: [PATCH 190/316] cleaner --- opendbc/car/hyundai/hyundaicanfd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 4b745f31a0a..1e00def8771 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -151,6 +151,8 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): msg_161.update({ "DAW_ICON": 0, + "LKA_ICON": 0, + "LFA_ICON": 2 if lat_active or enabled else 1, "CENTERLINE": 1 if lat_active or enabled else 0, "LANELINE_LEFT": ( 1 if not hud.leftLaneVisible else @@ -168,8 +170,6 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): "LCA_RIGHT_ARROW": 2 if CC.rightBlinker else 0, "LANE_LEFT": 1 if CC.leftBlinker else 0, "LANE_RIGHT": 1 if CC.rightBlinker else 0, - "LFA_ICON": 2 if lat_active or enabled else 1, - "LKA_ICON": 0, }) if hud.leftLaneDepart or hud.rightLaneDepart: From 1b225ac3688ddbd45a775cb2dae2f88e570bfb65 Mon Sep 17 00:00:00 2001 From: royjr Date: Fri, 7 Mar 2025 10:54:23 -0500 Subject: [PATCH 191/316] match stock --- opendbc/car/hyundai/hyundaicanfd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 1e00def8771..d279762dc32 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -181,7 +181,7 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): "SETSPEED_HUD": 2 if enabled else 1, "SETSPEED_SPEED": 25 if (s := round(CS.out.vCruiseCluster * (1 if CS.is_metric else CV.KPH_TO_MPH))) > 100 else s, "DISTANCE": hud.leadDistanceBars, - "DISTANCE_SPACING": 1 if enabled else 3, + "DISTANCE_SPACING": 1 if enabled else 0, "DISTANCE_LEAD": 2 if enabled and hud.leadVisible else 1 if enabled else 0, "DISTANCE_CAR": 2 if enabled else 1, }) From 9cd51fbc57123a06bceecaed3ef21849959eee9b Mon Sep 17 00:00:00 2001 From: royjr Date: Fri, 7 Mar 2025 11:11:14 -0500 Subject: [PATCH 192/316] HIDE DISTANCE, ISLA MESSAGES --- opendbc/car/hyundai/hyundaicanfd.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index d279762dc32..19ec5f4c570 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -186,6 +186,9 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): "DISTANCE_CAR": 2 if enabled else 1, }) + if msg_161.get("ALERTS_3") in (1 ,2, 3, 4, 7, 8, 9, 10): # HIDE DISTANCE, ISLA MESSAGES + msg_161["ALERTS_3"] = 0 + msg_162["LEAD"] = 0 return [packer.make_can_msg(msg, CAN.ECAN, data) for msg, data in [("CCNC_0x161", msg_161), ("CCNC_0x162", msg_162)]] From b3ecec1c4bb01a43a90e650ba79888d3b8a2ea54 Mon Sep 17 00:00:00 2001 From: royjr Date: Fri, 7 Mar 2025 14:01:56 -0500 Subject: [PATCH 193/316] better comments to match numbers --- opendbc/car/hyundai/hyundaicanfd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 19ec5f4c570..f89264207bd 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -186,7 +186,7 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): "DISTANCE_CAR": 2 if enabled else 1, }) - if msg_161.get("ALERTS_3") in (1 ,2, 3, 4, 7, 8, 9, 10): # HIDE DISTANCE, ISLA MESSAGES + if msg_161.get("ALERTS_3") in (1 ,2, 3, 4, 7, 8, 9, 10): # HIDE ISLA, DISTANCE MESSAGES msg_161["ALERTS_3"] = 0 msg_162["LEAD"] = 0 From df406aece987bbf6a111284fe6910238324d9365 Mon Sep 17 00:00:00 2001 From: royjr Date: Fri, 7 Mar 2025 14:02:15 -0500 Subject: [PATCH 194/316] hide ISLA icons --- opendbc/car/hyundai/hyundaicanfd.py | 1 + 1 file changed, 1 insertion(+) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index f89264207bd..3c88d60098a 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -184,6 +184,7 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): "DISTANCE_SPACING": 1 if enabled else 0, "DISTANCE_LEAD": 2 if enabled and hud.leadVisible else 1 if enabled else 0, "DISTANCE_CAR": 2 if enabled else 1, + "SLA_ICON": 0, }) if msg_161.get("ALERTS_3") in (1 ,2, 3, 4, 7, 8, 9, 10): # HIDE ISLA, DISTANCE MESSAGES From a008a6b46282c463f377791c962f6780247255be Mon Sep 17 00:00:00 2001 From: royjr Date: Fri, 7 Mar 2025 17:00:46 -0500 Subject: [PATCH 195/316] show gray nav icon if nav available --- opendbc/car/hyundai/hyundaicanfd.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 3c88d60098a..b9cd30cf7a8 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -190,6 +190,9 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): if msg_161.get("ALERTS_3") in (1 ,2, 3, 4, 7, 8, 9, 10): # HIDE ISLA, DISTANCE MESSAGES msg_161["ALERTS_3"] = 0 + if msg_161.get("NAV_ICON") in (2, 4): # DISABLE NAV IF AVAILABLE + msg_161["NAV_ICON"] = 1 + msg_162["LEAD"] = 0 return [packer.make_can_msg(msg, CAN.ECAN, data) for msg, data in [("CCNC_0x161", msg_161), ("CCNC_0x162", msg_162)]] From 98680f72fd5cdb152dec9819c48332b2e448b84e Mon Sep 17 00:00:00 2001 From: royjr Date: Fri, 7 Mar 2025 17:00:59 -0500 Subject: [PATCH 196/316] hide TARGET --- opendbc/car/hyundai/hyundaicanfd.py | 1 + 1 file changed, 1 insertion(+) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index b9cd30cf7a8..e57a41f4e60 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -185,6 +185,7 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): "DISTANCE_LEAD": 2 if enabled and hud.leadVisible else 1 if enabled else 0, "DISTANCE_CAR": 2 if enabled else 1, "SLA_ICON": 0, + "TARGET": 0, }) if msg_161.get("ALERTS_3") in (1 ,2, 3, 4, 7, 8, 9, 10): # HIDE ISLA, DISTANCE MESSAGES From 0145cada53b5547a554ec19916918515d122e262 Mon Sep 17 00:00:00 2001 From: royjr Date: Fri, 7 Mar 2025 17:15:26 -0500 Subject: [PATCH 197/316] set over tuple --- opendbc/car/hyundai/hyundaicanfd.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index e57a41f4e60..81175430e82 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -128,7 +128,7 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): msg_161, msg_162 = CS.msg_161.copy(), CS.msg_162.copy() enabled, hud = CC.enabled, CC.hudControl - for f in ("FAULT_LSS", "FAULT_HDA", "FAULT_DAS", "FAULT_LFA", "FAULT_DAW"): + for f in {"FAULT_LSS", "FAULT_HDA", "FAULT_DAS", "FAULT_LFA", "FAULT_DAW"}: msg_162[f] = 0 if msg_161.get("ALERTS_3") == 17: # DRIVE_CAREFULLY @@ -146,7 +146,7 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): if msg_161.get("ALERTS_2") == 5: # CONSIDER_TAKING_A_BREAK msg_161.update({"ALERTS_2": 0, "SOUNDS_2": 0}) - if msg_161.get("SOUNDS_4") == 2 and msg_161.get("LFA_ICON") in (3, 0,): # LFA BEEPS + if msg_161.get("SOUNDS_4") == 2 and msg_161.get("LFA_ICON") in {3, 0,}: # LFA BEEPS msg_161["SOUNDS_4"] = 0 msg_161.update({ @@ -188,10 +188,10 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): "TARGET": 0, }) - if msg_161.get("ALERTS_3") in (1 ,2, 3, 4, 7, 8, 9, 10): # HIDE ISLA, DISTANCE MESSAGES + if msg_161.get("ALERTS_3") in {1, 2, 3, 4, 7, 8, 9, 10}: # HIDE ISLA, DISTANCE MESSAGES msg_161["ALERTS_3"] = 0 - if msg_161.get("NAV_ICON") in (2, 4): # DISABLE NAV IF AVAILABLE + if msg_161.get("NAV_ICON") in {2, 4}: # DISABLE NAV IF AVAILABLE msg_161["NAV_ICON"] = 1 msg_162["LEAD"] = 0 From cac602998975a3e15cacbb23ac2e2fbdc82fd7de Mon Sep 17 00:00:00 2001 From: royjr Date: Fri, 7 Mar 2025 17:22:22 -0500 Subject: [PATCH 198/316] combine --- opendbc/car/hyundai/hyundaicanfd.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 81175430e82..b999a173764 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -134,13 +134,7 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): if msg_161.get("ALERTS_3") == 17: # DRIVE_CAREFULLY msg_161["ALERTS_3"] = 0 - if msg_161.get("ALERTS_5") == 2: # WATCH_FOR_SURROUNDING_VEHICLES - msg_161["ALERTS_5"] = 0 - - if msg_161.get("ALERTS_5") == 4: # SMART_CRUISE_CONTROL_CONDITIONS_NOT_MET - msg_161["ALERTS_5"] = 0 - - if msg_161.get("ALERTS_5") == 5: # USE_SWITCH_OR_PEDAL_TO_ACCELERATE + if msg_161.get("ALERTS_5") in {2, 4, 5}: # WATCH_FOR_SURROUNDING_VEHICLES, SMART_CRUISE_CONTROL_CONDITIONS_NOT_MET, USE_SWITCH_OR_PEDAL_TO_ACCELERATE msg_161["ALERTS_5"] = 0 if msg_161.get("ALERTS_2") == 5: # CONSIDER_TAKING_A_BREAK From 1ca8ffcfcc67fbfab3a79f9b3bc1805bd71e11d1 Mon Sep 17 00:00:00 2001 From: royjr Date: Fri, 7 Mar 2025 17:22:49 -0500 Subject: [PATCH 199/316] reorder --- opendbc/car/hyundai/hyundaicanfd.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index b999a173764..86cbc4e51e3 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -131,15 +131,15 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): for f in {"FAULT_LSS", "FAULT_HDA", "FAULT_DAS", "FAULT_LFA", "FAULT_DAW"}: msg_162[f] = 0 + if msg_161.get("ALERTS_2") == 5: # CONSIDER_TAKING_A_BREAK + msg_161.update({"ALERTS_2": 0, "SOUNDS_2": 0}) + if msg_161.get("ALERTS_3") == 17: # DRIVE_CAREFULLY msg_161["ALERTS_3"] = 0 if msg_161.get("ALERTS_5") in {2, 4, 5}: # WATCH_FOR_SURROUNDING_VEHICLES, SMART_CRUISE_CONTROL_CONDITIONS_NOT_MET, USE_SWITCH_OR_PEDAL_TO_ACCELERATE msg_161["ALERTS_5"] = 0 - if msg_161.get("ALERTS_2") == 5: # CONSIDER_TAKING_A_BREAK - msg_161.update({"ALERTS_2": 0, "SOUNDS_2": 0}) - if msg_161.get("SOUNDS_4") == 2 and msg_161.get("LFA_ICON") in {3, 0,}: # LFA BEEPS msg_161["SOUNDS_4"] = 0 From 03dfb892767de18a9a25b622f380bf729aa8506e Mon Sep 17 00:00:00 2001 From: royjr Date: Fri, 7 Mar 2025 17:27:17 -0500 Subject: [PATCH 200/316] no copy --- opendbc/car/hyundai/hyundaicanfd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 86cbc4e51e3..1334f8fb467 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -125,7 +125,7 @@ def create_lfahda_cluster(packer, CAN, enabled): return packer.make_can_msg("LFAHDA_CLUSTER", CAN.ECAN, values) def create_ccnc(packer, CAN, CP, CC, CS, lat_active): - msg_161, msg_162 = CS.msg_161.copy(), CS.msg_162.copy() + msg_161, msg_162 = CS.msg_161, CS.msg_162 enabled, hud = CC.enabled, CC.hudControl for f in {"FAULT_LSS", "FAULT_HDA", "FAULT_DAS", "FAULT_LFA", "FAULT_DAW"}: From e7a2a071c163fd53020d27c074824dc016a2840d Mon Sep 17 00:00:00 2001 From: royjr Date: Fri, 7 Mar 2025 17:49:21 -0500 Subject: [PATCH 201/316] tuples are faster --- opendbc/car/hyundai/hyundaicanfd.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 1334f8fb467..1ee2ff629f2 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -137,10 +137,10 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): if msg_161.get("ALERTS_3") == 17: # DRIVE_CAREFULLY msg_161["ALERTS_3"] = 0 - if msg_161.get("ALERTS_5") in {2, 4, 5}: # WATCH_FOR_SURROUNDING_VEHICLES, SMART_CRUISE_CONTROL_CONDITIONS_NOT_MET, USE_SWITCH_OR_PEDAL_TO_ACCELERATE + if msg_161.get("ALERTS_5") in (2, 4, 5): # WATCH_FOR_SURROUNDING_VEHICLES, SMART_CRUISE_CONTROL_CONDITIONS_NOT_MET, USE_SWITCH_OR_PEDAL_TO_ACCELERATE msg_161["ALERTS_5"] = 0 - if msg_161.get("SOUNDS_4") == 2 and msg_161.get("LFA_ICON") in {3, 0,}: # LFA BEEPS + if msg_161.get("SOUNDS_4") == 2 and msg_161.get("LFA_ICON") in (3, 0,): # LFA BEEPS msg_161["SOUNDS_4"] = 0 msg_161.update({ @@ -182,10 +182,10 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): "TARGET": 0, }) - if msg_161.get("ALERTS_3") in {1, 2, 3, 4, 7, 8, 9, 10}: # HIDE ISLA, DISTANCE MESSAGES + if msg_161.get("ALERTS_3") in (1, 2, 3, 4, 7, 8, 9, 10): # HIDE ISLA, DISTANCE MESSAGES msg_161["ALERTS_3"] = 0 - if msg_161.get("NAV_ICON") in {2, 4}: # DISABLE NAV IF AVAILABLE + if msg_161.get("NAV_ICON") in (2, 4): # DISABLE NAV IF AVAILABLE msg_161["NAV_ICON"] = 1 msg_162["LEAD"] = 0 From bddbbe13533f85f7c9fa19a2175ace353b705b29 Mon Sep 17 00:00:00 2001 From: royjr Date: Fri, 7 Mar 2025 17:59:00 -0500 Subject: [PATCH 202/316] getless --- opendbc/car/hyundai/hyundaicanfd.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 1ee2ff629f2..4d19ef017e8 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -131,16 +131,16 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): for f in {"FAULT_LSS", "FAULT_HDA", "FAULT_DAS", "FAULT_LFA", "FAULT_DAW"}: msg_162[f] = 0 - if msg_161.get("ALERTS_2") == 5: # CONSIDER_TAKING_A_BREAK + if msg_161["ALERTS_2"] == 5: # CONSIDER_TAKING_A_BREAK msg_161.update({"ALERTS_2": 0, "SOUNDS_2": 0}) - if msg_161.get("ALERTS_3") == 17: # DRIVE_CAREFULLY + if msg_161["ALERTS_3"] == 17: # DRIVE_CAREFULLY msg_161["ALERTS_3"] = 0 - if msg_161.get("ALERTS_5") in (2, 4, 5): # WATCH_FOR_SURROUNDING_VEHICLES, SMART_CRUISE_CONTROL_CONDITIONS_NOT_MET, USE_SWITCH_OR_PEDAL_TO_ACCELERATE + if msg_161["ALERTS_5"] in (2, 4, 5): # WATCH_FOR_SURROUNDING_VEHICLES, SMART_CRUISE_CONTROL_CONDITIONS_NOT_MET, USE_SWITCH_OR_PEDAL_TO_ACCELERATE msg_161["ALERTS_5"] = 0 - if msg_161.get("SOUNDS_4") == 2 and msg_161.get("LFA_ICON") in (3, 0,): # LFA BEEPS + if msg_161["SOUNDS_4"] == 2 and msg_161["LFA_ICON"] in (3, 0,): # LFA BEEPS msg_161["SOUNDS_4"] = 0 msg_161.update({ @@ -182,10 +182,10 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): "TARGET": 0, }) - if msg_161.get("ALERTS_3") in (1, 2, 3, 4, 7, 8, 9, 10): # HIDE ISLA, DISTANCE MESSAGES + if msg_161["ALERTS_3"] in (1, 2, 3, 4, 7, 8, 9, 10): # HIDE ISLA, DISTANCE MESSAGES msg_161["ALERTS_3"] = 0 - if msg_161.get("NAV_ICON") in (2, 4): # DISABLE NAV IF AVAILABLE + if msg_161["NAV_ICON"] in (2, 4): # DISABLE NAV IF AVAILABLE msg_161["NAV_ICON"] = 1 msg_162["LEAD"] = 0 From eb882a64811e058128bc78063c7dfdbc4cd9c455 Mon Sep 17 00:00:00 2001 From: royjr Date: Fri, 7 Mar 2025 18:12:25 -0500 Subject: [PATCH 203/316] just hide nav --- opendbc/car/hyundai/hyundaicanfd.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 4d19ef017e8..dd9a096aee1 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -179,15 +179,13 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): "DISTANCE_LEAD": 2 if enabled and hud.leadVisible else 1 if enabled else 0, "DISTANCE_CAR": 2 if enabled else 1, "SLA_ICON": 0, + "NAV_ICON": 0, "TARGET": 0, }) if msg_161["ALERTS_3"] in (1, 2, 3, 4, 7, 8, 9, 10): # HIDE ISLA, DISTANCE MESSAGES msg_161["ALERTS_3"] = 0 - if msg_161["NAV_ICON"] in (2, 4): # DISABLE NAV IF AVAILABLE - msg_161["NAV_ICON"] = 1 - msg_162["LEAD"] = 0 return [packer.make_can_msg(msg, CAN.ECAN, data) for msg, data in [("CCNC_0x161", msg_161), ("CCNC_0x162", msg_162)]] From 3715f83e8e38c9a483e0c67dfda858a8efee1650 Mon Sep 17 00:00:00 2001 From: royjr Date: Fri, 7 Mar 2025 21:42:57 -0500 Subject: [PATCH 204/316] direct assign --- opendbc/car/hyundai/hyundaicanfd.py | 78 ++++++++++++++--------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index dd9a096aee1..2e882ab0515 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -128,11 +128,15 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): msg_161, msg_162 = CS.msg_161, CS.msg_162 enabled, hud = CC.enabled, CC.hudControl - for f in {"FAULT_LSS", "FAULT_HDA", "FAULT_DAS", "FAULT_LFA", "FAULT_DAW"}: - msg_162[f] = 0 + msg_162["FAULT_LSS"] = 0 + msg_162["FAULT_HDA"] = 0 + msg_162["FAULT_DAS"] = 0 + msg_162["FAULT_LFA"] = 0 + msg_162["FAULT_DAW"] = 0 if msg_161["ALERTS_2"] == 5: # CONSIDER_TAKING_A_BREAK - msg_161.update({"ALERTS_2": 0, "SOUNDS_2": 0}) + msg_161["ALERTS_2"] = 0 + msg_161["SOUNDS_2"] = 0 if msg_161["ALERTS_3"] == 17: # DRIVE_CAREFULLY msg_161["ALERTS_3"] = 0 @@ -143,47 +147,43 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): if msg_161["SOUNDS_4"] == 2 and msg_161["LFA_ICON"] in (3, 0,): # LFA BEEPS msg_161["SOUNDS_4"] = 0 - msg_161.update({ - "DAW_ICON": 0, - "LKA_ICON": 0, - "LFA_ICON": 2 if lat_active or enabled else 1, - "CENTERLINE": 1 if lat_active or enabled else 0, - "LANELINE_LEFT": ( - 1 if not hud.leftLaneVisible else - 4 if hud.leftLaneDepart else - 0 if not (lat_active or enabled) else - 2 if CS.out.leftBlindspot or CS.out.vEgo < 8.94 else 6 - ), - "LANELINE_RIGHT": ( - 1 if not hud.rightLaneVisible else - 4 if hud.rightLaneDepart else - 0 if not (lat_active or enabled) else - 2 if CS.out.rightBlindspot or CS.out.vEgo < 8.94 else 6 - ), - "LCA_LEFT_ARROW": 2 if CC.leftBlinker else 0, - "LCA_RIGHT_ARROW": 2 if CC.rightBlinker else 0, - "LANE_LEFT": 1 if CC.leftBlinker else 0, - "LANE_RIGHT": 1 if CC.rightBlinker else 0, - }) + msg_161["DAW_ICON"] = 0 + msg_161["LKA_ICON"] = 0 + msg_161["LFA_ICON"] = 2 if lat_active or enabled else 1 + msg_161["CENTERLINE"] = 1 if lat_active or enabled else 0 + msg_161["LANELINE_LEFT"] = ( + 1 if not hud.leftLaneVisible else + 4 if hud.leftLaneDepart else + 0 if not (lat_active or enabled) else + 2 if CS.out.leftBlindspot or CS.out.vEgo < 8.94 else 6 + ) + msg_161["LANELINE_RIGHT"] = ( + 1 if not hud.rightLaneVisible else + 4 if hud.rightLaneDepart else + 0 if not (lat_active or enabled) else + 2 if CS.out.rightBlindspot or CS.out.vEgo < 8.94 else 6 + ) + msg_161["LCA_LEFT_ARROW"] = 2 if CC.leftBlinker else 0 + msg_161["LCA_RIGHT_ARROW"] = 2 if CC.rightBlinker else 0 + msg_161["LANE_LEFT"] = 1 if CC.leftBlinker else 0 + msg_161["LANE_RIGHT"] = 1 if CC.rightBlinker else 0 if hud.leftLaneDepart or hud.rightLaneDepart: msg_162["VIBRATE"] = 1 if CP.openpilotLongitudinalControl: - msg_161.update({ - "SETSPEED": 3 if enabled else 1, - "SETSPEED_HUD": 2 if enabled else 1, - "SETSPEED_SPEED": 25 if (s := round(CS.out.vCruiseCluster * (1 if CS.is_metric else CV.KPH_TO_MPH))) > 100 else s, - "DISTANCE": hud.leadDistanceBars, - "DISTANCE_SPACING": 1 if enabled else 0, - "DISTANCE_LEAD": 2 if enabled and hud.leadVisible else 1 if enabled else 0, - "DISTANCE_CAR": 2 if enabled else 1, - "SLA_ICON": 0, - "NAV_ICON": 0, - "TARGET": 0, - }) - - if msg_161["ALERTS_3"] in (1, 2, 3, 4, 7, 8, 9, 10): # HIDE ISLA, DISTANCE MESSAGES + msg_161["SETSPEED"] = 3 if enabled else 1 + msg_161["SETSPEED_HUD"] = 2 if enabled else 1 + msg_161["SETSPEED_SPEED"] = 25 if (s := round(CS.out.vCruiseCluster * (1 if CS.is_metric else CV.KPH_TO_MPH))) > 100 else s + msg_161["DISTANCE"] = hud.leadDistanceBars + msg_161["DISTANCE_SPACING"] = 1 if enabled else 0 + msg_161["DISTANCE_LEAD"] = 2 if enabled and hud.leadVisible else 1 if enabled else 0 + msg_161["DISTANCE_CAR"] = 2 if enabled else 1 + msg_161["SLA_ICON"] = 0 + msg_161["NAV_ICON"] = 0 + msg_161["TARGET"] = 0 + + if msg_161.get("ALERTS_3", 0) in (1, 2, 3, 4, 7, 8, 9, 10): # HIDE ISLA, DISTANCE MESSAGES msg_161["ALERTS_3"] = 0 msg_162["LEAD"] = 0 From 525319223745a3f03f99c46e36641946c8ecbccb Mon Sep 17 00:00:00 2001 From: royjr Date: Fri, 7 Mar 2025 23:07:34 -0500 Subject: [PATCH 205/316] Revert "direct assign" This reverts commit 3715f83e8e38c9a483e0c67dfda858a8efee1650. --- opendbc/car/hyundai/hyundaicanfd.py | 78 ++++++++++++++--------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 2e882ab0515..dd9a096aee1 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -128,15 +128,11 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): msg_161, msg_162 = CS.msg_161, CS.msg_162 enabled, hud = CC.enabled, CC.hudControl - msg_162["FAULT_LSS"] = 0 - msg_162["FAULT_HDA"] = 0 - msg_162["FAULT_DAS"] = 0 - msg_162["FAULT_LFA"] = 0 - msg_162["FAULT_DAW"] = 0 + for f in {"FAULT_LSS", "FAULT_HDA", "FAULT_DAS", "FAULT_LFA", "FAULT_DAW"}: + msg_162[f] = 0 if msg_161["ALERTS_2"] == 5: # CONSIDER_TAKING_A_BREAK - msg_161["ALERTS_2"] = 0 - msg_161["SOUNDS_2"] = 0 + msg_161.update({"ALERTS_2": 0, "SOUNDS_2": 0}) if msg_161["ALERTS_3"] == 17: # DRIVE_CAREFULLY msg_161["ALERTS_3"] = 0 @@ -147,43 +143,47 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): if msg_161["SOUNDS_4"] == 2 and msg_161["LFA_ICON"] in (3, 0,): # LFA BEEPS msg_161["SOUNDS_4"] = 0 - msg_161["DAW_ICON"] = 0 - msg_161["LKA_ICON"] = 0 - msg_161["LFA_ICON"] = 2 if lat_active or enabled else 1 - msg_161["CENTERLINE"] = 1 if lat_active or enabled else 0 - msg_161["LANELINE_LEFT"] = ( - 1 if not hud.leftLaneVisible else - 4 if hud.leftLaneDepart else - 0 if not (lat_active or enabled) else - 2 if CS.out.leftBlindspot or CS.out.vEgo < 8.94 else 6 - ) - msg_161["LANELINE_RIGHT"] = ( - 1 if not hud.rightLaneVisible else - 4 if hud.rightLaneDepart else - 0 if not (lat_active or enabled) else - 2 if CS.out.rightBlindspot or CS.out.vEgo < 8.94 else 6 - ) - msg_161["LCA_LEFT_ARROW"] = 2 if CC.leftBlinker else 0 - msg_161["LCA_RIGHT_ARROW"] = 2 if CC.rightBlinker else 0 - msg_161["LANE_LEFT"] = 1 if CC.leftBlinker else 0 - msg_161["LANE_RIGHT"] = 1 if CC.rightBlinker else 0 + msg_161.update({ + "DAW_ICON": 0, + "LKA_ICON": 0, + "LFA_ICON": 2 if lat_active or enabled else 1, + "CENTERLINE": 1 if lat_active or enabled else 0, + "LANELINE_LEFT": ( + 1 if not hud.leftLaneVisible else + 4 if hud.leftLaneDepart else + 0 if not (lat_active or enabled) else + 2 if CS.out.leftBlindspot or CS.out.vEgo < 8.94 else 6 + ), + "LANELINE_RIGHT": ( + 1 if not hud.rightLaneVisible else + 4 if hud.rightLaneDepart else + 0 if not (lat_active or enabled) else + 2 if CS.out.rightBlindspot or CS.out.vEgo < 8.94 else 6 + ), + "LCA_LEFT_ARROW": 2 if CC.leftBlinker else 0, + "LCA_RIGHT_ARROW": 2 if CC.rightBlinker else 0, + "LANE_LEFT": 1 if CC.leftBlinker else 0, + "LANE_RIGHT": 1 if CC.rightBlinker else 0, + }) if hud.leftLaneDepart or hud.rightLaneDepart: msg_162["VIBRATE"] = 1 if CP.openpilotLongitudinalControl: - msg_161["SETSPEED"] = 3 if enabled else 1 - msg_161["SETSPEED_HUD"] = 2 if enabled else 1 - msg_161["SETSPEED_SPEED"] = 25 if (s := round(CS.out.vCruiseCluster * (1 if CS.is_metric else CV.KPH_TO_MPH))) > 100 else s - msg_161["DISTANCE"] = hud.leadDistanceBars - msg_161["DISTANCE_SPACING"] = 1 if enabled else 0 - msg_161["DISTANCE_LEAD"] = 2 if enabled and hud.leadVisible else 1 if enabled else 0 - msg_161["DISTANCE_CAR"] = 2 if enabled else 1 - msg_161["SLA_ICON"] = 0 - msg_161["NAV_ICON"] = 0 - msg_161["TARGET"] = 0 - - if msg_161.get("ALERTS_3", 0) in (1, 2, 3, 4, 7, 8, 9, 10): # HIDE ISLA, DISTANCE MESSAGES + msg_161.update({ + "SETSPEED": 3 if enabled else 1, + "SETSPEED_HUD": 2 if enabled else 1, + "SETSPEED_SPEED": 25 if (s := round(CS.out.vCruiseCluster * (1 if CS.is_metric else CV.KPH_TO_MPH))) > 100 else s, + "DISTANCE": hud.leadDistanceBars, + "DISTANCE_SPACING": 1 if enabled else 0, + "DISTANCE_LEAD": 2 if enabled and hud.leadVisible else 1 if enabled else 0, + "DISTANCE_CAR": 2 if enabled else 1, + "SLA_ICON": 0, + "NAV_ICON": 0, + "TARGET": 0, + }) + + if msg_161["ALERTS_3"] in (1, 2, 3, 4, 7, 8, 9, 10): # HIDE ISLA, DISTANCE MESSAGES msg_161["ALERTS_3"] = 0 msg_162["LEAD"] = 0 From 6f64d523ed22db2786d73a563c2d95c41b0988eb Mon Sep 17 00:00:00 2001 From: royjr Date: Fri, 7 Mar 2025 23:28:03 -0500 Subject: [PATCH 206/316] use CC.latActive instead --- opendbc/car/hyundai/carcontroller.py | 2 +- opendbc/car/hyundai/hyundaicanfd.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/opendbc/car/hyundai/carcontroller.py b/opendbc/car/hyundai/carcontroller.py index cf79d3956ed..39d00682f86 100644 --- a/opendbc/car/hyundai/carcontroller.py +++ b/opendbc/car/hyundai/carcontroller.py @@ -117,7 +117,7 @@ def update(self, CC, CS, now_nanos): # LFA and HDA icons if self.frame % 5 == 0 and (not lka_steering or lka_steering_long): if self.CP.flags & HyundaiFlags.CCNC: - can_sends.extend(hyundaicanfd.create_ccnc(self.packer, self.CAN, self.CP, CC, CS, apply_steer_req)) + can_sends.extend(hyundaicanfd.create_ccnc(self.packer, self.CAN, self.CP, CC, CS)) else: can_sends.append(hyundaicanfd.create_lfahda_cluster(self.packer, self.CAN, CC.enabled)) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index dd9a096aee1..7e26882b159 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -124,9 +124,9 @@ def create_lfahda_cluster(packer, CAN, enabled): } return packer.make_can_msg("LFAHDA_CLUSTER", CAN.ECAN, values) -def create_ccnc(packer, CAN, CP, CC, CS, lat_active): +def create_ccnc(packer, CAN, CP, CC, CS): msg_161, msg_162 = CS.msg_161, CS.msg_162 - enabled, hud = CC.enabled, CC.hudControl + enabled, hud, latActive = CC.enabled, CC.hudControl, CC.latActive for f in {"FAULT_LSS", "FAULT_HDA", "FAULT_DAS", "FAULT_LFA", "FAULT_DAW"}: msg_162[f] = 0 @@ -146,18 +146,18 @@ def create_ccnc(packer, CAN, CP, CC, CS, lat_active): msg_161.update({ "DAW_ICON": 0, "LKA_ICON": 0, - "LFA_ICON": 2 if lat_active or enabled else 1, - "CENTERLINE": 1 if lat_active or enabled else 0, + "LFA_ICON": 2 if latActive or enabled else 1, + "CENTERLINE": 1 if latActive or enabled else 0, "LANELINE_LEFT": ( 1 if not hud.leftLaneVisible else 4 if hud.leftLaneDepart else - 0 if not (lat_active or enabled) else + 0 if not (latActive or enabled) else 2 if CS.out.leftBlindspot or CS.out.vEgo < 8.94 else 6 ), "LANELINE_RIGHT": ( 1 if not hud.rightLaneVisible else 4 if hud.rightLaneDepart else - 0 if not (lat_active or enabled) else + 0 if not (latActive or enabled) else 2 if CS.out.rightBlindspot or CS.out.vEgo < 8.94 else 6 ), "LCA_LEFT_ARROW": 2 if CC.leftBlinker else 0, From 63e0d0de80259af8b1d901dedda03b3a12d46edb Mon Sep 17 00:00:00 2001 From: royjr Date: Fri, 7 Mar 2025 23:29:01 -0500 Subject: [PATCH 207/316] deredun --- opendbc/car/hyundai/hyundaicanfd.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 7e26882b159..e4690fea96c 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -146,18 +146,18 @@ def create_ccnc(packer, CAN, CP, CC, CS): msg_161.update({ "DAW_ICON": 0, "LKA_ICON": 0, - "LFA_ICON": 2 if latActive or enabled else 1, - "CENTERLINE": 1 if latActive or enabled else 0, + "LFA_ICON": 2 if latActive else 1, + "CENTERLINE": 1 if latActive else 0, "LANELINE_LEFT": ( 1 if not hud.leftLaneVisible else 4 if hud.leftLaneDepart else - 0 if not (latActive or enabled) else + 0 if not latActive else 2 if CS.out.leftBlindspot or CS.out.vEgo < 8.94 else 6 ), "LANELINE_RIGHT": ( 1 if not hud.rightLaneVisible else 4 if hud.rightLaneDepart else - 0 if not (latActive or enabled) else + 0 if not latActive else 2 if CS.out.rightBlindspot or CS.out.vEgo < 8.94 else 6 ), "LCA_LEFT_ARROW": 2 if CC.leftBlinker else 0, From 04f4dbff52ac9d9cb6f2da088b38d6e995d471ad Mon Sep 17 00:00:00 2001 From: royjr Date: Fri, 7 Mar 2025 23:32:13 -0500 Subject: [PATCH 208/316] compact --- opendbc/car/hyundai/hyundaicanfd.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index e4690fea96c..594de23e65a 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -149,17 +149,9 @@ def create_ccnc(packer, CAN, CP, CC, CS): "LFA_ICON": 2 if latActive else 1, "CENTERLINE": 1 if latActive else 0, "LANELINE_LEFT": ( - 1 if not hud.leftLaneVisible else - 4 if hud.leftLaneDepart else - 0 if not latActive else - 2 if CS.out.leftBlindspot or CS.out.vEgo < 8.94 else 6 - ), + 1 if not hud.leftLaneVisible else 4 if hud.leftLaneDepart else 0 if not latActive else 2 if CS.out.leftBlindspot or CS.out.vEgo < 8.94 else 6), "LANELINE_RIGHT": ( - 1 if not hud.rightLaneVisible else - 4 if hud.rightLaneDepart else - 0 if not latActive else - 2 if CS.out.rightBlindspot or CS.out.vEgo < 8.94 else 6 - ), + 1 if not hud.rightLaneVisible else 4 if hud.rightLaneDepart else 0 if not latActive else 2 if CS.out.rightBlindspot or CS.out.vEgo < 8.94 else 6), "LCA_LEFT_ARROW": 2 if CC.leftBlinker else 0, "LCA_RIGHT_ARROW": 2 if CC.rightBlinker else 0, "LANE_LEFT": 1 if CC.leftBlinker else 0, From e695e92d2dcfe7877d7ba6a5518d0a3f8cf95308 Mon Sep 17 00:00:00 2001 From: royjr Date: Sun, 9 Mar 2025 01:23:19 -0500 Subject: [PATCH 209/316] maybe --- opendbc/car/hyundai/hyundaicanfd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 594de23e65a..1f47aa01068 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -154,8 +154,8 @@ def create_ccnc(packer, CAN, CP, CC, CS): 1 if not hud.rightLaneVisible else 4 if hud.rightLaneDepart else 0 if not latActive else 2 if CS.out.rightBlindspot or CS.out.vEgo < 8.94 else 6), "LCA_LEFT_ARROW": 2 if CC.leftBlinker else 0, "LCA_RIGHT_ARROW": 2 if CC.rightBlinker else 0, - "LANE_LEFT": 1 if CC.leftBlinker else 0, - "LANE_RIGHT": 1 if CC.rightBlinker else 0, + "LANE_LEFT": 1 if CC.leftBlinker or CS.leftBlinker else 0, + "LANE_RIGHT": 1 if CC.rightBlinker or CS.leftBlinker else 0, }) if hud.leftLaneDepart or hud.rightLaneDepart: From cd6d550d3abdbfa9b46d0daecf22901d30093950 Mon Sep 17 00:00:00 2001 From: royjr Date: Sun, 9 Mar 2025 16:58:43 -0400 Subject: [PATCH 210/316] Revert "maybe" This reverts commit e695e92d2dcfe7877d7ba6a5518d0a3f8cf95308. --- opendbc/car/hyundai/hyundaicanfd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 1f47aa01068..594de23e65a 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -154,8 +154,8 @@ def create_ccnc(packer, CAN, CP, CC, CS): 1 if not hud.rightLaneVisible else 4 if hud.rightLaneDepart else 0 if not latActive else 2 if CS.out.rightBlindspot or CS.out.vEgo < 8.94 else 6), "LCA_LEFT_ARROW": 2 if CC.leftBlinker else 0, "LCA_RIGHT_ARROW": 2 if CC.rightBlinker else 0, - "LANE_LEFT": 1 if CC.leftBlinker or CS.leftBlinker else 0, - "LANE_RIGHT": 1 if CC.rightBlinker or CS.leftBlinker else 0, + "LANE_LEFT": 1 if CC.leftBlinker else 0, + "LANE_RIGHT": 1 if CC.rightBlinker else 0, }) if hud.leftLaneDepart or hud.rightLaneDepart: From 489f741ab8bcb3e6a9d3884f721f1ae283f036c9 Mon Sep 17 00:00:00 2001 From: royjr Date: Mon, 10 Mar 2025 00:09:04 -0400 Subject: [PATCH 211/316] fix latactive case --- opendbc/car/hyundai/hyundaicanfd.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 594de23e65a..890b7204960 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -126,7 +126,7 @@ def create_lfahda_cluster(packer, CAN, enabled): def create_ccnc(packer, CAN, CP, CC, CS): msg_161, msg_162 = CS.msg_161, CS.msg_162 - enabled, hud, latActive = CC.enabled, CC.hudControl, CC.latActive + enabled, hud, latactive = CC.enabled, CC.hudControl, CC.latActive for f in {"FAULT_LSS", "FAULT_HDA", "FAULT_DAS", "FAULT_LFA", "FAULT_DAW"}: msg_162[f] = 0 @@ -146,12 +146,12 @@ def create_ccnc(packer, CAN, CP, CC, CS): msg_161.update({ "DAW_ICON": 0, "LKA_ICON": 0, - "LFA_ICON": 2 if latActive else 1, - "CENTERLINE": 1 if latActive else 0, + "LFA_ICON": 2 if latactive else 1, + "CENTERLINE": 1 if latactive else 0, "LANELINE_LEFT": ( - 1 if not hud.leftLaneVisible else 4 if hud.leftLaneDepart else 0 if not latActive else 2 if CS.out.leftBlindspot or CS.out.vEgo < 8.94 else 6), + 1 if not hud.leftLaneVisible else 4 if hud.leftLaneDepart else 0 if not latactive else 2 if CS.out.leftBlindspot or CS.out.vEgo < 8.94 else 6), "LANELINE_RIGHT": ( - 1 if not hud.rightLaneVisible else 4 if hud.rightLaneDepart else 0 if not latActive else 2 if CS.out.rightBlindspot or CS.out.vEgo < 8.94 else 6), + 1 if not hud.rightLaneVisible else 4 if hud.rightLaneDepart else 0 if not latactive else 2 if CS.out.rightBlindspot or CS.out.vEgo < 8.94 else 6), "LCA_LEFT_ARROW": 2 if CC.leftBlinker else 0, "LCA_RIGHT_ARROW": 2 if CC.rightBlinker else 0, "LANE_LEFT": 1 if CC.leftBlinker else 0, From 69ad5b9fa8028f8661ed4b9b29235970501fa908 Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 11 Mar 2025 11:12:02 -0400 Subject: [PATCH 212/316] simplify cruise_info --- opendbc/car/hyundai/carcontroller.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/opendbc/car/hyundai/carcontroller.py b/opendbc/car/hyundai/carcontroller.py index 39d00682f86..9262ea62327 100644 --- a/opendbc/car/hyundai/carcontroller.py +++ b/opendbc/car/hyundai/carcontroller.py @@ -131,9 +131,8 @@ def update(self, CC, CS, now_nanos): else: can_sends.extend(hyundaicanfd.create_fca_warning_light(self.packer, self.CAN, self.frame)) if self.frame % 2 == 0: - cruise_info = CS.cruise_info if self.CP.flags & HyundaiFlags.CCNC else None can_sends.append(hyundaicanfd.create_acc_control(self.packer, self.CAN, CC.enabled, self.accel_last, accel, stopping, CC.cruiseControl.override, - set_speed_in_units, hud_control, cruise_info)) + set_speed_in_units, hud_control, CS.cruise_info if self.CP.flags & HyundaiFlags.CCNC else None)) self.accel_last = accel else: # button presses From f87243418755eba1fabab0fbb5bbeddb67d04d35 Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 11 Mar 2025 12:25:27 -0400 Subject: [PATCH 213/316] fix mutations --- opendbc/safety/safety/safety_hyundai_canfd.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/opendbc/safety/safety/safety_hyundai_canfd.h b/opendbc/safety/safety/safety_hyundai_canfd.h index 87c4dbcd56b..c30507ab1b7 100644 --- a/opendbc/safety/safety/safety_hyundai_canfd.h +++ b/opendbc/safety/safety/safety_hyundai_canfd.h @@ -219,9 +219,7 @@ static bool hyundai_canfd_fwd_hook(int bus_num, int addr) { if (bus_num == 0) { block_msg = (hyundai_ccnc && (addr == 0xEA)); - } - - if (bus_num == 2) { + } else if (bus_num == 2) { // LKAS for cars with LKAS and LFA messages, LFA for cars with no LKAS messages int lfa_block_addr = hyundai_canfd_lka_steering_alt ? 0x362 : 0x2a4; bool is_lka_msg = ((addr == hyundai_canfd_get_lka_addr()) || (addr == lfa_block_addr)) && hyundai_canfd_lka_steering; From caedf0cdd011983be101e0bf4e39a29d8267f21b Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 11 Mar 2025 12:43:15 -0400 Subject: [PATCH 214/316] fix mirsa --- opendbc/safety/safety/safety_hyundai_canfd.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/opendbc/safety/safety/safety_hyundai_canfd.h b/opendbc/safety/safety/safety_hyundai_canfd.h index c30507ab1b7..e8de86cc6a6 100644 --- a/opendbc/safety/safety/safety_hyundai_canfd.h +++ b/opendbc/safety/safety/safety_hyundai_canfd.h @@ -235,6 +235,8 @@ static bool hyundai_canfd_fwd_hook(int bus_num, int addr) { bool is_ccnc_msg = (addr == 0x161) || (addr == 0x162); block_msg = is_lka_msg || is_lfa_msg || is_lfahda_msg || is_scc_msg || is_ccnc_msg; + } else { + block_msg = false; } return block_msg; From e59acbe5a540e4dcb129039996990474edbbe504 Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 12 Mar 2025 20:46:36 -0400 Subject: [PATCH 215/316] allow FCA on op long --- opendbc/car/hyundai/carcontroller.py | 2 +- opendbc/safety/safety/safety_hyundai_canfd.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/opendbc/car/hyundai/carcontroller.py b/opendbc/car/hyundai/carcontroller.py index 9262ea62327..e465aa6a19b 100644 --- a/opendbc/car/hyundai/carcontroller.py +++ b/opendbc/car/hyundai/carcontroller.py @@ -128,7 +128,7 @@ def update(self, CC, CS, now_nanos): if self.CP.openpilotLongitudinalControl: if lka_steering: can_sends.extend(hyundaicanfd.create_adrv_messages(self.packer, self.CAN, self.frame)) - else: + elif not self.CP.flags & HyundaiFlags.CCNC: can_sends.extend(hyundaicanfd.create_fca_warning_light(self.packer, self.CAN, self.frame)) if self.frame % 2 == 0: can_sends.append(hyundaicanfd.create_acc_control(self.packer, self.CAN, CC.enabled, self.accel_last, accel, stopping, CC.cruiseControl.override, diff --git a/opendbc/safety/safety/safety_hyundai_canfd.h b/opendbc/safety/safety/safety_hyundai_canfd.h index e8de86cc6a6..977c806b03a 100644 --- a/opendbc/safety/safety/safety_hyundai_canfd.h +++ b/opendbc/safety/safety/safety_hyundai_canfd.h @@ -229,7 +229,7 @@ static bool hyundai_canfd_fwd_hook(int bus_num, int addr) { bool is_lfahda_msg = ((addr == 0x1e0) && !hyundai_canfd_lka_steering); // SCC_CONTROL and ADRV_0x160 for camera SCC cars, we send our own longitudinal commands and to show FCA light - bool is_scc_msg = (((addr == 0x1a0) || (addr == 0x160)) && hyundai_longitudinal && !hyundai_canfd_lka_steering); + bool is_scc_msg = ((hyundai_ccnc ? (addr == 0x1a0):((addr == 0x1a0) || (addr == 0x160))) && hyundai_longitudinal && !hyundai_canfd_lka_steering); // CCNC messages bool is_ccnc_msg = (addr == 0x161) || (addr == 0x162); From 00bd162c8bb72d96048e8f144a11f43f494c6678 Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 12 Mar 2025 21:04:24 -0400 Subject: [PATCH 216/316] fix misra --- opendbc/safety/safety/safety_hyundai_canfd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/safety/safety/safety_hyundai_canfd.h b/opendbc/safety/safety/safety_hyundai_canfd.h index ffbae8f36ff..f2f4e1ced6b 100644 --- a/opendbc/safety/safety/safety_hyundai_canfd.h +++ b/opendbc/safety/safety/safety_hyundai_canfd.h @@ -235,7 +235,7 @@ static bool hyundai_canfd_fwd_hook(int bus_num, int addr) { bool is_lfahda_msg = ((addr == 0x1e0) && !hyundai_canfd_lka_steering); // SCC_CONTROL and ADRV_0x160 for camera SCC cars, we send our own longitudinal commands and to show FCA light - bool is_scc_msg = ((hyundai_ccnc ? (addr == 0x1a0):((addr == 0x1a0) || (addr == 0x160))) && hyundai_longitudinal && !hyundai_canfd_lka_steering); + bool is_scc_msg = (((addr == 0x1a0) || (!hyundai_ccnc && (addr == 0x160))) && hyundai_longitudinal && !hyundai_canfd_lka_steering); // CCNC messages bool is_ccnc_msg = (addr == 0x161) || (addr == 0x162); From 039c076dcf2da92aeef5948d9c724f7d3a782a74 Mon Sep 17 00:00:00 2001 From: royjr Date: Mon, 17 Mar 2025 20:42:15 -0400 Subject: [PATCH 217/316] fix vehicle diagnostics --- opendbc/safety/safety/safety_hyundai_canfd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/safety/safety/safety_hyundai_canfd.h b/opendbc/safety/safety/safety_hyundai_canfd.h index f2f4e1ced6b..ab1bd698165 100644 --- a/opendbc/safety/safety/safety_hyundai_canfd.h +++ b/opendbc/safety/safety/safety_hyundai_canfd.h @@ -224,7 +224,7 @@ static bool hyundai_canfd_fwd_hook(int bus_num, int addr) { bool block_msg = false; if (bus_num == 0) { - block_msg = (hyundai_ccnc && (addr == 0xEA)); + block_msg = ((hyundai_ccnc) && (((addr) == 0xEA) || ((addr) == 0x7C4))); } else if (bus_num == 2) { // LKAS for cars with LKAS and LFA messages, LFA for cars with no LKAS messages int lfa_block_addr = hyundai_canfd_lka_steering_alt ? 0x362 : 0x2a4; From 339ec70b456ad3066d6e44229095368f7596e4c2 Mon Sep 17 00:00:00 2001 From: royjr Date: Mon, 17 Mar 2025 23:09:49 -0400 Subject: [PATCH 218/316] only block SMART_CRUISE_CONTROL_CONDITIONS_NOT_MET on op long --- opendbc/car/hyundai/hyundaicanfd.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index eb19f03eb3f..7ab4aa9229c 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -137,7 +137,7 @@ def create_ccnc(packer, CAN, CP, CC, CS): if msg_161["ALERTS_3"] == 17: # DRIVE_CAREFULLY msg_161["ALERTS_3"] = 0 - if msg_161["ALERTS_5"] in (2, 4, 5): # WATCH_FOR_SURROUNDING_VEHICLES, SMART_CRUISE_CONTROL_CONDITIONS_NOT_MET, USE_SWITCH_OR_PEDAL_TO_ACCELERATE + if msg_161["ALERTS_5"] in (2, 5): # WATCH_FOR_SURROUNDING_VEHICLES, USE_SWITCH_OR_PEDAL_TO_ACCELERATE msg_161["ALERTS_5"] = 0 if msg_161["SOUNDS_4"] == 2 and msg_161["LFA_ICON"] in (3, 0,): # LFA BEEPS @@ -162,6 +162,12 @@ def create_ccnc(packer, CAN, CP, CC, CS): msg_162["VIBRATE"] = 1 if CP.openpilotLongitudinalControl: + if msg_161["ALERTS_3"] in (1, 2, 3, 4, 7, 8, 9, 10): # HIDE ISLA, DISTANCE MESSAGES + msg_161["ALERTS_3"] = 0 + + if msg_161["ALERTS_5"] == 4: # SMART_CRUISE_CONTROL_CONDITIONS_NOT_MET + msg_161["ALERTS_5"] = 0 + msg_161.update({ "SETSPEED": 3 if enabled else 1, "SETSPEED_HUD": 2 if enabled else 1, @@ -175,9 +181,6 @@ def create_ccnc(packer, CAN, CP, CC, CS): "TARGET": 0, }) - if msg_161["ALERTS_3"] in (1, 2, 3, 4, 7, 8, 9, 10): # HIDE ISLA, DISTANCE MESSAGES - msg_161["ALERTS_3"] = 0 - msg_162["LEAD"] = 0 return [packer.make_can_msg(msg, CAN.ECAN, data) for msg, data in [("CCNC_0x161", msg_161), ("CCNC_0x162", msg_162)]] From da6acd8d69cf431fc99f7139b0b9ff13f2b53dbc Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 18 Mar 2025 01:15:07 -0400 Subject: [PATCH 219/316] dont need CAMERA_SCC --- opendbc/safety/safety/safety_hyundai_canfd.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/opendbc/safety/safety/safety_hyundai_canfd.h b/opendbc/safety/safety/safety_hyundai_canfd.h index ab1bd698165..4e22572172d 100644 --- a/opendbc/safety/safety/safety_hyundai_canfd.h +++ b/opendbc/safety/safety/safety_hyundai_canfd.h @@ -297,8 +297,6 @@ static safety_config hyundai_canfd_init(uint16_t param) { HYUNDAI_CANFD_LFA_STEERING_COMMON_TX_MSGS(0) \ HYUNDAI_CANFD_SCC_CONTROL_COMMON_TX_MSGS(0, (longitudinal)) \ {0x160, 0, 16, false}, /* ADRV_0x160 */ \ - {0x161, 0, 32, false}, /* CCNC_0x161 */ \ - {0x162, 0, 32, false}, /* CCNC_0x162 */ \ hyundai_common_init(param); From b5f6bb8f5d619de1aa2ea9fdc652a048d76fe110 Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 18 Mar 2025 13:24:06 -0400 Subject: [PATCH 220/316] add HYUNDAI_TUCSON_HEV_2025 --- opendbc/car/hyundai/fingerprints.py | 8 ++++++++ opendbc/car/hyundai/tests/test_hyundai.py | 1 + opendbc/car/hyundai/values.py | 5 +++++ opendbc/car/tests/routes.py | 1 + opendbc/car/torque_data/override.toml | 1 + 5 files changed, 16 insertions(+) diff --git a/opendbc/car/hyundai/fingerprints.py b/opendbc/car/hyundai/fingerprints.py index e7fddade843..94d09b2de9a 100644 --- a/opendbc/car/hyundai/fingerprints.py +++ b/opendbc/car/hyundai/fingerprints.py @@ -1105,6 +1105,14 @@ b'\xf1\x00NX4__ 1.00 1.02 99110N7100 ', ], }, + CAR.HYUNDAI_TUCSON_HEV_2025: { + (Ecu.fwdCamera, 0x7c4, None): [ + b'\xf1\x00NX4 FR_CMR AT EUR LHD 1.00 1.00 99211-N7030 C55', + ], + (Ecu.fwdRadar, 0x7d0, None): [ + b'\xf1\x00NX4__ 1.00 1.02 99110N7000 ', + ], + }, CAR.HYUNDAI_SANTA_CRUZ_1ST_GEN: { (Ecu.fwdCamera, 0x7c4, None): [ b'\xf1\x00NX4 FR_CMR AT USA LHD 1.00 1.00 99211-CW000 14M', diff --git a/opendbc/car/hyundai/tests/test_hyundai.py b/opendbc/car/hyundai/tests/test_hyundai.py index ee6f0347e5e..20cdb40f295 100644 --- a/opendbc/car/hyundai/tests/test_hyundai.py +++ b/opendbc/car/hyundai/tests/test_hyundai.py @@ -24,6 +24,7 @@ CAR.HYUNDAI_SANTA_CRUZ_1ST_GEN, CAR.HYUNDAI_TUCSON_4TH_GEN, CAR.HYUNDAI_TUCSON_2025, + CAR.HYUNDAI_TUCSON_HEV_2025, # CAN CAR.HYUNDAI_ELANTRA, CAR.HYUNDAI_ELANTRA_GT_I30, diff --git a/opendbc/car/hyundai/values.py b/opendbc/car/hyundai/values.py index d300fc142e4..abdeb2d5001 100644 --- a/opendbc/car/hyundai/values.py +++ b/opendbc/car/hyundai/values.py @@ -393,6 +393,11 @@ class CAR(Platforms): CarSpecs(mass=1630, wheelbase=2.756, steerRatio=13.7, tireStiffnessFactor=0.385), flags=HyundaiFlags.CCNC, ) + HYUNDAI_TUCSON_HEV_2025 = HyundaiCanFDPlatformConfig( + [HyundaiCarDocs("Hyundai Tucson Hybrid 2025", car_parts=CarParts.common([CarHarness.hyundai_n]))], + CarSpecs(mass=1630, wheelbase=2.756, steerRatio=13.7, tireStiffnessFactor=0.385), + flags=HyundaiFlags.CCNC, + ) HYUNDAI_SANTA_CRUZ_1ST_GEN = HyundaiCanFDPlatformConfig( [HyundaiCarDocs("Hyundai Santa Cruz 2022-24", car_parts=CarParts.common([CarHarness.hyundai_n]))], # weight from Limited trim - the only supported trim, steering ratio according to Hyundai News https://www.hyundainews.com/assets/documents/original/48035-2022SantaCruzProductGuideSpecsv2081521.pdf diff --git a/opendbc/car/tests/routes.py b/opendbc/car/tests/routes.py index b43436291c7..8d44009ee3f 100644 --- a/opendbc/car/tests/routes.py +++ b/opendbc/car/tests/routes.py @@ -140,6 +140,7 @@ class CarTestRoute(NamedTuple): CarTestRoute("db68bbe12250812c|2022-12-05--00-54-12", HYUNDAI.HYUNDAI_TUCSON_4TH_GEN), # 2023 CarTestRoute("36e10531feea61a4|2022-07-25--13-37-42", HYUNDAI.HYUNDAI_TUCSON_4TH_GEN), # hybrid CarTestRoute("1fdabac52eef67f1/00000046--b958f8057a", HYUNDAI.HYUNDAI_TUCSON_2025), + CarTestRoute("todo", HYUNDAI.HYUNDAI_TUCSON_HEV_2025), CarTestRoute("5875672fc1d4bf57|2020-07-23--21-33-28", HYUNDAI.KIA_SORENTO), CarTestRoute("1d0d000db3370fd0|2023-01-04--22-28-42", HYUNDAI.KIA_SORENTO_4TH_GEN, segment=5), CarTestRoute("60380edf6d76cb45/00000004--e450afc26c", HYUNDAI.KIA_SORENTO_2024), diff --git a/opendbc/car/torque_data/override.toml b/opendbc/car/torque_data/override.toml index 5438f5e3509..b4e67a98d84 100644 --- a/opendbc/car/torque_data/override.toml +++ b/opendbc/car/torque_data/override.toml @@ -81,6 +81,7 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"] "KIA_SORENTO_2024" = [2.5, 2.5, 0.1] "KIA_K5_2025" = [2.5, 2.5, 0.1] "HYUNDAI_TUCSON_2025" = [2.960174, 2.860284, 0.108745] +"HYUNDAI_TUCSON_HEV_2025" = [2.960174, 2.860284, 0.108745] # Dashcam or fallback configured as ideal car "MOCK" = [10.0, 10, 0.0] From 864f62e18bfd5d08b0d979de2dd8ac1967a98835 Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 18 Mar 2025 13:27:21 -0400 Subject: [PATCH 221/316] Revert "dont need CAMERA_SCC" This reverts commit da6acd8d69cf431fc99f7139b0b9ff13f2b53dbc. --- opendbc/safety/safety/safety_hyundai_canfd.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/opendbc/safety/safety/safety_hyundai_canfd.h b/opendbc/safety/safety/safety_hyundai_canfd.h index 4e22572172d..ab1bd698165 100644 --- a/opendbc/safety/safety/safety_hyundai_canfd.h +++ b/opendbc/safety/safety/safety_hyundai_canfd.h @@ -297,6 +297,8 @@ static safety_config hyundai_canfd_init(uint16_t param) { HYUNDAI_CANFD_LFA_STEERING_COMMON_TX_MSGS(0) \ HYUNDAI_CANFD_SCC_CONTROL_COMMON_TX_MSGS(0, (longitudinal)) \ {0x160, 0, 16, false}, /* ADRV_0x160 */ \ + {0x161, 0, 32, false}, /* CCNC_0x161 */ \ + {0x162, 0, 32, false}, /* CCNC_0x162 */ \ hyundai_common_init(param); From dfd253b31b3a05d20507af3f68ec462cbf696f03 Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 18 Mar 2025 13:33:35 -0400 Subject: [PATCH 222/316] CAMERA_SCC only --- opendbc/safety/safety/safety_hyundai_canfd.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/opendbc/safety/safety/safety_hyundai_canfd.h b/opendbc/safety/safety/safety_hyundai_canfd.h index ab1bd698165..8970390ff6b 100644 --- a/opendbc/safety/safety/safety_hyundai_canfd.h +++ b/opendbc/safety/safety/safety_hyundai_canfd.h @@ -278,8 +278,6 @@ static safety_config hyundai_canfd_init(uint16_t param) { HYUNDAI_CANFD_CRUISE_BUTTON_TX_MSGS(2) HYUNDAI_CANFD_LFA_STEERING_COMMON_TX_MSGS(0) HYUNDAI_CANFD_SCC_CONTROL_COMMON_TX_MSGS(0, false) - {0x161, 0, 32, false}, // CCNC_0x161 - {0x162, 0, 32, false}, // CCNC_0x162 }; static const CanMsg HYUNDAI_CANFD_LFA_STEERING_LONG_TX_MSGS[] = { @@ -288,8 +286,6 @@ static safety_config hyundai_canfd_init(uint16_t param) { HYUNDAI_CANFD_SCC_CONTROL_COMMON_TX_MSGS(0, true) {0x160, 0, 16, false}, // ADRV_0x160 {0x7D0, 0, 8, false}, // tester present for radar ECU disable - {0x161, 0, 32, false}, // CCNC_0x161 - {0x162, 0, 32, false}, // CCNC_0x162 }; #define HYUNDAI_CANFD_LFA_STEERING_CAMERA_SCC_TX_MSGS(longitudinal) \ From eb6d14e0bf13ca9023fb9c89f66f8cadba2e0c16 Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 19 Mar 2025 23:37:29 -0400 Subject: [PATCH 223/316] simple CC --- opendbc/car/hyundai/hyundaicanfd.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 7ab4aa9229c..04b8bdf9285 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -126,7 +126,7 @@ def create_lfahda_cluster(packer, CAN, enabled): def create_ccnc(packer, CAN, CP, CC, CS): msg_161, msg_162 = CS.msg_161, CS.msg_162 - enabled, hud, latactive = CC.enabled, CC.hudControl, CC.latActive + enabled, hud, latactive, leftBlinker, rightBlinker = CC.enabled, CC.hudControl, CC.latActive, CC.leftBlinker, CC.rightBlinker for f in {"FAULT_LSS", "FAULT_HDA", "FAULT_DAS", "FAULT_LFA", "FAULT_DAW"}: msg_162[f] = 0 @@ -152,10 +152,10 @@ def create_ccnc(packer, CAN, CP, CC, CS): 1 if not hud.leftLaneVisible else 4 if hud.leftLaneDepart else 0 if not latactive else 2 if CS.out.leftBlindspot or CS.out.vEgo < 8.94 else 6), "LANELINE_RIGHT": ( 1 if not hud.rightLaneVisible else 4 if hud.rightLaneDepart else 0 if not latactive else 2 if CS.out.rightBlindspot or CS.out.vEgo < 8.94 else 6), - "LCA_LEFT_ARROW": 2 if CC.leftBlinker else 0, - "LCA_RIGHT_ARROW": 2 if CC.rightBlinker else 0, - "LANE_LEFT": 1 if CC.leftBlinker else 0, - "LANE_RIGHT": 1 if CC.rightBlinker else 0, + "LCA_LEFT_ARROW": 2 if leftBlinker else 0, + "LCA_RIGHT_ARROW": 2 if rightBlinker else 0, + "LANE_LEFT": 1 if leftBlinker else 0, + "LANE_RIGHT": 1 if rightBlinker else 0, }) if hud.leftLaneDepart or hud.rightLaneDepart: From 706b34ef2b31cb54dcf9401a6c87efa16ac7d088 Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 19 Mar 2025 23:37:44 -0400 Subject: [PATCH 224/316] simple CP --- opendbc/car/hyundai/hyundaicanfd.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 04b8bdf9285..fe489ebf2cb 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -125,6 +125,7 @@ def create_lfahda_cluster(packer, CAN, enabled): return packer.make_can_msg("LFAHDA_CLUSTER", CAN.ECAN, values) def create_ccnc(packer, CAN, CP, CC, CS): + openpilotLongitudinalControl = CP.openpilotLongitudinalControl msg_161, msg_162 = CS.msg_161, CS.msg_162 enabled, hud, latactive, leftBlinker, rightBlinker = CC.enabled, CC.hudControl, CC.latActive, CC.leftBlinker, CC.rightBlinker @@ -161,7 +162,7 @@ def create_ccnc(packer, CAN, CP, CC, CS): if hud.leftLaneDepart or hud.rightLaneDepart: msg_162["VIBRATE"] = 1 - if CP.openpilotLongitudinalControl: + if openpilotLongitudinalControl: if msg_161["ALERTS_3"] in (1, 2, 3, 4, 7, 8, 9, 10): # HIDE ISLA, DISTANCE MESSAGES msg_161["ALERTS_3"] = 0 From c57a5e722160a7f822055dd04ab62865fd28f371 Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 19 Mar 2025 23:39:39 -0400 Subject: [PATCH 225/316] simple CS --- opendbc/car/hyundai/hyundaicanfd.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index fe489ebf2cb..086a9e5a5db 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -126,7 +126,7 @@ def create_lfahda_cluster(packer, CAN, enabled): def create_ccnc(packer, CAN, CP, CC, CS): openpilotLongitudinalControl = CP.openpilotLongitudinalControl - msg_161, msg_162 = CS.msg_161, CS.msg_162 + msg_161, msg_162, is_metric, out = CS.msg_161, CS.msg_162, CS.is_metric, CS.out enabled, hud, latactive, leftBlinker, rightBlinker = CC.enabled, CC.hudControl, CC.latActive, CC.leftBlinker, CC.rightBlinker for f in {"FAULT_LSS", "FAULT_HDA", "FAULT_DAS", "FAULT_LFA", "FAULT_DAW"}: @@ -150,9 +150,9 @@ def create_ccnc(packer, CAN, CP, CC, CS): "LFA_ICON": 2 if latactive else 1, "CENTERLINE": 1 if latactive else 0, "LANELINE_LEFT": ( - 1 if not hud.leftLaneVisible else 4 if hud.leftLaneDepart else 0 if not latactive else 2 if CS.out.leftBlindspot or CS.out.vEgo < 8.94 else 6), + 1 if not hud.leftLaneVisible else 4 if hud.leftLaneDepart else 0 if not latactive else 2 if out.leftBlindspot or out.vEgo < 8.94 else 6), "LANELINE_RIGHT": ( - 1 if not hud.rightLaneVisible else 4 if hud.rightLaneDepart else 0 if not latactive else 2 if CS.out.rightBlindspot or CS.out.vEgo < 8.94 else 6), + 1 if not hud.rightLaneVisible else 4 if hud.rightLaneDepart else 0 if not latactive else 2 if out.rightBlindspot or out.vEgo < 8.94 else 6), "LCA_LEFT_ARROW": 2 if leftBlinker else 0, "LCA_RIGHT_ARROW": 2 if rightBlinker else 0, "LANE_LEFT": 1 if leftBlinker else 0, @@ -172,7 +172,7 @@ def create_ccnc(packer, CAN, CP, CC, CS): msg_161.update({ "SETSPEED": 3 if enabled else 1, "SETSPEED_HUD": 2 if enabled else 1, - "SETSPEED_SPEED": 25 if (s := round(CS.out.vCruiseCluster * (1 if CS.is_metric else CV.KPH_TO_MPH))) > 100 else s, + "SETSPEED_SPEED": 25 if (s := round(out.vCruiseCluster * (1 if is_metric else CV.KPH_TO_MPH))) > 100 else s, "DISTANCE": hud.leadDistanceBars, "DISTANCE_SPACING": 1 if enabled else 0, "DISTANCE_LEAD": 2 if enabled and hud.leadVisible else 1 if enabled else 0, From bb3e23fa2e3fd4b26441b57f35dd9af79174dd9e Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 19 Mar 2025 23:52:27 -0400 Subject: [PATCH 226/316] send only what we need --- opendbc/car/hyundai/carcontroller.py | 3 ++- opendbc/car/hyundai/hyundaicanfd.py | 6 +----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/opendbc/car/hyundai/carcontroller.py b/opendbc/car/hyundai/carcontroller.py index acf96583cf0..9b50d5dbe81 100644 --- a/opendbc/car/hyundai/carcontroller.py +++ b/opendbc/car/hyundai/carcontroller.py @@ -176,7 +176,8 @@ def create_canfd_msgs(self, apply_steer_req, apply_torque, set_speed_in_units, a # LFA and HDA icons if self.frame % 5 == 0 and (not lka_steering or lka_steering_long): if self.CP.flags & HyundaiFlags.CCNC: - can_sends.extend(hyundaicanfd.create_ccnc(self.packer, self.CAN, self.CP, CC, CS)) + can_sends.extend(hyundaicanfd.create_ccnc(self.packer, self.CAN, self.CP.openpilotLongitudinalControl, CC.enabled, CC.hudControl, CC.latActive, + CC.leftBlinker, CC.rightBlinker, CS.msg_161, CS.msg_162, CS.is_metric, CS.out)) else: can_sends.append(hyundaicanfd.create_lfahda_cluster(self.packer, self.CAN, CC.enabled)) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 086a9e5a5db..9e345312e78 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -124,11 +124,7 @@ def create_lfahda_cluster(packer, CAN, enabled): } return packer.make_can_msg("LFAHDA_CLUSTER", CAN.ECAN, values) -def create_ccnc(packer, CAN, CP, CC, CS): - openpilotLongitudinalControl = CP.openpilotLongitudinalControl - msg_161, msg_162, is_metric, out = CS.msg_161, CS.msg_162, CS.is_metric, CS.out - enabled, hud, latactive, leftBlinker, rightBlinker = CC.enabled, CC.hudControl, CC.latActive, CC.leftBlinker, CC.rightBlinker - +def create_ccnc(packer, CAN, openpilotLongitudinalControl, enabled, hud, latactive, leftBlinker, rightBlinker, msg_161, msg_162, is_metric, out): for f in {"FAULT_LSS", "FAULT_HDA", "FAULT_DAS", "FAULT_LFA", "FAULT_DAW"}: msg_162[f] = 0 From e2bf930f0c44f1cebec4d659f19312246e78226b Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 20 Mar 2025 01:55:48 -0400 Subject: [PATCH 227/316] vEgoCluster for CANFD --- opendbc/car/hyundai/carstate.py | 7 +++++++ opendbc/dbc/generator/hyundai/hyundai_canfd.dbc | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index 301c65cfc0a..c2738af8347 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -231,6 +231,13 @@ def update_canfd(self, can_parsers) -> structs.CarState: ret.standstill = ret.wheelSpeeds.fl <= STANDSTILL_THRESHOLD and ret.wheelSpeeds.fr <= STANDSTILL_THRESHOLD and \ ret.wheelSpeeds.rl <= STANDSTILL_THRESHOLD and ret.wheelSpeeds.rr <= STANDSTILL_THRESHOLD + self.cluster_speed_counter += 1 + if self.cluster_speed_counter > CLUSTER_SAMPLE_RATE: + self.cluster_speed = cp.vl["CRUISE_BUTTONS_ALT"]["CLUSTER_SPEED_KPH"] + self.cluster_speed_counter = 0 + + ret.vEgoCluster = self.cluster_speed * speed_conv + ret.steeringRateDeg = cp.vl["STEERING_SENSORS"]["STEERING_RATE"] ret.steeringAngleDeg = cp.vl["STEERING_SENSORS"]["STEERING_ANGLE"] ret.steeringTorque = cp.vl["MDPS"]["STEERING_COL_TORQUE"] diff --git a/opendbc/dbc/generator/hyundai/hyundai_canfd.dbc b/opendbc/dbc/generator/hyundai/hyundai_canfd.dbc index 31f5a662e21..063bb1f45e7 100644 --- a/opendbc/dbc/generator/hyundai/hyundai_canfd.dbc +++ b/opendbc/dbc/generator/hyundai/hyundai_canfd.dbc @@ -329,9 +329,9 @@ BO_ 426 CRUISE_BUTTONS_ALT: 16 XXX SG_ NEW_SIGNAL_5 : 42|2@1+ (1,0) [0|3] "" XXX SG_ SET_ME_2 : 44|3@1+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_6 : 47|1@1+ (1,0) [0|1] "" XXX - SG_ BYTE6 : 48|8@1+ (1,0) [0|255] "" XXX + SG_ CLUSTER_SPEED_MPH : 48|8@1+ (0.5,0) [0|255] "mph" XXX SG_ BYTE7 : 56|8@1+ (1,0) [0|255] "" XXX - SG_ BYTE8 : 64|8@1+ (1,0) [0|255] "" XXX + SG_ CLUSTER_SPEED_KPH : 64|8@1+ (1,0) [0|255] "kph" XXX SG_ BYTE9 : 72|8@1+ (1,0) [0|255] "" XXX SG_ BYTE10 : 80|8@1+ (1,0) [0|255] "" XXX SG_ BYTE11 : 88|8@1+ (1,0) [0|255] "" XXX From a49b3ad7173dd64a7e5ba2db45d84208ae356ab9 Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 20 Mar 2025 01:56:02 -0400 Subject: [PATCH 228/316] do we still need this? --- opendbc/car/hyundai/carstate.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index c2738af8347..5b46faf3617 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -236,6 +236,9 @@ def update_canfd(self, can_parsers) -> structs.CarState: self.cluster_speed = cp.vl["CRUISE_BUTTONS_ALT"]["CLUSTER_SPEED_KPH"] self.cluster_speed_counter = 0 + if not self.is_metric and self.CP.carFingerprint not in (CAR.KIA_SORENTO,): + self.cluster_speed = math.floor(self.cluster_speed * CV.KPH_TO_MPH + CV.KPH_TO_MPH) + ret.vEgoCluster = self.cluster_speed * speed_conv ret.steeringRateDeg = cp.vl["STEERING_SENSORS"]["STEERING_RATE"] From c59a00a1e488654b2cdeb4ef4116fcdbb9b3baea Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 20 Mar 2025 01:56:06 -0400 Subject: [PATCH 229/316] Revert "do we still need this?" This reverts commit a49b3ad7173dd64a7e5ba2db45d84208ae356ab9. --- opendbc/car/hyundai/carstate.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index 5b46faf3617..c2738af8347 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -236,9 +236,6 @@ def update_canfd(self, can_parsers) -> structs.CarState: self.cluster_speed = cp.vl["CRUISE_BUTTONS_ALT"]["CLUSTER_SPEED_KPH"] self.cluster_speed_counter = 0 - if not self.is_metric and self.CP.carFingerprint not in (CAR.KIA_SORENTO,): - self.cluster_speed = math.floor(self.cluster_speed * CV.KPH_TO_MPH + CV.KPH_TO_MPH) - ret.vEgoCluster = self.cluster_speed * speed_conv ret.steeringRateDeg = cp.vl["STEERING_SENSORS"]["STEERING_RATE"] From c66ea33bca8eeff2361730d320be46c8726cdfc2 Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 20 Mar 2025 01:58:31 -0400 Subject: [PATCH 230/316] CANFD uses speed_factor --- opendbc/car/hyundai/carstate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index c2738af8347..ef17ff40a68 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -236,7 +236,7 @@ def update_canfd(self, can_parsers) -> structs.CarState: self.cluster_speed = cp.vl["CRUISE_BUTTONS_ALT"]["CLUSTER_SPEED_KPH"] self.cluster_speed_counter = 0 - ret.vEgoCluster = self.cluster_speed * speed_conv + ret.vEgoCluster = self.cluster_speed * speed_factor ret.steeringRateDeg = cp.vl["STEERING_SENSORS"]["STEERING_RATE"] ret.steeringAngleDeg = cp.vl["STEERING_SENSORS"]["STEERING_ANGLE"] From 560e04c88045193bffb74208d4ef34506af2522f Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 20 Mar 2025 11:56:21 -0400 Subject: [PATCH 231/316] this works! --- opendbc/car/hyundai/carstate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index ef17ff40a68..54e133a989f 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -233,7 +233,7 @@ def update_canfd(self, can_parsers) -> structs.CarState: self.cluster_speed_counter += 1 if self.cluster_speed_counter > CLUSTER_SAMPLE_RATE: - self.cluster_speed = cp.vl["CRUISE_BUTTONS_ALT"]["CLUSTER_SPEED_KPH"] + self.cluster_speed = cp.vl["CRUISE_BUTTONS_ALT"]["CLUSTER_SPEED_MPH"] self.cluster_speed_counter = 0 ret.vEgoCluster = self.cluster_speed * speed_factor From e2dfc96908bcc8e8b95ea510f83fa083a5b97e6b Mon Sep 17 00:00:00 2001 From: royjr Date: Fri, 21 Mar 2025 01:24:22 -0400 Subject: [PATCH 232/316] show lat engagement status --- opendbc/car/hyundai/hyundaicanfd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 9e345312e78..aefc4a9de1e 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -143,7 +143,7 @@ def create_ccnc(packer, CAN, openpilotLongitudinalControl, enabled, hud, latacti msg_161.update({ "DAW_ICON": 0, "LKA_ICON": 0, - "LFA_ICON": 2 if latactive else 1, + "LFA_ICON": 2 if latactive else 3 if enabled else 1, "CENTERLINE": 1 if latactive else 0, "LANELINE_LEFT": ( 1 if not hud.leftLaneVisible else 4 if hud.leftLaneDepart else 0 if not latactive else 2 if out.leftBlindspot or out.vEgo < 8.94 else 6), From f2ecb484a94d909a8d5ce2281edababa1cf14fd1 Mon Sep 17 00:00:00 2001 From: royjr Date: Fri, 21 Mar 2025 01:24:58 -0400 Subject: [PATCH 233/316] change to enabled --- opendbc/car/hyundai/hyundaicanfd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index aefc4a9de1e..91f958997df 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -144,7 +144,7 @@ def create_ccnc(packer, CAN, openpilotLongitudinalControl, enabled, hud, latacti "DAW_ICON": 0, "LKA_ICON": 0, "LFA_ICON": 2 if latactive else 3 if enabled else 1, - "CENTERLINE": 1 if latactive else 0, + "CENTERLINE": 1 if enabled else 0, "LANELINE_LEFT": ( 1 if not hud.leftLaneVisible else 4 if hud.leftLaneDepart else 0 if not latactive else 2 if out.leftBlindspot or out.vEgo < 8.94 else 6), "LANELINE_RIGHT": ( From 683f4cfead137d7f7205381802bf5ab0fb187809 Mon Sep 17 00:00:00 2001 From: royjr Date: Fri, 21 Mar 2025 01:26:38 -0400 Subject: [PATCH 234/316] these too --- opendbc/car/hyundai/hyundaicanfd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 91f958997df..90301059f60 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -146,9 +146,9 @@ def create_ccnc(packer, CAN, openpilotLongitudinalControl, enabled, hud, latacti "LFA_ICON": 2 if latactive else 3 if enabled else 1, "CENTERLINE": 1 if enabled else 0, "LANELINE_LEFT": ( - 1 if not hud.leftLaneVisible else 4 if hud.leftLaneDepart else 0 if not latactive else 2 if out.leftBlindspot or out.vEgo < 8.94 else 6), + 1 if not hud.leftLaneVisible else 4 if hud.leftLaneDepart else 0 if not enabled else 2 if out.leftBlindspot or out.vEgo < 8.94 else 6), "LANELINE_RIGHT": ( - 1 if not hud.rightLaneVisible else 4 if hud.rightLaneDepart else 0 if not latactive else 2 if out.rightBlindspot or out.vEgo < 8.94 else 6), + 1 if not hud.rightLaneVisible else 4 if hud.rightLaneDepart else 0 if not enabled else 2 if out.rightBlindspot or out.vEgo < 8.94 else 6), "LCA_LEFT_ARROW": 2 if leftBlinker else 0, "LCA_RIGHT_ARROW": 2 if rightBlinker else 0, "LANE_LEFT": 1 if leftBlinker else 0, From c8f8c2d0b997bd5868fe6c476d70b2eea2170595 Mon Sep 17 00:00:00 2001 From: royjr Date: Fri, 21 Mar 2025 02:23:22 -0400 Subject: [PATCH 235/316] fix nearbyint rounding error --- opendbc/car/hyundai/carstate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index 54e133a989f..fbfc36359c6 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -236,7 +236,7 @@ def update_canfd(self, can_parsers) -> structs.CarState: self.cluster_speed = cp.vl["CRUISE_BUTTONS_ALT"]["CLUSTER_SPEED_MPH"] self.cluster_speed_counter = 0 - ret.vEgoCluster = self.cluster_speed * speed_factor + ret.vEgoCluster = self.cluster_speed * speed_factor + 0.5 ret.steeringRateDeg = cp.vl["STEERING_SENSORS"]["STEERING_RATE"] ret.steeringAngleDeg = cp.vl["STEERING_SENSORS"]["STEERING_ANGLE"] From 813fc90e8fedd705a7aed6612f4c21b007cbee5f Mon Sep 17 00:00:00 2001 From: royjr Date: Fri, 21 Mar 2025 22:15:32 -0400 Subject: [PATCH 236/316] better match --- opendbc/car/hyundai/carstate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index fbfc36359c6..011bf6e1a29 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -236,7 +236,7 @@ def update_canfd(self, can_parsers) -> structs.CarState: self.cluster_speed = cp.vl["CRUISE_BUTTONS_ALT"]["CLUSTER_SPEED_MPH"] self.cluster_speed_counter = 0 - ret.vEgoCluster = self.cluster_speed * speed_factor + 0.5 + ret.vEgoCluster = self.cluster_speed * speed_factor + 0.2 ret.steeringRateDeg = cp.vl["STEERING_SENSORS"]["STEERING_RATE"] ret.steeringAngleDeg = cp.vl["STEERING_SENSORS"]["STEERING_ANGLE"] From 41af288abad0413ee64607244c8592ee7993abf2 Mon Sep 17 00:00:00 2001 From: royjr Date: Fri, 21 Mar 2025 23:02:54 -0400 Subject: [PATCH 237/316] match stock icons --- opendbc/car/hyundai/hyundaicanfd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 90301059f60..ed62867b0ac 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -143,7 +143,7 @@ def create_ccnc(packer, CAN, openpilotLongitudinalControl, enabled, hud, latacti msg_161.update({ "DAW_ICON": 0, "LKA_ICON": 0, - "LFA_ICON": 2 if latactive else 3 if enabled else 1, + "LFA_ICON": 2 if enabled else 0, "CENTERLINE": 1 if enabled else 0, "LANELINE_LEFT": ( 1 if not hud.leftLaneVisible else 4 if hud.leftLaneDepart else 0 if not enabled else 2 if out.leftBlindspot or out.vEgo < 8.94 else 6), From ee9c850397ead897d065be5c27da0ee40ecf53fa Mon Sep 17 00:00:00 2001 From: royjr Date: Fri, 21 Mar 2025 23:28:00 -0400 Subject: [PATCH 238/316] fix speed mismatch on op long --- opendbc/car/hyundai/carstate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index 011bf6e1a29..16aea32e423 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -226,7 +226,7 @@ def update_canfd(self, can_parsers) -> structs.CarState: cp.vl["WHEEL_SPEEDS"]["WHL_SpdRLVal"], cp.vl["WHEEL_SPEEDS"]["WHL_SpdRRVal"], ) - ret.vEgoRaw = (ret.wheelSpeeds.fl + ret.wheelSpeeds.fr + ret.wheelSpeeds.rl + ret.wheelSpeeds.rr) / 4. + ret.vEgoRaw = cp.vl["CRUISE_BUTTONS_ALT"]["CLUSTER_SPEED_MPH"] ret.vEgo, ret.aEgo = self.update_speed_kf(ret.vEgoRaw) ret.standstill = ret.wheelSpeeds.fl <= STANDSTILL_THRESHOLD and ret.wheelSpeeds.fr <= STANDSTILL_THRESHOLD and \ ret.wheelSpeeds.rl <= STANDSTILL_THRESHOLD and ret.wheelSpeeds.rr <= STANDSTILL_THRESHOLD From 8662a1bd98894ffa226189d6fcb255c834746275 Mon Sep 17 00:00:00 2001 From: royjr Date: Fri, 21 Mar 2025 23:46:21 -0400 Subject: [PATCH 239/316] fix --- opendbc/car/hyundai/carstate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index 16aea32e423..4c88463bff3 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -226,7 +226,7 @@ def update_canfd(self, can_parsers) -> structs.CarState: cp.vl["WHEEL_SPEEDS"]["WHL_SpdRLVal"], cp.vl["WHEEL_SPEEDS"]["WHL_SpdRRVal"], ) - ret.vEgoRaw = cp.vl["CRUISE_BUTTONS_ALT"]["CLUSTER_SPEED_MPH"] + ret.vEgoRaw = cp.vl["CRUISE_BUTTONS_ALT"]["CLUSTER_SPEED_MPH"] * speed_factor + 0.2 ret.vEgo, ret.aEgo = self.update_speed_kf(ret.vEgoRaw) ret.standstill = ret.wheelSpeeds.fl <= STANDSTILL_THRESHOLD and ret.wheelSpeeds.fr <= STANDSTILL_THRESHOLD and \ ret.wheelSpeeds.rl <= STANDSTILL_THRESHOLD and ret.wheelSpeeds.rr <= STANDSTILL_THRESHOLD From 8da42ed1246fd5d7aed293dc79a9577c3ba4eac3 Mon Sep 17 00:00:00 2001 From: royjr Date: Sun, 23 Mar 2025 13:36:12 -0400 Subject: [PATCH 240/316] substitute whats known --- opendbc/car/torque_data/override.toml | 4 ---- opendbc/car/torque_data/substitute.toml | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/opendbc/car/torque_data/override.toml b/opendbc/car/torque_data/override.toml index 2d63b230c3b..df5be8ba41a 100644 --- a/opendbc/car/torque_data/override.toml +++ b/opendbc/car/torque_data/override.toml @@ -76,13 +76,9 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"] # Note that some Rivians achieve significantly less lateral acceleration than this "RIVIAN_R1_GEN1" = [2.8, 2.5, 0.07] "HYUNDAI_NEXO_1ST_GEN" = [2.5, 2.5, 0.1] -"HYUNDAI_SONATA_2024" = [2.5, 2.5, 0.1] -"HYUNDAI_SONATA_HEV_2024" = [2.5, 2.5, 0.1] "HYUNDAI_KONA_2ND_GEN" = [2.5, 2.5, 0.1] "KIA_SORENTO_2024" = [2.5, 2.5, 0.1] "KIA_K5_2025" = [2.5, 2.5, 0.1] -"HYUNDAI_TUCSON_2025" = [2.960174, 2.860284, 0.108745] -"HYUNDAI_TUCSON_HEV_2025" = [2.960174, 2.860284, 0.108745] # Dashcam or fallback configured as ideal car "MOCK" = [10.0, 10, 0.0] diff --git a/opendbc/car/torque_data/substitute.toml b/opendbc/car/torque_data/substitute.toml index a91ac358957..d126c2cdfb8 100644 --- a/opendbc/car/torque_data/substitute.toml +++ b/opendbc/car/torque_data/substitute.toml @@ -45,6 +45,10 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"] "GENESIS_G90" = "GENESIS_G70" "GENESIS_G80" = "GENESIS_G70" "GENESIS_G70_2020" = "HYUNDAI_SONATA" +"HYUNDAI_SONATA_2024" = "HYUNDAI_SONATA" +"HYUNDAI_SONATA_HEV_2024" = "HYUNDAI_SONATA_HYBRID"` +"HYUNDAI_TUCSON_2025" = "HYUNDAI_TUCSON_4TH_GEN" +"HYUNDAI_TUCSON_HEV_2025" = "HYUNDAI_TUCSON_4TH_GEN" "HONDA_FREED" = "HONDA_ODYSSEY" "HONDA_CRV_EU" = "HONDA_CRV" From c14173d0d7ece9a28647d82f7899ca2072bb5a78 Mon Sep 17 00:00:00 2001 From: royjr Date: Sun, 23 Mar 2025 13:55:14 -0400 Subject: [PATCH 241/316] hmm --- opendbc/car/torque_data/substitute.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/torque_data/substitute.toml b/opendbc/car/torque_data/substitute.toml index d126c2cdfb8..9b6a18791c9 100644 --- a/opendbc/car/torque_data/substitute.toml +++ b/opendbc/car/torque_data/substitute.toml @@ -46,7 +46,7 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"] "GENESIS_G80" = "GENESIS_G70" "GENESIS_G70_2020" = "HYUNDAI_SONATA" "HYUNDAI_SONATA_2024" = "HYUNDAI_SONATA" -"HYUNDAI_SONATA_HEV_2024" = "HYUNDAI_SONATA_HYBRID"` +"HYUNDAI_SONATA_HEV_2024" = "HYUNDAI_SONATA_HYBRID" "HYUNDAI_TUCSON_2025" = "HYUNDAI_TUCSON_4TH_GEN" "HYUNDAI_TUCSON_HEV_2025" = "HYUNDAI_TUCSON_4TH_GEN" From 3e4371883d86e164aabdaa65b25770047d902f0d Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 5 Apr 2025 18:03:09 -0400 Subject: [PATCH 242/316] remove HYUNDAI_TUCSON_2025 --- opendbc/car/hyundai/fingerprints.py | 10 ++-------- opendbc/car/hyundai/tests/test_hyundai.py | 1 - opendbc/car/hyundai/values.py | 5 ----- opendbc/car/tests/routes.py | 1 - opendbc/car/torque_data/substitute.toml | 1 - 5 files changed, 2 insertions(+), 16 deletions(-) diff --git a/opendbc/car/hyundai/fingerprints.py b/opendbc/car/hyundai/fingerprints.py index 94d09b2de9a..aa294fcfb38 100644 --- a/opendbc/car/hyundai/fingerprints.py +++ b/opendbc/car/hyundai/fingerprints.py @@ -1097,20 +1097,14 @@ b'\xf1\x00NX4__ 1.01 1.00 99110-N9100 ', ], }, - CAR.HYUNDAI_TUCSON_2025: { - (Ecu.fwdCamera, 0x7c4, None): [ - b'\xf1\x00NX4 FR_CMR AT USA LHD 1.00 1.00 99211-N7030 C55', - ], - (Ecu.fwdRadar, 0x7d0, None): [ - b'\xf1\x00NX4__ 1.00 1.02 99110N7100 ', - ], - }, CAR.HYUNDAI_TUCSON_HEV_2025: { (Ecu.fwdCamera, 0x7c4, None): [ + b'\xf1\x00NX4 FR_CMR AT USA LHD 1.00 1.00 99211-N7030 C55', b'\xf1\x00NX4 FR_CMR AT EUR LHD 1.00 1.00 99211-N7030 C55', ], (Ecu.fwdRadar, 0x7d0, None): [ b'\xf1\x00NX4__ 1.00 1.02 99110N7000 ', + b'\xf1\x00NX4__ 1.00 1.02 99110N7100 ', ], }, CAR.HYUNDAI_SANTA_CRUZ_1ST_GEN: { diff --git a/opendbc/car/hyundai/tests/test_hyundai.py b/opendbc/car/hyundai/tests/test_hyundai.py index 20cdb40f295..97c4c370bc5 100644 --- a/opendbc/car/hyundai/tests/test_hyundai.py +++ b/opendbc/car/hyundai/tests/test_hyundai.py @@ -23,7 +23,6 @@ CAR.KIA_SPORTAGE_5TH_GEN, CAR.HYUNDAI_SANTA_CRUZ_1ST_GEN, CAR.HYUNDAI_TUCSON_4TH_GEN, - CAR.HYUNDAI_TUCSON_2025, CAR.HYUNDAI_TUCSON_HEV_2025, # CAN CAR.HYUNDAI_ELANTRA, diff --git a/opendbc/car/hyundai/values.py b/opendbc/car/hyundai/values.py index abdeb2d5001..5ae63a7f5eb 100644 --- a/opendbc/car/hyundai/values.py +++ b/opendbc/car/hyundai/values.py @@ -388,11 +388,6 @@ class CAR(Platforms): ], CarSpecs(mass=1630, wheelbase=2.756, steerRatio=13.7, tireStiffnessFactor=0.385), ) - HYUNDAI_TUCSON_2025 = HyundaiCanFDPlatformConfig( - [HyundaiCarDocs("Hyundai Tucson 2025", car_parts=CarParts.common([CarHarness.hyundai_n]))], - CarSpecs(mass=1630, wheelbase=2.756, steerRatio=13.7, tireStiffnessFactor=0.385), - flags=HyundaiFlags.CCNC, - ) HYUNDAI_TUCSON_HEV_2025 = HyundaiCanFDPlatformConfig( [HyundaiCarDocs("Hyundai Tucson Hybrid 2025", car_parts=CarParts.common([CarHarness.hyundai_n]))], CarSpecs(mass=1630, wheelbase=2.756, steerRatio=13.7, tireStiffnessFactor=0.385), diff --git a/opendbc/car/tests/routes.py b/opendbc/car/tests/routes.py index 8d44009ee3f..55c5f3ccffe 100644 --- a/opendbc/car/tests/routes.py +++ b/opendbc/car/tests/routes.py @@ -139,7 +139,6 @@ class CarTestRoute(NamedTuple): CarTestRoute("fb3fd42f0baaa2f8|2022-03-30--15-25-05", HYUNDAI.HYUNDAI_TUCSON), CarTestRoute("db68bbe12250812c|2022-12-05--00-54-12", HYUNDAI.HYUNDAI_TUCSON_4TH_GEN), # 2023 CarTestRoute("36e10531feea61a4|2022-07-25--13-37-42", HYUNDAI.HYUNDAI_TUCSON_4TH_GEN), # hybrid - CarTestRoute("1fdabac52eef67f1/00000046--b958f8057a", HYUNDAI.HYUNDAI_TUCSON_2025), CarTestRoute("todo", HYUNDAI.HYUNDAI_TUCSON_HEV_2025), CarTestRoute("5875672fc1d4bf57|2020-07-23--21-33-28", HYUNDAI.KIA_SORENTO), CarTestRoute("1d0d000db3370fd0|2023-01-04--22-28-42", HYUNDAI.KIA_SORENTO_4TH_GEN, segment=5), diff --git a/opendbc/car/torque_data/substitute.toml b/opendbc/car/torque_data/substitute.toml index 9b6a18791c9..f42a13e8147 100644 --- a/opendbc/car/torque_data/substitute.toml +++ b/opendbc/car/torque_data/substitute.toml @@ -47,7 +47,6 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"] "GENESIS_G70_2020" = "HYUNDAI_SONATA" "HYUNDAI_SONATA_2024" = "HYUNDAI_SONATA" "HYUNDAI_SONATA_HEV_2024" = "HYUNDAI_SONATA_HYBRID" -"HYUNDAI_TUCSON_2025" = "HYUNDAI_TUCSON_4TH_GEN" "HYUNDAI_TUCSON_HEV_2025" = "HYUNDAI_TUCSON_4TH_GEN" "HONDA_FREED" = "HONDA_ODYSSEY" From 7d492acc611feac7a58a4ff285960399e8097ca0 Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 22 Apr 2025 23:45:50 -0400 Subject: [PATCH 243/316] set true later? --- opendbc/safety/safety/safety_hyundai_canfd.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opendbc/safety/safety/safety_hyundai_canfd.h b/opendbc/safety/safety/safety_hyundai_canfd.h index 3990f0e8c20..037e3d605a4 100644 --- a/opendbc/safety/safety/safety_hyundai_canfd.h +++ b/opendbc/safety/safety/safety_hyundai_canfd.h @@ -266,8 +266,8 @@ static safety_config hyundai_canfd_init(uint16_t param) { HYUNDAI_CANFD_LFA_STEERING_COMMON_TX_MSGS(0) \ HYUNDAI_CANFD_SCC_CONTROL_COMMON_TX_MSGS(0, (longitudinal)) \ {0x160, 0, 16, .check_relay = (longitudinal)}, /* ADRV_0x160 */ \ - {0x161, 0, 32, false}, /* CCNC_0x161 */ \ - {0x162, 0, 32, false}, /* CCNC_0x162 */ \ + {0x161, 0, 32, .check_relay = false}, /* CCNC_0x161 */ \ + {0x162, 0, 32, .check_relay = false}, /* CCNC_0x162 */ \ hyundai_common_init(param); From 4a22c3021dff0742f8612610d2f7b3da774980e7 Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 23 Apr 2025 01:03:42 -0400 Subject: [PATCH 244/316] remove KIA_K5_2025 --- opendbc/car/hyundai/fingerprints.py | 8 -------- opendbc/car/hyundai/values.py | 5 ----- opendbc/car/tests/routes.py | 1 - opendbc/car/torque_data/override.toml | 1 - 4 files changed, 15 deletions(-) diff --git a/opendbc/car/hyundai/fingerprints.py b/opendbc/car/hyundai/fingerprints.py index 4e4f8aadb65..94b414203a8 100644 --- a/opendbc/car/hyundai/fingerprints.py +++ b/opendbc/car/hyundai/fingerprints.py @@ -634,14 +634,6 @@ b'\xf1\x00DL ESC \t 102"\x08\x10 58910-L3800', ], }, - CAR.KIA_K5_2025: { - (Ecu.fwdCamera, 0x7c4, None): [ - b'\xf1\x00DL3 MFC AT USA LHD 1.00 1.04 99210-L2500 240117', - ], - (Ecu.fwdRadar, 0x7d0, None): [ - b'\xf1\x00DL3_ RDR ----- 1.00 1.01 99110-L2500 ', - ], - }, CAR.KIA_K5_HEV_2020: { (Ecu.fwdRadar, 0x7d0, None): [ b'\xf1\x00DLhe SCC FHCUP 1.00 1.02 99110-L7000 ', diff --git a/opendbc/car/hyundai/values.py b/opendbc/car/hyundai/values.py index 66b9bce9207..4ba47108a62 100644 --- a/opendbc/car/hyundai/values.py +++ b/opendbc/car/hyundai/values.py @@ -417,11 +417,6 @@ class CAR(Platforms): CarSpecs(mass=3381 * CV.LB_TO_KG, wheelbase=2.85, steerRatio=13.27, tireStiffnessFactor=0.5), # 2021 Kia K5 Steering Ratio (all trims) flags=HyundaiFlags.CHECKSUM_CRC8, ) - KIA_K5_2025 = HyundaiCanFDPlatformConfig( - [HyundaiCarDocs("Kia K5 2025", "Highway Driving Assist", car_parts=CarParts.common([CarHarness.hyundai_m]))], - CarSpecs(mass=3230 * CV.LB_TO_KG, wheelbase=2.85, steerRatio=13.27), - flags=HyundaiFlags.CCNC, - ) KIA_K5_HEV_2020 = HyundaiPlatformConfig( [HyundaiCarDocs("Kia K5 Hybrid 2020-22", car_parts=CarParts.common([CarHarness.hyundai_a]))], KIA_K5_2021.specs, diff --git a/opendbc/car/tests/routes.py b/opendbc/car/tests/routes.py index 4b5c9c96751..dc79d6410da 100644 --- a/opendbc/car/tests/routes.py +++ b/opendbc/car/tests/routes.py @@ -175,7 +175,6 @@ class CarTestRoute(NamedTuple): CarTestRoute("68d6a96e703c00c9|2022-09-10--16-09-39", HYUNDAI.KIA_EV6), # LFA steering CarTestRoute("9b25e8c1484a1b67|2023-04-13--10-41-45", HYUNDAI.KIA_EV6), CarTestRoute("007d5e4ad9f86d13|2021-09-30--15-09-23", HYUNDAI.KIA_K5_2021), - CarTestRoute("c4a804b067623789/0000007c--163f831540", HYUNDAI.KIA_K5_2025), CarTestRoute("c58dfc9fc16590e0|2023-01-14--13-51-48", HYUNDAI.KIA_K5_HEV_2020), CarTestRoute("78ad5150de133637|2023-09-13--16-15-57", HYUNDAI.KIA_K8_HEV_1ST_GEN), CarTestRoute("50c6c9b85fd1ff03|2020-10-26--17-56-06", HYUNDAI.KIA_NIRO_EV), diff --git a/opendbc/car/torque_data/override.toml b/opendbc/car/torque_data/override.toml index 266782e425b..7d4965837b7 100644 --- a/opendbc/car/torque_data/override.toml +++ b/opendbc/car/torque_data/override.toml @@ -78,7 +78,6 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"] "HYUNDAI_NEXO_1ST_GEN" = [2.5, 2.5, 0.1] "HYUNDAI_KONA_2ND_GEN" = [2.5, 2.5, 0.1] "KIA_SORENTO_2024" = [2.5, 2.5, 0.1] -"KIA_K5_2025" = [2.5, 2.5, 0.1] # Dashcam or fallback configured as ideal car "MOCK" = [10.0, 10, 0.0] From 42837b756107a2044ca130b06b97b6bbb1345de2 Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 23 Apr 2025 01:15:08 -0400 Subject: [PATCH 245/316] Revert "remove KIA_K5_2025" This reverts commit 4a22c3021dff0742f8612610d2f7b3da774980e7. --- opendbc/car/hyundai/fingerprints.py | 8 ++++++++ opendbc/car/hyundai/values.py | 5 +++++ opendbc/car/tests/routes.py | 1 + opendbc/car/torque_data/override.toml | 1 + 4 files changed, 15 insertions(+) diff --git a/opendbc/car/hyundai/fingerprints.py b/opendbc/car/hyundai/fingerprints.py index 94b414203a8..4e4f8aadb65 100644 --- a/opendbc/car/hyundai/fingerprints.py +++ b/opendbc/car/hyundai/fingerprints.py @@ -634,6 +634,14 @@ b'\xf1\x00DL ESC \t 102"\x08\x10 58910-L3800', ], }, + CAR.KIA_K5_2025: { + (Ecu.fwdCamera, 0x7c4, None): [ + b'\xf1\x00DL3 MFC AT USA LHD 1.00 1.04 99210-L2500 240117', + ], + (Ecu.fwdRadar, 0x7d0, None): [ + b'\xf1\x00DL3_ RDR ----- 1.00 1.01 99110-L2500 ', + ], + }, CAR.KIA_K5_HEV_2020: { (Ecu.fwdRadar, 0x7d0, None): [ b'\xf1\x00DLhe SCC FHCUP 1.00 1.02 99110-L7000 ', diff --git a/opendbc/car/hyundai/values.py b/opendbc/car/hyundai/values.py index 4ba47108a62..66b9bce9207 100644 --- a/opendbc/car/hyundai/values.py +++ b/opendbc/car/hyundai/values.py @@ -417,6 +417,11 @@ class CAR(Platforms): CarSpecs(mass=3381 * CV.LB_TO_KG, wheelbase=2.85, steerRatio=13.27, tireStiffnessFactor=0.5), # 2021 Kia K5 Steering Ratio (all trims) flags=HyundaiFlags.CHECKSUM_CRC8, ) + KIA_K5_2025 = HyundaiCanFDPlatformConfig( + [HyundaiCarDocs("Kia K5 2025", "Highway Driving Assist", car_parts=CarParts.common([CarHarness.hyundai_m]))], + CarSpecs(mass=3230 * CV.LB_TO_KG, wheelbase=2.85, steerRatio=13.27), + flags=HyundaiFlags.CCNC, + ) KIA_K5_HEV_2020 = HyundaiPlatformConfig( [HyundaiCarDocs("Kia K5 Hybrid 2020-22", car_parts=CarParts.common([CarHarness.hyundai_a]))], KIA_K5_2021.specs, diff --git a/opendbc/car/tests/routes.py b/opendbc/car/tests/routes.py index dc79d6410da..4b5c9c96751 100644 --- a/opendbc/car/tests/routes.py +++ b/opendbc/car/tests/routes.py @@ -175,6 +175,7 @@ class CarTestRoute(NamedTuple): CarTestRoute("68d6a96e703c00c9|2022-09-10--16-09-39", HYUNDAI.KIA_EV6), # LFA steering CarTestRoute("9b25e8c1484a1b67|2023-04-13--10-41-45", HYUNDAI.KIA_EV6), CarTestRoute("007d5e4ad9f86d13|2021-09-30--15-09-23", HYUNDAI.KIA_K5_2021), + CarTestRoute("c4a804b067623789/0000007c--163f831540", HYUNDAI.KIA_K5_2025), CarTestRoute("c58dfc9fc16590e0|2023-01-14--13-51-48", HYUNDAI.KIA_K5_HEV_2020), CarTestRoute("78ad5150de133637|2023-09-13--16-15-57", HYUNDAI.KIA_K8_HEV_1ST_GEN), CarTestRoute("50c6c9b85fd1ff03|2020-10-26--17-56-06", HYUNDAI.KIA_NIRO_EV), diff --git a/opendbc/car/torque_data/override.toml b/opendbc/car/torque_data/override.toml index 7d4965837b7..266782e425b 100644 --- a/opendbc/car/torque_data/override.toml +++ b/opendbc/car/torque_data/override.toml @@ -78,6 +78,7 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"] "HYUNDAI_NEXO_1ST_GEN" = [2.5, 2.5, 0.1] "HYUNDAI_KONA_2ND_GEN" = [2.5, 2.5, 0.1] "KIA_SORENTO_2024" = [2.5, 2.5, 0.1] +"KIA_K5_2025" = [2.5, 2.5, 0.1] # Dashcam or fallback configured as ideal car "MOCK" = [10.0, 10, 0.0] From 90e8f6a7b6728e01bc9a878dbfb27a6e5028b921 Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 23 Apr 2025 11:46:58 -0400 Subject: [PATCH 246/316] always block messages --- opendbc/safety/safety/safety_hyundai_canfd.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opendbc/safety/safety/safety_hyundai_canfd.h b/opendbc/safety/safety/safety_hyundai_canfd.h index 037e3d605a4..badea852b92 100644 --- a/opendbc/safety/safety/safety_hyundai_canfd.h +++ b/opendbc/safety/safety/safety_hyundai_canfd.h @@ -266,8 +266,8 @@ static safety_config hyundai_canfd_init(uint16_t param) { HYUNDAI_CANFD_LFA_STEERING_COMMON_TX_MSGS(0) \ HYUNDAI_CANFD_SCC_CONTROL_COMMON_TX_MSGS(0, (longitudinal)) \ {0x160, 0, 16, .check_relay = (longitudinal)}, /* ADRV_0x160 */ \ - {0x161, 0, 32, .check_relay = false}, /* CCNC_0x161 */ \ - {0x162, 0, 32, .check_relay = false}, /* CCNC_0x162 */ \ + {0x161, 0, 32, .check_relay = true}, /* CCNC_0x161 */ \ + {0x162, 0, 32, .check_relay = true}, /* CCNC_0x162 */ \ hyundai_common_init(param); From 1eb3c97c41d296272db9c5803e2718183525e819 Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 23 Apr 2025 12:17:44 -0400 Subject: [PATCH 247/316] more fixes --- opendbc/safety/safety/safety_hyundai_canfd.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/opendbc/safety/safety/safety_hyundai_canfd.h b/opendbc/safety/safety/safety_hyundai_canfd.h index badea852b92..416ae39c235 100644 --- a/opendbc/safety/safety/safety_hyundai_canfd.h +++ b/opendbc/safety/safety/safety_hyundai_canfd.h @@ -268,6 +268,8 @@ static safety_config hyundai_canfd_init(uint16_t param) { {0x160, 0, 16, .check_relay = (longitudinal)}, /* ADRV_0x160 */ \ {0x161, 0, 32, .check_relay = true}, /* CCNC_0x161 */ \ {0x162, 0, 32, .check_relay = true}, /* CCNC_0x162 */ \ + {0x7C4, 2, 8, .check_relay = true}, /* 0x7C4 */ \ + {0xEA, 2, 24, .check_relay = true}, /* MDPS */ \ hyundai_common_init(param); From dda8d2cd0f358082d5ea14de113626428b323247 Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 23 Apr 2025 21:04:10 -0400 Subject: [PATCH 248/316] fix tests --- opendbc/safety/safety/safety_hyundai_canfd.h | 30 ++++++++++++++++++-- opendbc/safety/tests/test_hyundai_canfd.py | 8 +++--- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/opendbc/safety/safety/safety_hyundai_canfd.h b/opendbc/safety/safety/safety_hyundai_canfd.h index 416ae39c235..3e2bb18d890 100644 --- a/opendbc/safety/safety/safety_hyundai_canfd.h +++ b/opendbc/safety/safety/safety_hyundai_canfd.h @@ -49,6 +49,10 @@ static bool hyundai_canfd_alt_buttons = false; static bool hyundai_canfd_lka_steering_alt = false; static bool hyundai_ccnc = false; +static bool get_hyundai_ccnc(void) { + return hyundai_ccnc; +} + static int hyundai_canfd_get_lka_addr(void) { return hyundai_canfd_lka_steering_alt ? 0x110 : 0x50; } @@ -266,6 +270,12 @@ static safety_config hyundai_canfd_init(uint16_t param) { HYUNDAI_CANFD_LFA_STEERING_COMMON_TX_MSGS(0) \ HYUNDAI_CANFD_SCC_CONTROL_COMMON_TX_MSGS(0, (longitudinal)) \ {0x160, 0, 16, .check_relay = (longitudinal)}, /* ADRV_0x160 */ \ + +#define HYUNDAI_CANFD_LFA_STEERING_CAMERA_SCC_CCNC_TX_MSGS(longitudinal) \ + HYUNDAI_CANFD_CRUISE_BUTTON_TX_MSGS(2) \ + HYUNDAI_CANFD_LFA_STEERING_COMMON_TX_MSGS(0) \ + HYUNDAI_CANFD_SCC_CONTROL_COMMON_TX_MSGS(0, (longitudinal)) \ + {0x160, 0, 16, .check_relay = (longitudinal)}, /* ADRV_0x160 */ \ {0x161, 0, 32, .check_relay = true}, /* CCNC_0x161 */ \ {0x162, 0, 32, .check_relay = true}, /* CCNC_0x162 */ \ {0x7C4, 2, 8, .check_relay = true}, /* 0x7C4 */ \ @@ -301,6 +311,10 @@ static safety_config hyundai_canfd_init(uint16_t param) { HYUNDAI_CANFD_LFA_STEERING_CAMERA_SCC_TX_MSGS(true) }; + static CanMsg hyundai_canfd_lfa_steering_camera_scc_ccnc_tx_msgs[] = { + HYUNDAI_CANFD_LFA_STEERING_CAMERA_SCC_CCNC_TX_MSGS(true) + }; + if (hyundai_canfd_alt_buttons) { SET_RX_CHECKS(hyundai_canfd_alt_buttons_long_rx_checks, ret); } else { @@ -308,7 +322,11 @@ static safety_config hyundai_canfd_init(uint16_t param) { } if (hyundai_camera_scc) { - SET_TX_MSGS(hyundai_canfd_lfa_steering_camera_scc_tx_msgs, ret); + if (get_hyundai_ccnc()) { + SET_TX_MSGS(hyundai_canfd_lfa_steering_camera_scc_ccnc_tx_msgs, ret); + } else { + SET_TX_MSGS(hyundai_canfd_lfa_steering_camera_scc_tx_msgs, ret); + } } else { SET_TX_MSGS(HYUNDAI_CANFD_LFA_STEERING_LONG_TX_MSGS, ret); } @@ -369,7 +387,15 @@ static safety_config hyundai_canfd_init(uint16_t param) { HYUNDAI_CANFD_LFA_STEERING_CAMERA_SCC_TX_MSGS(false) }; - SET_TX_MSGS(hyundai_canfd_lfa_steering_camera_scc_tx_msgs, ret); + static CanMsg hyundai_canfd_lfa_steering_camera_scc_ccnc_tx_msgs[] = { + HYUNDAI_CANFD_LFA_STEERING_CAMERA_SCC_CCNC_TX_MSGS(false) + }; + + if (get_hyundai_ccnc()) { + SET_TX_MSGS(hyundai_canfd_lfa_steering_camera_scc_ccnc_tx_msgs, ret); + } else { + SET_TX_MSGS(hyundai_canfd_lfa_steering_camera_scc_tx_msgs, ret); + } if (hyundai_canfd_alt_buttons) { SET_RX_CHECKS(hyundai_canfd_alt_buttons_rx_checks, ret); diff --git a/opendbc/safety/tests/test_hyundai_canfd.py b/opendbc/safety/tests/test_hyundai_canfd.py index 33ef1c6a480..3fad83d3df1 100755 --- a/opendbc/safety/tests/test_hyundai_canfd.py +++ b/opendbc/safety/tests/test_hyundai_canfd.py @@ -86,7 +86,7 @@ class TestHyundaiCanfdLFASteeringBase(TestHyundaiCanfdBase): TX_MSGS = [[0x12A, 0], [0x1A0, 1], [0x1CF, 0], [0x1E0, 0]] RELAY_MALFUNCTION_ADDRS = {0: (0x12A, 0x1E0)} # LFA, LFAHDA_CLUSTER - FWD_BLACKLISTED_ADDRS = {2: [0x12A, 0x1E0, 0x161, 0x162]} + FWD_BLACKLISTED_ADDRS = {2: [0x12A, 0x1E0]} STEER_MSG = "LFA" BUTTONS_TX_BUS = 2 @@ -160,7 +160,7 @@ class TestHyundaiCanfdLKASteeringEV(TestHyundaiCanfdBase): TX_MSGS = [[0x50, 0], [0x1CF, 1], [0x2A4, 0]] RELAY_MALFUNCTION_ADDRS = {0: (0x50, 0x2a4)} # LKAS, CAM_0x2A4 - FWD_BLACKLISTED_ADDRS = {2: [0x50, 0x2a4, 0x161, 0x162]} + FWD_BLACKLISTED_ADDRS = {2: [0x50, 0x2a4]} PT_BUS = 1 SCC_BUS = 1 @@ -179,7 +179,7 @@ class TestHyundaiCanfdLKASteeringAltEV(TestHyundaiCanfdBase): TX_MSGS = [[0x110, 0], [0x1CF, 1], [0x362, 0]] RELAY_MALFUNCTION_ADDRS = {0: (0x110, 0x362)} # LKAS_ALT, CAM_0x362 - FWD_BLACKLISTED_ADDRS = {2: [0x110, 0x362, 0x161, 0x162]} + FWD_BLACKLISTED_ADDRS = {2: [0x110, 0x362]} PT_BUS = 1 SCC_BUS = 1 @@ -226,7 +226,7 @@ def _accel_msg(self, accel, aeb_req=False, aeb_decel=0): # Tests longitudinal for ICE, hybrid, EV cars with LFA steering class TestHyundaiCanfdLFASteeringLongBase(HyundaiLongitudinalBase, TestHyundaiCanfdLFASteeringBase): - FWD_BLACKLISTED_ADDRS = {2: [0x12a, 0x1e0, 0x1a0, 0x160, 0x161, 0x162]} + FWD_BLACKLISTED_ADDRS = {2: [0x12a, 0x1e0, 0x1a0, 0x160]} RELAY_MALFUNCTION_ADDRS = {0: (0x12A, 0x1E0, 0x1a0, 0x160)} # LFA, LFAHDA_CLUSTER, SCC_CONTROL, ADRV_0x160 From 819fb5cb14b93b40ef05d60b43605434ccd0f922 Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 23 Apr 2025 21:58:00 -0400 Subject: [PATCH 249/316] temp ignore cov --- opendbc/safety/safety/safety_hyundai_canfd.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opendbc/safety/safety/safety_hyundai_canfd.h b/opendbc/safety/safety/safety_hyundai_canfd.h index 3e2bb18d890..d50657659e7 100644 --- a/opendbc/safety/safety/safety_hyundai_canfd.h +++ b/opendbc/safety/safety/safety_hyundai_canfd.h @@ -323,7 +323,7 @@ static safety_config hyundai_canfd_init(uint16_t param) { if (hyundai_camera_scc) { if (get_hyundai_ccnc()) { - SET_TX_MSGS(hyundai_canfd_lfa_steering_camera_scc_ccnc_tx_msgs, ret); + SET_TX_MSGS(hyundai_canfd_lfa_steering_camera_scc_ccnc_tx_msgs, ret); // LCOV_EXCL_LINE } else { SET_TX_MSGS(hyundai_canfd_lfa_steering_camera_scc_tx_msgs, ret); } @@ -392,7 +392,7 @@ static safety_config hyundai_canfd_init(uint16_t param) { }; if (get_hyundai_ccnc()) { - SET_TX_MSGS(hyundai_canfd_lfa_steering_camera_scc_ccnc_tx_msgs, ret); + SET_TX_MSGS(hyundai_canfd_lfa_steering_camera_scc_ccnc_tx_msgs, ret); // LCOV_EXCL_LINE } else { SET_TX_MSGS(hyundai_canfd_lfa_steering_camera_scc_tx_msgs, ret); } From 344696dc8eec601c3481d7e30a2e7dac26c85b75 Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 24 Apr 2025 16:16:12 -0400 Subject: [PATCH 250/316] fix op long --- opendbc/safety/safety/safety_hyundai_canfd.h | 1 - 1 file changed, 1 deletion(-) diff --git a/opendbc/safety/safety/safety_hyundai_canfd.h b/opendbc/safety/safety/safety_hyundai_canfd.h index d50657659e7..99812026ffe 100644 --- a/opendbc/safety/safety/safety_hyundai_canfd.h +++ b/opendbc/safety/safety/safety_hyundai_canfd.h @@ -275,7 +275,6 @@ static safety_config hyundai_canfd_init(uint16_t param) { HYUNDAI_CANFD_CRUISE_BUTTON_TX_MSGS(2) \ HYUNDAI_CANFD_LFA_STEERING_COMMON_TX_MSGS(0) \ HYUNDAI_CANFD_SCC_CONTROL_COMMON_TX_MSGS(0, (longitudinal)) \ - {0x160, 0, 16, .check_relay = (longitudinal)}, /* ADRV_0x160 */ \ {0x161, 0, 32, .check_relay = true}, /* CCNC_0x161 */ \ {0x162, 0, 32, .check_relay = true}, /* CCNC_0x162 */ \ {0x7C4, 2, 8, .check_relay = true}, /* 0x7C4 */ \ From 2b7275800588013b02b8330fa1e8a6e962c5dcb5 Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 24 Apr 2025 16:33:59 -0400 Subject: [PATCH 251/316] Squashed commit of the following: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 344696dc8eec601c3481d7e30a2e7dac26c85b75 Author: royjr Date: Thu Apr 24 16:16:12 2025 -0400 fix op long commit 819fb5cb14b93b40ef05d60b43605434ccd0f922 Author: royjr Date: Wed Apr 23 21:58:00 2025 -0400 temp ignore cov commit dda8d2cd0f358082d5ea14de113626428b323247 Author: royjr Date: Wed Apr 23 21:04:10 2025 -0400 fix tests commit 1eb3c97c41d296272db9c5803e2718183525e819 Author: royjr Date: Wed Apr 23 12:17:44 2025 -0400 more fixes commit 90e8f6a7b6728e01bc9a878dbfb27a6e5028b921 Author: royjr Date: Wed Apr 23 11:46:58 2025 -0400 always block messages commit 42837b756107a2044ca130b06b97b6bbb1345de2 Author: royjr Date: Wed Apr 23 01:15:08 2025 -0400 Revert "remove KIA_K5_2025" This reverts commit 4a22c3021dff0742f8612610d2f7b3da774980e7. commit 4a22c3021dff0742f8612610d2f7b3da774980e7 Author: royjr Date: Wed Apr 23 01:03:42 2025 -0400 remove KIA_K5_2025 commit 7d492acc611feac7a58a4ff285960399e8097ca0 Author: royjr Date: Tue Apr 22 23:45:50 2025 -0400 set true later? commit 50f4b5f47f84a87ac69ca559afccfa09ac6d9ecf Merge: 16fd7198 7bad67af Author: royjr Date: Tue Apr 22 23:36:38 2025 -0400 Merge remote-tracking branch 'upstream/master' into ccnc-port-testing test commit 7bad67af29ea117ce8cf51cc6549c97b9acdafe1 Author: Gavin Canon-Phratsachack <37220586+gncnpk@users.noreply.github.com> Date: Sat Apr 19 13:30:03 2025 -0500 Nissan: Added ProPilot brake pressure signal (#2137) * Added brake pressure signal * Add brake active signal commit 3c5eebd4688ba0e7786eab56c581c334ca1c5996 Author: John Nathan Wood <39569384+johnnathanwood@users.noreply.github.com> Date: Fri Apr 18 16:45:58 2025 -0500 Kona 2022 alt limit flag (#2072) * updated hyundai kona 2022 platform config to add alt limits flag * fixed flag, should be _2 dude to high torque commit 4d6eb5cb7ec34b1190e11c3f7b6a16e2fafe5166 Author: Lukas <61192133+lukasloetkolben@users.noreply.github.com> Date: Fri Apr 18 23:45:16 2025 +0200 Rivian: add park assist dbc (#2136) add park assist dbc commit 4e5ca58fe9b2dc6bb8388b253971046ce853486e Author: Lukas <61192133+lukasloetkolben@users.noreply.github.com> Date: Wed Apr 16 19:19:17 2025 +0200 Tesla: add DAS_road Signal (#2133) add DAS_road commit c9fc721bba5c888aacb8e378e669ade3b7a176f3 Author: Trey Moen <50057480+greatgitsby@users.noreply.github.com> Date: Tue Apr 15 21:43:19 2025 -0700 feat(Tesla): add setup note pointing to wiki (#2122) Co-authored-by: Shane Smiskol commit 9994f738dcf35542d793bb44007b1c6ea6efb617 Author: vanillagorillaa <31773928+vanillagorillaa@users.noreply.github.com> Date: Tue Apr 15 22:04:53 2025 -0500 Honda Bosch C: CAN FD Pilot 2023 (#2118) * init CANFD Pilot * add back * remove * remove import for now * Update opendbc/car/honda/values.py Co-authored-by: Shane Smiskol * Update opendbc/car/honda/interface.py Co-authored-by: Shane Smiskol * fix * remove * fix * more * more * support both buses for buttons. no impact if we send to radar or PT accidentally * clean this up and send buttons to correct bus * remove for now * also remove * test route * add car parts! * rename to bosch canfd * nothing else is _CAR * PILOT_4G uses angled mount * cmt * re-use lines * revert this * todo * re-use Bosch interface setup code * re-use specs * todo * flip order * more clear * fix * update docs --------- Co-authored-by: Shane Smiskol commit ea16bc52cd88c5c0f7e871c9f1da901720cc650b Author: Shane Smiskol Date: Tue Apr 15 16:16:23 2025 -0700 Honda: CarState cleanup (#2132) * can do this * this instead ', CAR.'.join([str(i) for i in set(CAR) - {CAR.HONDA_ODYSSEY_CHN, CAR.HONDA_FREED, CAR.HONDA_HRV, CAR.HONDA_ACCORD, CAR.HONDA_CIVIC_BOSCH, CAR.HONDA_CIVIC_BOSCH_DIESEL, CAR.HONDA_CRV_HYBRID, CAR.HONDA_INSIGHT, CAR.ACURA_RDX_3G, CAR.HONDA_E, *HONDA_BOSCH_RADARLESS}]) * prep * revert commit 6007f17ff395207cbe96d081f61db90a798b2229 Author: Lukas <61192133+lukasloetkolben@users.noreply.github.com> Date: Tue Apr 15 07:18:01 2025 +0200 Rivian: alternative Ignition Signal (#2126) ignition signal commit 976a5c14d752760129429c976d2be7cbce467cae Author: Dmitrij Kovalevskij Date: Tue Apr 15 07:19:46 2025 +0300 Hyundai: add FW for EU version of Santa Fe (#2113) Co-authored-by: Dmytro Kovalevskiy commit 3b33a71a2bf08b57dd5b2bf77e26cc376dcd7cc9 Author: Shane Smiskol Date: Mon Apr 14 16:54:39 2025 -0700 Revert "Revert "Rename experimental long"" (#2128) Revert "Revert "Rename experimental long" (#2125)" This reverts commit d65fa99e2aa60a6d98cdfb5acb912665e9e6447e. commit d65fa99e2aa60a6d98cdfb5acb912665e9e6447e Author: Shane Smiskol Date: Mon Apr 14 10:55:29 2025 -0700 Revert "Rename experimental long" (#2125) Revert "Rename experimental long (#2114)" This reverts commit 6b9106b1224a3724d9d55af8d53ce992d9ac7165. commit d631299b8d49253fdeb5b709684af031ab1d18be Author: aubsw <10409668+aubsw@users.noreply.github.com> Date: Mon Apr 14 06:58:10 2025 -0400 No-op changes to make Panda happy (#2076) min changes to make panda happy! commit cc3f122c6d16a1b82dccd2757e0014a590e0f194 Author: Shane Smiskol Date: Fri Apr 11 18:50:41 2025 -0700 safety: move Honda to msg block config (#2103) * do honda nidec * Do Bosch Radarless long * we don't care about blocking stock message to radar because it is disabled (0 is radar, 1 is pt which we are sending to) * same for 0xe5, and it's not on bosch radarless * rest Honda commit 6b9106b1224a3724d9d55af8d53ce992d9ac7165 Author: Shane Smiskol Date: Fri Apr 11 15:07:22 2025 -0700 Rename experimental long (#2114) now alpha long commit 00e7a69382d37694ab585466c187c814f7de4c56 Author: ZwX1616 Date: Fri Apr 11 14:01:55 2025 -0700 Chevrolet Bolt EUV: update lat control base values (#1826) * bolt friction was too low * round2 --------- Co-authored-by: Comma Device commit 171efe4a8c0090864930a0f9dd6532c83d6cd1d4 Author: vanillagorillaa <31773928+vanillagorillaa@users.noreply.github.com> Date: Thu Apr 10 22:27:54 2025 -0500 Honda: Bosch LKAS HUD update (#2110) * docs: Scheduled auto-update CARS.md * update * comments and val * fix --------- Co-authored-by: vanillagorillaa commit 0bd26684da0c4154170bf01728c3c65776a318cf Author: Shane Smiskol Date: Thu Apr 10 17:46:40 2025 -0700 safety: move Hyundai CAN FD to msg block config (#2107) * not there yet * can remove this * and this * rm more * not here * and that! * siiiiiick commit 1a59488c69b5f751af31db17684f90ae3fc067b9 Author: Yeek2 <112910414+Yeek2@users.noreply.github.com> Date: Thu Apr 10 07:59:48 2025 -0700 Ford: add F-150 2022 FW (#2085) commit a96e2612827a0a7c3d0472437513dc9c6052b7bf Author: adeebshihadeh Date: Thu Apr 10 08:08:19 2025 +0000 docs: Scheduled auto-update CARS.md commit 01019a71d19550aec461235472ee43decf964c58 Author: Shane Smiskol Date: Wed Apr 9 21:25:52 2025 -0700 safety: block all messages with static config (#2095) * do toyota * fix missing code * mazda! ! * nissan * rivian * partial Subaru, LKAS only * Chrysler * VW MQB * VW PQ * do GM * subaru PG * fix * misra * revert * fix * add back removed comments commit c0048ae50a29cf89b8caae95daeab4676e9f7e29 Author: Shane Smiskol Date: Wed Apr 9 21:23:16 2025 -0700 safety: move Hyundai to msg block config (#2099) * do hyundai * formatting commit 50d5ab1ae174842ab6023a45ebf2333b1b48cbcb Author: Shane Smiskol Date: Wed Apr 9 21:03:58 2025 -0700 safety: move Subaru to msg block config (#2098) * do subaru lkas * subaru is a woo * it's bus 1 so we don't fwd * rm * same pattern commit 4bac275f5a2a6c1756c89956b454a4b4af5ae783 Author: Shane Smiskol Date: Wed Apr 9 20:34:34 2025 -0700 GM ASCM safety: use disable_forwarding (#2097) commit 19169745add63d3ff139585259fdbf62ff4aa023 Author: Shane Smiskol Date: Wed Apr 9 19:51:14 2025 -0700 safety: move Toyota to msg block config (#2096) do Toyota commit 0423a2122dc4d208d6410836dd1d89d0ab34cf4f Author: Shane Smiskol Date: Wed Apr 9 18:43:58 2025 -0700 safety: block messages with static config (#2092) * ugh * oh this could work * revert back * add forwarding logic fix * yees * how about * more * match fwd blocklist to relay malfunc * remove duplicate code in ford // no coverage anymore * todo * coverage * misra * check_relay makes most sense. imagine we make it `block_msg` and then tesla does `disable_block_msg` too, makes no sense * this is now accurate * comment * fix * consistent * fix commit 8334975f45aad375b5321dc5d08abb2eb56362ca Author: Shane Smiskol Date: Wed Apr 9 17:00:46 2025 -0700 Hyundai Camera SCC long safety: check SCC12 relay malfunction (#2094) if we're doing longitudinal, we should always check for relay malfunction commit 7a1b7840b9411824b93e2cc165c55531d93994ce Author: Shane Smiskol Date: Wed Apr 9 15:51:04 2025 -0700 safety: switch to field initializer for check_relay (#2093) * specify at least one keyword in CanMsg constructor * formatting for the future * fix * forgot honda 😱 * and this! commit f246792d750fc848dc15531dea4580cc8c1efdd5 Author: vanillagorillaa <31773928+vanillagorillaa@users.noreply.github.com> Date: Wed Apr 9 13:31:50 2025 -0500 Honda: Support Civic Hybrids (#1856) * init Civic Hybrid * more fw versions * fix * fix * add back * try * add test route commit 9358ee61c0ca3f1e94e3a602b554a325580badbe Author: Shane Smiskol Date: Tue Apr 8 21:26:04 2025 -0700 Revert "Move relay malfunction check to fwd hook" (#2089) Revert "Move relay malfunction check to fwd hook (#2087)" This reverts commit 5a24ffee4549b857837df03a7faaf5f31236f787. commit 5a24ffee4549b857837df03a7faaf5f31236f787 Author: Shane Smiskol Date: Tue Apr 8 21:02:11 2025 -0700 Move relay malfunction check to fwd hook (#2087) * ohhh wait a minute * fix from merge * todo * we need to test this now * we got it * fix rest * rm commit b7334811d021a28f91be026ba17d37f274d718c7 Author: Shane Smiskol Date: Tue Apr 8 19:40:30 2025 -0700 safety: split relay malfunction and generic rx checks (#2088) * split * fixup * whops * whopper commit 4ee3a240ad78cbed24d34f096d52471770544ca0 Author: Shane Smiskol Date: Tue Apr 8 18:27:21 2025 -0700 Fix formatting in safety_tesla.h --- docs/CARS.md | 5 +- opendbc/car/body/interface.py | 2 +- opendbc/car/car.capnp | 2 +- opendbc/car/car_helpers.py | 4 +- opendbc/car/chrysler/interface.py | 2 +- opendbc/car/docs.py | 2 +- opendbc/car/docs_definitions.py | 4 +- opendbc/car/ford/fingerprints.py | 2 + opendbc/car/ford/interface.py | 6 +- opendbc/car/gm/interface.py | 8 +- opendbc/car/honda/carstate.py | 16 ++- opendbc/car/honda/fingerprints.py | 20 ++++ opendbc/car/honda/hondacan.py | 16 ++- opendbc/car/honda/interface.py | 35 ++++-- opendbc/car/honda/values.py | 29 ++++- opendbc/car/hyundai/fingerprints.py | 2 + opendbc/car/hyundai/interface.py | 10 +- opendbc/car/hyundai/values.py | 2 +- opendbc/car/interfaces.py | 6 +- opendbc/car/mazda/interface.py | 2 +- opendbc/car/mock/interface.py | 2 +- opendbc/car/nissan/interface.py | 2 +- opendbc/car/rivian/interface.py | 6 +- opendbc/car/subaru/interface.py | 8 +- opendbc/car/subaru/values.py | 2 +- opendbc/car/tesla/interface.py | 6 +- opendbc/car/tesla/values.py | 8 +- opendbc/car/tests/routes.py | 4 +- opendbc/car/tests/test_car_interfaces.py | 4 +- opendbc/car/torque_data/override.toml | 3 +- opendbc/car/toyota/interface.py | 6 +- opendbc/car/volkswagen/interface.py | 6 +- .../dbc/generator/honda/_bosch_adas_2018.dbc | 11 +- .../dbc/generator/nissan/_nissan_common.dbc | 4 + opendbc/dbc/rivian_park_assist_can.dbc | 52 +++++++++ opendbc/dbc/rivian_primary_actuator.dbc | 1 + opendbc/dbc/tesla_model3_party.dbc | 5 +- opendbc/safety/board/drivers/can_common.h | 1 + opendbc/safety/board/utils.h | 2 +- opendbc/safety/safety.h | 65 +++++------ opendbc/safety/safety/safety_body.h | 6 +- opendbc/safety/safety/safety_chrysler.h | 31 ++--- opendbc/safety/safety/safety_ford.h | 63 +++-------- opendbc/safety/safety/safety_gm.h | 49 +++----- opendbc/safety/safety/safety_honda.h | 47 ++++---- opendbc/safety/safety/safety_hyundai.h | 43 ++----- opendbc/safety/safety/safety_hyundai_canfd.h | 106 +++++++++--------- opendbc/safety/safety/safety_mazda.h | 13 +-- opendbc/safety/safety/safety_nissan.h | 28 +---- opendbc/safety/safety/safety_rivian.h | 43 +------ opendbc/safety/safety/safety_subaru.h | 66 +++++------ .../safety/safety/safety_subaru_preglobal.h | 15 +-- opendbc/safety/safety/safety_tesla.h | 31 +++-- opendbc/safety/safety/safety_toyota.h | 50 ++++----- opendbc/safety/safety/safety_volkswagen_mqb.h | 37 +----- opendbc/safety/safety/safety_volkswagen_pq.h | 30 +---- opendbc/safety/safety_declarations.h | 35 +++++- opendbc/safety/tests/misra/test_mutation.py | 2 +- opendbc/safety/tests/test_chrysler.py | 6 +- opendbc/safety/tests/test_gm.py | 6 +- opendbc/safety/tests/test_honda.py | 13 ++- opendbc/safety/tests/test_hyundai.py | 7 +- opendbc/safety/tests/test_hyundai_canfd.py | 18 +-- opendbc/safety/tests/test_mazda.py | 2 +- opendbc/safety/tests/test_nissan.py | 2 +- opendbc/safety/tests/test_rivian.py | 4 +- opendbc/safety/tests/test_subaru.py | 11 +- opendbc/safety/tests/test_subaru_preglobal.py | 2 +- opendbc/safety/tests/test_toyota.py | 8 +- opendbc/safety/tests/test_volkswagen_mqb.py | 3 +- opendbc/safety/tests/test_volkswagen_pq.py | 3 +- 71 files changed, 543 insertions(+), 610 deletions(-) create mode 100644 opendbc/dbc/rivian_park_assist_can.dbc diff --git a/docs/CARS.md b/docs/CARS.md index 3b4d6d3e2fc..6e40e4f7fe0 100644 --- a/docs/CARS.md +++ b/docs/CARS.md @@ -1,6 +1,6 @@ -# Support Information for 350 Known Cars +# Support Information for 353 Known Cars |Make|Model|Package|Support Level| |---|---|---|:---:| @@ -73,6 +73,8 @@ |Honda|Civic 2022-24|All|[Upstream](#upstream)| |Honda|Civic Hatchback 2017-21|Honda Sensing|[Upstream](#upstream)| |Honda|Civic Hatchback 2022-24|All|[Upstream](#upstream)| +|Honda|Civic Hatchback Hybrid 2023 (Europe only)|All|[Upstream](#upstream)| +|Honda|Civic Hatchback Hybrid 2025|All|[Upstream](#upstream)| |Honda|Clarity 2018-21|All|[Community](#community)| |Honda|CR-V 2015-16|Touring Trim|[Upstream](#upstream)| |Honda|CR-V 2017-22|Honda Sensing|[Upstream](#upstream)| @@ -90,6 +92,7 @@ |Honda|Odyssey 2021-25|All|[Community](#community)| |Honda|Passport 2019-25|All|[Upstream](#upstream)| |Honda|Pilot 2016-22|Honda Sensing|[Upstream](#upstream)| +|Honda|Pilot 2023|All|[Dashcam mode](#dashcam)| |Honda|Pilot 2023-24|All|[Community](#community)| |Honda|Ridgeline 2017-25|Honda Sensing|[Upstream](#upstream)| |Hyundai|Azera 2022|All|[Upstream](#upstream)| diff --git a/opendbc/car/body/interface.py b/opendbc/car/body/interface.py index 007f679362f..7c988c899c8 100644 --- a/opendbc/car/body/interface.py +++ b/opendbc/car/body/interface.py @@ -11,7 +11,7 @@ class CarInterface(CarInterfaceBase): CarController = CarController @staticmethod - def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experimental_long, docs) -> structs.CarParams: + def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, alpha_long, docs) -> structs.CarParams: ret.notCar = True ret.brand = "body" ret.safetyConfigs = [get_safety_config(structs.CarParams.SafetyModel.body)] diff --git a/opendbc/car/car.capnp b/opendbc/car/car.capnp index 5c5a7d68a3d..7967add76d1 100644 --- a/opendbc/car/car.capnp +++ b/opendbc/car/car.capnp @@ -466,7 +466,7 @@ struct CarParams { enableDsu @5 :Bool; # driving support unit enableBsm @56 :Bool; # blind spot monitoring flags @64 :UInt32; # flags for car specific quirks - experimentalLongitudinalAvailable @71 :Bool; + alphaLongitudinalAvailable @71 :Bool; minEnableSpeed @7 :Float32; minSteerSpeed @8 :Float32; diff --git a/opendbc/car/car_helpers.py b/opendbc/car/car_helpers.py index 64318bfbc67..c33a99489b6 100644 --- a/opendbc/car/car_helpers.py +++ b/opendbc/car/car_helpers.py @@ -148,7 +148,7 @@ def fingerprint(can_recv: CanRecvCallable, can_send: CanSendCallable, set_obd_mu return car_fingerprint, finger, vin, car_fw, source, exact_match -def get_car(can_recv: CanRecvCallable, can_send: CanSendCallable, set_obd_multiplexing: ObdCallback, experimental_long_allowed: bool, +def get_car(can_recv: CanRecvCallable, can_send: CanSendCallable, set_obd_multiplexing: ObdCallback, alpha_long_allowed: bool, num_pandas: int = 1, cached_params: CarParamsT | None = None): candidate, fingerprints, vin, car_fw, source, exact_match = fingerprint(can_recv, can_send, set_obd_multiplexing, num_pandas, cached_params) @@ -157,7 +157,7 @@ def get_car(can_recv: CanRecvCallable, can_send: CanSendCallable, set_obd_multip candidate = "MOCK" CarInterface = interfaces[candidate] - CP: CarParams = CarInterface.get_params(candidate, fingerprints, car_fw, experimental_long_allowed, docs=False) + CP: CarParams = CarInterface.get_params(candidate, fingerprints, car_fw, alpha_long_allowed, docs=False) CP.carVin = vin CP.carFw = car_fw CP.fingerprintSource = source diff --git a/opendbc/car/chrysler/interface.py b/opendbc/car/chrysler/interface.py index 065953a8873..03246bed256 100755 --- a/opendbc/car/chrysler/interface.py +++ b/opendbc/car/chrysler/interface.py @@ -13,7 +13,7 @@ class CarInterface(CarInterfaceBase): RadarInterface = RadarInterface @staticmethod - def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experimental_long, docs) -> structs.CarParams: + def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, alpha_long, docs) -> structs.CarParams: ret.brand = "chrysler" ret.dashcamOnly = candidate in RAM_HD diff --git a/opendbc/car/docs.py b/opendbc/car/docs.py index 51f071b26a4..cdaa16a2dec 100755 --- a/opendbc/car/docs.py +++ b/opendbc/car/docs.py @@ -32,7 +32,7 @@ def get_params_for_docs(platform) -> CarParams: cp_platform = platform if platform in interfaces else MOCK.MOCK CP: CarParams = interfaces[cp_platform].get_params(cp_platform, fingerprint=gen_empty_fingerprint(), car_fw=[CarParams.CarFw(ecu=CarParams.Ecu.unknown)], - experimental_long=True, docs=True) + alpha_long=True, docs=True) return CP diff --git a/opendbc/car/docs_definitions.py b/opendbc/car/docs_definitions.py index 2909fd659e8..f6eb71041a1 100644 --- a/opendbc/car/docs_definitions.py +++ b/opendbc/car/docs_definitions.py @@ -285,7 +285,7 @@ def init(self, CP: CarParams, all_footnotes=None): # longitudinal column op_long = "Stock" - if CP.experimentalLongitudinalAvailable or CP.enableDsu: + if CP.alphaLongitudinalAvailable or CP.enableDsu: op_long = "openpilot available" if CP.enableDsu: self.footnotes.append(CommonFootnote.EXP_LONG_DSU) @@ -383,7 +383,7 @@ def get_detail_sentence(self, CP): # experimental mode exp_link = "Experimental mode" - if CP.openpilotLongitudinalControl and not CP.experimentalLongitudinalAvailable: + if CP.openpilotLongitudinalControl and not CP.alphaLongitudinalAvailable: sentence_builder += f" Traffic light and stop sign handling is also available in {exp_link}." return sentence_builder.format(car_model=f"{self.make} {self.model}", alc=alc, acc=acc) diff --git a/opendbc/car/ford/fingerprints.py b/opendbc/car/ford/fingerprints.py index 1a916b8f141..567881d5578 100644 --- a/opendbc/car/ford/fingerprints.py +++ b/opendbc/car/ford/fingerprints.py @@ -80,6 +80,7 @@ b'ML3V-14D003-BC\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', ], (Ecu.abs, 0x760, None): [ + b'NL34-2D053-CA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', b'PL34-2D053-CA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', b'PL34-2D053-CC\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', b'PL3V-2D053-BB\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', @@ -89,6 +90,7 @@ ], (Ecu.fwdCamera, 0x706, None): [ b'ML3T-14H102-ABR\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'ML3T-14H102-ABT\x00\x00\x00\x00\x00\x00\x00\x00\x00', b'PJ6T-14H102-ABJ\x00\x00\x00\x00\x00\x00\x00\x00\x00', b'RJ6T-14H102-ACJ\x00\x00\x00\x00\x00\x00\x00\x00\x00', ], diff --git a/opendbc/car/ford/interface.py b/opendbc/car/ford/interface.py index 6f08c10acb0..ff5a0a6ee24 100644 --- a/opendbc/car/ford/interface.py +++ b/opendbc/car/ford/interface.py @@ -26,7 +26,7 @@ def get_pid_accel_limits(CP, current_speed, cruise_speed): return CarControllerParams.ACCEL_MIN, np.interp(current_speed, ACCEL_MAX_BP, ACCEL_MAX_VALS) @staticmethod - def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experimental_long, docs) -> structs.CarParams: + def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, alpha_long, docs) -> structs.CarParams: ret.brand = "ford" ret.radarUnavailable = Bus.radar not in DBC[candidate] @@ -49,8 +49,8 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experime cfgs.insert(0, get_safety_config(structs.CarParams.SafetyModel.noOutput)) ret.safetyConfigs = cfgs - ret.experimentalLongitudinalAvailable = ret.radarUnavailable - if experimental_long or not ret.radarUnavailable: + ret.alphaLongitudinalAvailable = ret.radarUnavailable + if alpha_long or not ret.radarUnavailable: ret.safetyConfigs[-1].safetyParam |= FordSafetyFlags.LONG_CONTROL.value ret.openpilotLongitudinalControl = True diff --git a/opendbc/car/gm/interface.py b/opendbc/car/gm/interface.py index 2f8c0979c3b..a0b3a6bdb1e 100755 --- a/opendbc/car/gm/interface.py +++ b/opendbc/car/gm/interface.py @@ -85,7 +85,7 @@ def torque_from_lateral_accel(self) -> TorqueFromLateralAccelCallbackType: return self.torque_from_lateral_accel_linear @staticmethod - def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experimental_long, docs) -> structs.CarParams: + def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, alpha_long, docs) -> structs.CarParams: ret.brand = "gm" ret.safetyConfigs = [get_safety_config(structs.CarParams.SafetyModel.gm)] ret.autoResumeSng = False @@ -100,7 +100,7 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experime ret.longitudinalTuning.kiBP = [5., 35.] if candidate in (CAMERA_ACC_CAR | SDGM_CAR): - ret.experimentalLongitudinalAvailable = candidate not in SDGM_CAR + ret.alphaLongitudinalAvailable = candidate not in SDGM_CAR ret.networkLocation = NetworkLocation.fwdCamera ret.radarUnavailable = True # no radar ret.pcmCruise = True @@ -114,13 +114,13 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experime ret.vEgoStopping = 0.25 ret.vEgoStarting = 0.25 - if experimental_long: + if alpha_long: ret.pcmCruise = False ret.openpilotLongitudinalControl = True ret.safetyConfigs[0].safetyParam |= GMSafetyFlags.HW_CAM_LONG.value if candidate in ALT_ACCS: - ret.experimentalLongitudinalAvailable = False + ret.alphaLongitudinalAvailable = False ret.openpilotLongitudinalControl = False ret.minEnableSpeed = -1. # engage speed is decided by PCM diff --git a/opendbc/car/honda/carstate.py b/opendbc/car/honda/carstate.py index b70a9a394ba..7fb19b3b8f9 100644 --- a/opendbc/car/honda/carstate.py +++ b/opendbc/car/honda/carstate.py @@ -6,7 +6,7 @@ from opendbc.car import Bus, create_button_events, structs from opendbc.car.common.conversions import Conversions as CV from opendbc.car.honda.hondacan import CanBus, get_cruise_speed_conversion -from opendbc.car.honda.values import CAR, DBC, STEER_THRESHOLD, HONDA_BOSCH, \ +from opendbc.car.honda.values import CAR, DBC, STEER_THRESHOLD, HONDA_BOSCH, HONDA_BOSCH_CANFD, \ HONDA_NIDEC_ALT_SCM_MESSAGES, HONDA_BOSCH_RADARLESS, \ HondaFlags, CruiseButtons, CruiseSettings, GearShifter from opendbc.car.interfaces import CarStateBase @@ -68,13 +68,9 @@ def get_can_messages(CP, gearbox_msg): else: messages.append(("CRUISE_PARAMS", 50)) - # TODO: clean this up - if CP.carFingerprint in (CAR.HONDA_ACCORD, CAR.HONDA_CIVIC_BOSCH, CAR.HONDA_CIVIC_BOSCH_DIESEL, CAR.HONDA_CRV_HYBRID, CAR.HONDA_INSIGHT, - CAR.ACURA_RDX_3G, CAR.HONDA_E, CAR.HONDA_CIVIC_2022, CAR.HONDA_HRV_3G): - pass - elif CP.carFingerprint in (CAR.HONDA_ODYSSEY_CHN, CAR.HONDA_FREED, CAR.HONDA_HRV): - pass - else: + if CP.carFingerprint not in (CAR.HONDA_ACCORD, CAR.HONDA_CIVIC_BOSCH, CAR.HONDA_CIVIC_BOSCH_DIESEL, CAR.HONDA_CRV_HYBRID, CAR.HONDA_INSIGHT, + CAR.ACURA_RDX_3G, CAR.HONDA_E, CAR.HONDA_ODYSSEY_CHN, CAR.HONDA_FREED, CAR.HONDA_HRV, *HONDA_BOSCH_RADARLESS, + *HONDA_BOSCH_CANFD): messages.append(("DOORS_STATUS", 3)) if CP.carFingerprint in HONDA_BOSCH_RADARLESS: @@ -92,6 +88,8 @@ def __init__(self, CP): self.gearbox_msg = "GEARBOX" if CP.carFingerprint == CAR.HONDA_ACCORD and CP.transmissionType == TransmissionType.cvt: self.gearbox_msg = "GEARBOX_15T" + elif CP.carFingerprint == CAR.HONDA_CIVIC_2022 and CP.transmissionType == TransmissionType.cvt: + self.gearbox_msg = "GEARBOX_ALT" elif CP.transmissionType == TransmissionType.manual: self.gearbox_msg = "GEARBOX_ALT_2" @@ -139,7 +137,7 @@ def update(self, can_parsers) -> structs.CarState: ret.standstill = cp.vl["ENGINE_DATA"]["XMISSION_SPEED"] < 1e-5 # TODO: find a common signal across all cars if self.CP.carFingerprint in (CAR.HONDA_ACCORD, CAR.HONDA_CIVIC_BOSCH, CAR.HONDA_CIVIC_BOSCH_DIESEL, CAR.HONDA_CRV_HYBRID, CAR.HONDA_INSIGHT, - CAR.ACURA_RDX_3G, CAR.HONDA_E, CAR.HONDA_CIVIC_2022, CAR.HONDA_HRV_3G): + CAR.ACURA_RDX_3G, CAR.HONDA_E, *HONDA_BOSCH_RADARLESS, *HONDA_BOSCH_CANFD): ret.doorOpen = bool(cp.vl["SCM_FEEDBACK"]["DRIVERS_DOOR_OPEN"]) elif self.CP.carFingerprint in (CAR.HONDA_ODYSSEY_CHN, CAR.HONDA_FREED, CAR.HONDA_HRV): ret.doorOpen = bool(cp.vl["SCM_BUTTONS"]["DRIVERS_DOOR_OPEN"]) diff --git a/opendbc/car/honda/fingerprints.py b/opendbc/car/honda/fingerprints.py index 83a085bea01..307977615a3 100644 --- a/opendbc/car/honda/fingerprints.py +++ b/opendbc/car/honda/fingerprints.py @@ -867,6 +867,8 @@ b'39990-T39-A130\x00\x00', b'39990-T43-J020\x00\x00', b'39990-T60-J030\x00\x00', + b'39990-T56-A040\x00\x00', + b'39990-T50-J030\x00\x00', ], (Ecu.gateway, 0x18daeff1, None): [ b'38897-T20-A020\x00\x00', @@ -877,6 +879,8 @@ b'38897-T22-A110\x00\x00', b'38897-T24-Z120\x00\x00', b'38897-T60-A110\x00\x00', + b'38897-T61-A320\x00\x00', + b'38897-T50-E310\x00\x00', ], (Ecu.srs, 0x18da53f1, None): [ b'77959-T20-A970\x00\x00', @@ -886,6 +890,9 @@ b'77959-T47-A940\x00\x00', b'77959-T47-A950\x00\x00', b'77959-T60-A920\x00\x00', + b'77959-T61-A920\x00\x00', + b'77959-T50-G930\x00\x00', + b'77959-T65-A920\x00\x00', ], (Ecu.fwdRadar, 0x18dab0f1, None): [ b'36161-T20-A060\x00\x00', @@ -898,6 +905,9 @@ b'8S102-T20-AA10\x00\x00', b'8S102-T47-AA10\x00\x00', b'8S102-T60-AA10\x00\x00', + b'8S102-T56-A060\x00\x00', + b'8S102-T50-EA10\x00\x00', + b'8S102-T64-A040\x00\x00', ], (Ecu.vsa, 0x18da28f1, None): [ b'57114-T20-AB40\x00\x00', @@ -905,6 +915,8 @@ b'57114-T38-AA20\x00\x00', b'57114-T43-JB30\x00\x00', b'57114-T60-AA20\x00\x00', + b'57114-T61-AJ30\x00\x00', + b'57114-T50-JC20\x00\x00', ], (Ecu.transmission, 0x18da1ef1, None): [ b'28101-65D-A020\x00\x00', @@ -914,4 +926,12 @@ b'28101-65J-N010\x00\x00', ], }, + CAR.HONDA_PILOT_4G: { + (Ecu.fwdCamera, 0x18dab5f1, None): [ + b'8S102-T90-A050\x00\x00', + ], + (Ecu.fwdRadar, 0x18dab0f1, None): [ + b'8S302-T90-A040\x00\x00', + ], + }, } diff --git a/opendbc/car/honda/hondacan.py b/opendbc/car/honda/hondacan.py index 878bdcb62bd..ec2c5d25ae0 100644 --- a/opendbc/car/honda/hondacan.py +++ b/opendbc/car/honda/hondacan.py @@ -1,6 +1,6 @@ from opendbc.car import CanBusBase from opendbc.car.common.conversions import Conversions as CV -from opendbc.car.honda.values import HondaFlags, HONDA_BOSCH, HONDA_BOSCH_RADARLESS, CAR, CarControllerParams +from opendbc.car.honda.values import HondaFlags, HONDA_BOSCH, HONDA_BOSCH_RADARLESS, HONDA_BOSCH_CANFD, CAR, CarControllerParams # CAN bus layout with relay # 0 = ACC-CAN - radar side @@ -14,7 +14,8 @@ def __init__(self, CP=None, fingerprint=None) -> None: # use fingerprint if specified super().__init__(CP if fingerprint is None else None, fingerprint) - if CP.carFingerprint in (HONDA_BOSCH - HONDA_BOSCH_RADARLESS): + # powertrain bus is split instead of radar on radarless and CAN FD Bosch + if CP.carFingerprint in (HONDA_BOSCH - HONDA_BOSCH_RADARLESS - HONDA_BOSCH_CANFD): self._pt, self._radar = self.offset + 1, self.offset # normally steering commands are sent to radar, which forwards them to powertrain bus # when radar is disabled, steering commands are sent directly to powertrain bus @@ -46,7 +47,7 @@ def body(self) -> int: def get_cruise_speed_conversion(car_fingerprint: str, is_metric: bool) -> float: # on certain cars, CRUISE_SPEED changes to imperial with car's unit setting - return CV.MPH_TO_MS if car_fingerprint in HONDA_BOSCH_RADARLESS and not is_metric else CV.KPH_TO_MS + return CV.MPH_TO_MS if car_fingerprint in (HONDA_BOSCH_RADARLESS | HONDA_BOSCH_CANFD) and not is_metric else CV.KPH_TO_MS def create_brake_command(packer, CAN, apply_brake, pump_on, pcm_override, pcm_cancel_cmd, fcw, car_fingerprint, stock_brake): @@ -173,11 +174,14 @@ def create_ui_commands(packer, CAN, CP, enabled, pcm_speed, hud, is_metric, acc_ 'BEEP': 0, } - if CP.carFingerprint in HONDA_BOSCH_RADARLESS: + if CP.carFingerprint in (HONDA_BOSCH_RADARLESS | HONDA_BOSCH_CANFD): lkas_hud_values['LANE_LINES'] = 3 lkas_hud_values['DASHED_LANES'] = hud.lanes_visible + # car likely needs to see LKAS_PROBLEM fall within a specific time frame, so forward from camera - lkas_hud_values['LKAS_PROBLEM'] = lkas_hud['LKAS_PROBLEM'] + # TODO: needed for Bosch CAN FD? + if CP.carFingerprint in HONDA_BOSCH_RADARLESS: + lkas_hud_values['LKAS_PROBLEM'] = lkas_hud['LKAS_PROBLEM'] if not (CP.flags & HondaFlags.BOSCH_EXT_HUD): lkas_hud_values['SET_ME_X48'] = 0x48 @@ -206,6 +210,6 @@ def spam_buttons_command(packer, CAN, button_val, car_fingerprint): 'CRUISE_BUTTONS': button_val, 'CRUISE_SETTING': 0, } - # send buttons to camera on radarless cars + # send buttons to camera on radarless (camera does ACC) cars bus = CAN.camera if car_fingerprint in HONDA_BOSCH_RADARLESS else CAN.pt return packer.make_can_msg("SCM_BUTTONS", bus, values) diff --git a/opendbc/car/honda/interface.py b/opendbc/car/honda/interface.py index e1943e03e1d..d92bcc24d52 100755 --- a/opendbc/car/honda/interface.py +++ b/opendbc/car/honda/interface.py @@ -4,7 +4,7 @@ from opendbc.car.common.conversions import Conversions as CV from opendbc.car.disable_ecu import disable_ecu from opendbc.car.honda.hondacan import CanBus -from opendbc.car.honda.values import CarControllerParams, HondaFlags, CAR, HONDA_BOSCH, \ +from opendbc.car.honda.values import CarControllerParams, HondaFlags, CAR, HONDA_BOSCH, HONDA_BOSCH_CANFD, \ HONDA_NIDEC_ALT_SCM_MESSAGES, HONDA_BOSCH_RADARLESS, HondaSafetyFlags from opendbc.car.honda.carcontroller import CarController from opendbc.car.honda.carstate import CarState @@ -31,19 +31,27 @@ def get_pid_accel_limits(CP, current_speed, cruise_speed): return CarControllerParams.NIDEC_ACCEL_MIN, np.interp(current_speed, ACCEL_MAX_BP, ACCEL_MAX_VALS) @staticmethod - def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experimental_long, docs) -> structs.CarParams: + def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, alpha_long, docs) -> structs.CarParams: ret.brand = "honda" CAN = CanBus(ret, fingerprint) + # Recent test route is needed to undashcam these cars + ret.dashcamOnly = candidate in HONDA_BOSCH_CANFD + if candidate in HONDA_BOSCH: - ret.safetyConfigs = [get_safety_config(structs.CarParams.SafetyModel.hondaBosch)] + cfgs = [get_safety_config(structs.CarParams.SafetyModel.hondaBosch)] + if candidate in HONDA_BOSCH_CANFD and CAN.pt >= 4: + cfgs.insert(0, get_safety_config(structs.CarParams.SafetyModel.noOutput)) + ret.safetyConfigs = cfgs + ret.radarUnavailable = True # Disable the radar and let openpilot control longitudinal # WARNING: THIS DISABLES AEB! # If Bosch radarless, this blocks ACC messages from the camera - ret.experimentalLongitudinalAvailable = True - ret.openpilotLongitudinalControl = experimental_long + # TODO: get radar disable working on Bosch CANFD + ret.alphaLongitudinalAvailable = candidate not in HONDA_BOSCH_CANFD + ret.openpilotLongitudinalControl = alpha_long ret.pcmCruise = not ret.openpilotLongitudinalControl else: ret.safetyConfigs = [get_safety_config(structs.CarParams.SafetyModel.hondaNidec)] @@ -61,9 +69,12 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experime # Accord ICE 1.5T CVT has different gearbox message if candidate == CAR.HONDA_ACCORD and 0x191 in fingerprint[CAN.pt]: ret.transmissionType = TransmissionType.cvt - # New Civics can have manual transmission - elif candidate == CAR.HONDA_CIVIC_2022 and 0x191 not in fingerprint[CAN.pt]: + # Civic Type R is missing 0x191 and 0x1A3 + elif candidate == CAR.HONDA_CIVIC_2022 and all(msg not in fingerprint[CAN.pt] for msg in (0x191, 0x1A3)): ret.transmissionType = TransmissionType.manual + # New Civics dont have 0x191, but do have 0x1A3 + elif candidate == CAR.HONDA_CIVIC_2022 and 0x1A3 in fingerprint[CAN.pt]: + ret.transmissionType = TransmissionType.cvt # Certain Hondas have an extra steering sensor at the bottom of the steering rack, # which improves controls quality as it removes the steering column torsion from feedback. @@ -170,7 +181,7 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experime else: ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 4096], [0, 4096]] # TODO: determine if there is a dead zone at the top end - elif candidate == CAR.HONDA_PILOT: + elif candidate in (CAR.HONDA_PILOT, CAR.HONDA_PILOT_4G): ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 4096], [0, 4096]] # TODO: determine if there is a dead zone at the top end ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.38], [0.11]] @@ -195,17 +206,17 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experime ret.flags |= HondaFlags.BOSCH_ALT_BRAKE.value if ret.flags & HondaFlags.BOSCH_ALT_BRAKE: - ret.safetyConfigs[0].safetyParam |= HondaSafetyFlags.ALT_BRAKE.value + ret.safetyConfigs[-1].safetyParam |= HondaSafetyFlags.ALT_BRAKE.value # These cars use alternate SCM messages (SCM_FEEDBACK AND SCM_BUTTON) if candidate in HONDA_NIDEC_ALT_SCM_MESSAGES: - ret.safetyConfigs[0].safetyParam |= HondaSafetyFlags.NIDEC_ALT.value + ret.safetyConfigs[-1].safetyParam |= HondaSafetyFlags.NIDEC_ALT.value if ret.openpilotLongitudinalControl and candidate in HONDA_BOSCH: - ret.safetyConfigs[0].safetyParam |= HondaSafetyFlags.BOSCH_LONG.value + ret.safetyConfigs[-1].safetyParam |= HondaSafetyFlags.BOSCH_LONG.value if candidate in HONDA_BOSCH_RADARLESS: - ret.safetyConfigs[0].safetyParam |= HondaSafetyFlags.RADARLESS.value + ret.safetyConfigs[-1].safetyParam |= HondaSafetyFlags.RADARLESS.value # min speed to enable ACC. if car can do stop and go, then set enabling speed # to a negative value, so it won't matter. Otherwise, add 0.5 mph margin to not diff --git a/opendbc/car/honda/values.py b/opendbc/car/honda/values.py index 04ffb3f8ba1..592a4c76339 100644 --- a/opendbc/car/honda/values.py +++ b/opendbc/car/honda/values.py @@ -3,7 +3,7 @@ from opendbc.car import Bus, CarSpecs, PlatformConfig, Platforms, structs, uds from opendbc.car.common.conversions import Conversions as CV -from opendbc.car.docs_definitions import CarFootnote, CarHarness, CarDocs, CarParts, Column +from opendbc.car.docs_definitions import CarFootnote, CarHarness, CarDocs, CarParts, Column, Device from opendbc.car.fw_query_definitions import FwQueryConfig, Request, StdQueries, p16 Ecu = structs.CarParams.Ecu @@ -68,6 +68,7 @@ class HondaFlags(IntFlag): NIDEC_ALT_PCM_ACCEL = 32 NIDEC_ALT_SCM_MESSAGES = 64 + BOSCH_CANFD = 128 # Car button codes class CruiseButtons: @@ -101,9 +102,19 @@ class HondaCarDocs(CarDocs): def init_make(self, CP: structs.CarParams): if CP.flags & HondaFlags.BOSCH: - self.car_parts = CarParts.common([CarHarness.bosch_b]) if CP.flags & HondaFlags.BOSCH_RADARLESS else CarParts.common([CarHarness.bosch_a]) + if CP.flags & HondaFlags.BOSCH_CANFD: + harness = CarHarness.bosch_c + elif CP.flags & HondaFlags.BOSCH_RADARLESS: + harness = CarHarness.bosch_b + else: + harness = CarHarness.bosch_a else: - self.car_parts = CarParts.common([CarHarness.nidec]) + harness = CarHarness.nidec + + if CP.carFingerprint in (CAR.HONDA_PILOT_4G,): + self.car_parts = CarParts([Device.threex_angled_mount, harness]) + else: + self.car_parts = CarParts.common([harness]) class Footnote(Enum): @@ -156,6 +167,9 @@ class CAR(Platforms): [ HondaCarDocs("Honda Civic 2022-24", "All", video_link="https://youtu.be/ytiOT5lcp6Q"), HondaCarDocs("Honda Civic Hatchback 2022-24", "All", video_link="https://youtu.be/ytiOT5lcp6Q"), + HondaCarDocs("Honda Civic Hatchback Hybrid 2023 (Europe only)", "All"), + # TODO: Confirm 2024 + HondaCarDocs("Honda Civic Hatchback Hybrid 2025", "All"), ], HONDA_CIVIC_BOSCH.specs, {Bus.pt: 'honda_civic_ex_2022_can_generated'}, @@ -196,6 +210,12 @@ class CAR(Platforms): CarSpecs(mass=3338.8 * CV.LB_TO_KG, wheelbase=2.5, centerToFrontRatio=0.5, steerRatio=16.71, tireStiffnessFactor=0.82), {Bus.pt: 'acura_rdx_2020_can_generated'}, ) + HONDA_PILOT_4G = HondaBoschPlatformConfig( + [HondaCarDocs("Honda Pilot 2023", "All")], + CarSpecs(mass=4278 * CV.LB_TO_KG, wheelbase=2.86, centerToFrontRatio=0.428, steerRatio=16.0, tireStiffnessFactor=0.444), # as spec + {Bus.pt: 'honda_pilot_2023_can_generated'}, + flags=HondaFlags.BOSCH_CANFD | HondaFlags.BOSCH_ALT_BRAKE, + ) # Nidec Cars ACURA_ILX = HondaNidecPlatformConfig( @@ -257,7 +277,7 @@ class CAR(Platforms): HondaCarDocs("Honda Pilot 2016-22", min_steer_speed=12. * CV.MPH_TO_MS), HondaCarDocs("Honda Passport 2019-25", "All", min_steer_speed=12. * CV.MPH_TO_MS), ], - CarSpecs(mass=4278 * CV.LB_TO_KG, wheelbase=2.86, centerToFrontRatio=0.428, steerRatio=16.0, tireStiffnessFactor=0.444), # as spec + HONDA_PILOT_4G.specs, radar_dbc_dict('acura_ilx_2016_can_generated'), flags=HondaFlags.NIDEC_ALT_SCM_MESSAGES, ) @@ -339,6 +359,7 @@ class CAR(Platforms): HONDA_NIDEC_ALT_SCM_MESSAGES = CAR.with_flags(HondaFlags.NIDEC_ALT_SCM_MESSAGES) HONDA_BOSCH = CAR.with_flags(HondaFlags.BOSCH) HONDA_BOSCH_RADARLESS = CAR.with_flags(HondaFlags.BOSCH_RADARLESS) +HONDA_BOSCH_CANFD = CAR.with_flags(HondaFlags.BOSCH_CANFD) DBC = CAR.create_dbc_map() diff --git a/opendbc/car/hyundai/fingerprints.py b/opendbc/car/hyundai/fingerprints.py index 40baad577d2..4e4f8aadb65 100644 --- a/opendbc/car/hyundai/fingerprints.py +++ b/opendbc/car/hyundai/fingerprints.py @@ -288,12 +288,14 @@ b'\xf1\x00TM ESC \x04 102!\x04\x05 58910-S2GA0', b'\xf1\x00TM ESC \x04 103"\x07\x08 58910-S2GA0', b'\xf1\x00TM ESC \x1e 102 \x08\x08 58910-S1DA0', + b'\xf1\x00TM ESC \x1b 102 \x08\x08 58910-S1DA0', b'\xf1\x00TM ESC 103!\x030 58910-S1MA0', ], (Ecu.eps, 0x7d4, None): [ b'\xf1\x00TM MDPS C 1.00 1.01 56310-S1AB0 4TSDC101', b'\xf1\x00TM MDPS C 1.00 1.01 56310-S1EB0 4TSDC101', b'\xf1\x00TM MDPS C 1.00 1.02 56370-S2AA0 0B19', + b'\xf1\x00TM MDPS R 1.00 1.05 57700-S1500 4TSDP105', ], (Ecu.fwdCamera, 0x7c4, None): [ b'\xf1\x00TM MFC AT EUR LHD 1.00 1.03 99211-S1500 210224', diff --git a/opendbc/car/hyundai/interface.py b/opendbc/car/hyundai/interface.py index 867d8144c7e..6b388c0a09a 100644 --- a/opendbc/car/hyundai/interface.py +++ b/opendbc/car/hyundai/interface.py @@ -23,7 +23,7 @@ class CarInterface(CarInterfaceBase): RadarInterface = RadarInterface @staticmethod - def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experimental_long, docs) -> structs.CarParams: + def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, alpha_long, docs) -> structs.CarParams: ret.brand = "hyundai" cam_can = CanBus(None, fingerprint).CAM @@ -32,10 +32,10 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experime if ret.flags & HyundaiFlags.CANFD: # Shared configuration for CAN-FD cars - ret.experimentalLongitudinalAvailable = candidate not in CANFD_UNSUPPORTED_LONGITUDINAL_CAR + ret.alphaLongitudinalAvailable = candidate not in CANFD_UNSUPPORTED_LONGITUDINAL_CAR if lka_steering and Ecu.adas not in [fw.ecu for fw in car_fw]: # this needs to be figured out for cars without an ADAS ECU - ret.experimentalLongitudinalAvailable = False + ret.alphaLongitudinalAvailable = False ret.enableBsm = 0x1e5 in fingerprint[CAN.ECAN] @@ -81,7 +81,7 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experime else: # Shared configuration for non CAN-FD cars - ret.experimentalLongitudinalAvailable = candidate not in UNSUPPORTED_LONGITUDINAL_CAR + ret.alphaLongitudinalAvailable = candidate not in UNSUPPORTED_LONGITUDINAL_CAR ret.enableBsm = 0x58b in fingerprint[0] # Send LFA message on cars with HDA @@ -125,7 +125,7 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experime RADAR_START_ADDR = RADAR_START_ADDR_CANFD if ret.flags & HyundaiFlags.CANFD else RADAR_START_ADDR_CAN ret.radarUnavailable = RADAR_START_ADDR not in fingerprint[1] or Bus.radar not in DBC[ret.carFingerprint] - ret.openpilotLongitudinalControl = experimental_long and ret.experimentalLongitudinalAvailable + ret.openpilotLongitudinalControl = alpha_long and ret.alphaLongitudinalAvailable ret.pcmCruise = not ret.openpilotLongitudinalControl ret.startingState = True ret.vEgoStarting = 0.1 diff --git a/opendbc/car/hyundai/values.py b/opendbc/car/hyundai/values.py index bf4d43ed556..66b9bce9207 100644 --- a/opendbc/car/hyundai/values.py +++ b/opendbc/car/hyundai/values.py @@ -258,7 +258,7 @@ class CAR(Platforms): HYUNDAI_KONA_2022 = HyundaiPlatformConfig( [HyundaiCarDocs("Hyundai Kona 2022", car_parts=CarParts.common([CarHarness.hyundai_o]))], CarSpecs(mass=1491, wheelbase=2.6, steerRatio=13.42, tireStiffnessFactor=0.385), - flags=HyundaiFlags.CAMERA_SCC, + flags=HyundaiFlags.CAMERA_SCC | HyundaiFlags.ALT_LIMITS_2, ) HYUNDAI_KONA_2ND_GEN = HyundaiCanFDPlatformConfig( [HyundaiCarDocs("Hyundai Kona 2024-25", car_parts=CarParts.common([CarHarness.hyundai_l]))], diff --git a/opendbc/car/interfaces.py b/opendbc/car/interfaces.py index 84509490e5a..f8daef75be8 100644 --- a/opendbc/car/interfaces.py +++ b/opendbc/car/interfaces.py @@ -135,7 +135,7 @@ def get_non_essential_params(cls, candidate: str) -> structs.CarParams: @classmethod def get_params(cls, candidate: str, fingerprint: dict[int, dict[int, int]], car_fw: list[structs.CarParams.CarFw], - experimental_long: bool, docs: bool) -> structs.CarParams: + alpha_long: bool, docs: bool) -> structs.CarParams: ret = CarInterfaceBase.get_std_params(candidate) platform = PLATFORMS[candidate] @@ -148,7 +148,7 @@ def get_params(cls, candidate: str, fingerprint: dict[int, dict[int, int]], car_ ret.tireStiffnessFactor = platform.config.specs.tireStiffnessFactor ret.flags |= int(platform.config.flags) - ret = cls._get_params(ret, candidate, fingerprint, car_fw, experimental_long, docs) + ret = cls._get_params(ret, candidate, fingerprint, car_fw, alpha_long, docs) # Vehicle mass is published curb weight plus assumed payload such as a human driver; notCars have no assumed payload if not ret.notCar: @@ -163,7 +163,7 @@ def get_params(cls, candidate: str, fingerprint: dict[int, dict[int, int]], car_ @staticmethod @abstractmethod def _get_params(ret: structs.CarParams, candidate, fingerprint: dict[int, dict[int, int]], - car_fw: list[structs.CarParams.CarFw], experimental_long: bool, docs: bool) -> structs.CarParams: + car_fw: list[structs.CarParams.CarFw], alpha_long: bool, docs: bool) -> structs.CarParams: raise NotImplementedError @staticmethod diff --git a/opendbc/car/mazda/interface.py b/opendbc/car/mazda/interface.py index 72fcd84475c..ff2869ccfbb 100755 --- a/opendbc/car/mazda/interface.py +++ b/opendbc/car/mazda/interface.py @@ -12,7 +12,7 @@ class CarInterface(CarInterfaceBase): CarController = CarController @staticmethod - def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experimental_long, docs) -> structs.CarParams: + def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, alpha_long, docs) -> structs.CarParams: ret.brand = "mazda" ret.safetyConfigs = [get_safety_config(structs.CarParams.SafetyModel.mazda)] ret.radarUnavailable = True diff --git a/opendbc/car/mock/interface.py b/opendbc/car/mock/interface.py index d825e54e1b5..0a58f6ed281 100755 --- a/opendbc/car/mock/interface.py +++ b/opendbc/car/mock/interface.py @@ -11,7 +11,7 @@ class CarInterface(CarInterfaceBase): CarController = CarController @staticmethod - def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experimental_long, docs) -> structs.CarParams: + def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, alpha_long, docs) -> structs.CarParams: ret.brand = "mock" ret.mass = 1700. ret.wheelbase = 2.70 diff --git a/opendbc/car/nissan/interface.py b/opendbc/car/nissan/interface.py index 6f2eb021a42..6216291673b 100644 --- a/opendbc/car/nissan/interface.py +++ b/opendbc/car/nissan/interface.py @@ -10,7 +10,7 @@ class CarInterface(CarInterfaceBase): CarController = CarController @staticmethod - def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experimental_long, docs) -> structs.CarParams: + def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, alpha_long, docs) -> structs.CarParams: ret.brand = "nissan" ret.safetyConfigs = [get_safety_config(structs.CarParams.SafetyModel.nissan)] ret.autoResumeSng = False diff --git a/opendbc/car/rivian/interface.py b/opendbc/car/rivian/interface.py index 509889b51bc..07b69ce0aef 100644 --- a/opendbc/car/rivian/interface.py +++ b/opendbc/car/rivian/interface.py @@ -12,7 +12,7 @@ class CarInterface(CarInterfaceBase): RadarInterface = RadarInterface @staticmethod - def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experimental_long, docs) -> structs.CarParams: + def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, alpha_long, docs) -> structs.CarParams: ret.brand = "rivian" ret.safetyConfigs = [get_safety_config(structs.CarParams.SafetyModel.rivian)] @@ -25,8 +25,8 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experime ret.radarUnavailable = True # TODO: pending finding/handling missing set speed and fixing up radar parser - ret.experimentalLongitudinalAvailable = False - if experimental_long: + ret.alphaLongitudinalAvailable = False + if alpha_long: ret.openpilotLongitudinalControl = True ret.safetyConfigs[0].safetyParam |= RivianSafetyFlags.LONG_CONTROL.value diff --git a/opendbc/car/subaru/interface.py b/opendbc/car/subaru/interface.py index 4fe4f2dd984..6d940fde7a3 100644 --- a/opendbc/car/subaru/interface.py +++ b/opendbc/car/subaru/interface.py @@ -11,7 +11,7 @@ class CarInterface(CarInterfaceBase): CarController = CarController @staticmethod - def _get_params(ret: structs.CarParams, candidate: CAR, fingerprint, car_fw, experimental_long, docs) -> structs.CarParams: + def _get_params(ret: structs.CarParams, candidate: CAR, fingerprint, car_fw, alpha_long, docs) -> structs.CarParams: ret.brand = "subaru" ret.radarUnavailable = True # for HYBRID CARS to be upstreamed, we need: @@ -86,9 +86,9 @@ def _get_params(ret: structs.CarParams, candidate: CAR, fingerprint, car_fw, exp else: raise ValueError(f"unknown car: {candidate}") - ret.experimentalLongitudinalAvailable = not (ret.flags & (SubaruFlags.GLOBAL_GEN2 | SubaruFlags.PREGLOBAL | - SubaruFlags.LKAS_ANGLE | SubaruFlags.HYBRID)) - ret.openpilotLongitudinalControl = experimental_long and ret.experimentalLongitudinalAvailable + ret.alphaLongitudinalAvailable = not (ret.flags & (SubaruFlags.GLOBAL_GEN2 | SubaruFlags.PREGLOBAL | + SubaruFlags.LKAS_ANGLE | SubaruFlags.HYBRID)) + ret.openpilotLongitudinalControl = alpha_long and ret.alphaLongitudinalAvailable if ret.flags & SubaruFlags.GLOBAL_GEN2 and ret.openpilotLongitudinalControl: ret.flags |= SubaruFlags.DISABLE_EYESIGHT.value diff --git a/opendbc/car/subaru/values.py b/opendbc/car/subaru/values.py index 68171c5dd5b..066f9e8bc77 100644 --- a/opendbc/car/subaru/values.py +++ b/opendbc/car/subaru/values.py @@ -103,7 +103,7 @@ class SubaruCarDocs(CarDocs): def init_make(self, CP: CarParams): self.car_parts.parts.extend([Tool.socket_8mm_deep, Tool.pry_tool]) - if CP.experimentalLongitudinalAvailable: + if CP.alphaLongitudinalAvailable: self.footnotes.append(Footnote.EXP_LONG) diff --git a/opendbc/car/tesla/interface.py b/opendbc/car/tesla/interface.py index 1796bdba835..ca4823281e9 100644 --- a/opendbc/car/tesla/interface.py +++ b/opendbc/car/tesla/interface.py @@ -10,7 +10,7 @@ class CarInterface(CarInterfaceBase): CarController = CarController @staticmethod - def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experimental_long, docs) -> structs.CarParams: + def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, alpha_long, docs) -> structs.CarParams: ret.brand = "tesla" ret.safetyConfigs = [get_safety_config(structs.CarParams.SafetyModel.tesla)] @@ -22,8 +22,8 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experime ret.steerControlType = structs.CarParams.SteerControlType.angle ret.radarUnavailable = True - ret.experimentalLongitudinalAvailable = True - if experimental_long: + ret.alphaLongitudinalAvailable = True + if alpha_long: ret.openpilotLongitudinalControl = True ret.safetyConfigs[0].safetyParam |= TeslaSafetyFlags.LONG_CONTROL.value diff --git a/opendbc/car/tesla/values.py b/opendbc/car/tesla/values.py index c771a9459ff..e094d152275 100644 --- a/opendbc/car/tesla/values.py +++ b/opendbc/car/tesla/values.py @@ -15,19 +15,23 @@ class Footnote(Enum): "See this page for more information.", Column.MODEL) + SETUP = CarFootnote( + "See more setup details for Tesla.", + Column.MAKE, setup_note=True) + @dataclass class TeslaCarDocsHW3(CarDocs): package: str = "All" car_parts: CarParts = field(default_factory=CarParts.common([CarHarness.tesla_a])) - footnotes: list[Enum] = field(default_factory=lambda: [Footnote.HW_TYPE]) + footnotes: list[Enum] = field(default_factory=lambda: [Footnote.HW_TYPE, Footnote.SETUP]) @dataclass class TeslaCarDocsHW4(CarDocs): package: str = "All" car_parts: CarParts = field(default_factory=CarParts.common([CarHarness.tesla_b])) - footnotes: list[Enum] = field(default_factory=lambda: [Footnote.HW_TYPE]) + footnotes: list[Enum] = field(default_factory=lambda: [Footnote.HW_TYPE, Footnote.SETUP]) @dataclass diff --git a/opendbc/car/tests/routes.py b/opendbc/car/tests/routes.py index f8522806073..4b5c9c96751 100644 --- a/opendbc/car/tests/routes.py +++ b/opendbc/car/tests/routes.py @@ -106,7 +106,9 @@ class CarTestRoute(NamedTuple): CarTestRoute("54fd8451b3974762|2021-04-01--14-50-10", HONDA.HONDA_RIDGELINE), CarTestRoute("2d5808fae0b38ac6|2021-09-01--17-14-11", HONDA.HONDA_E), CarTestRoute("f44aa96ace22f34a|2021-12-22--06-22-31", HONDA.HONDA_CIVIC_2022), - CarTestRoute("1f032f5173c8ad99/00000006--573b3fcaf5", HONDA.HONDA_CIVIC_2022), # Civic Type R with manual transmission + CarTestRoute("1f032f5173c8ad99/00000006--573b3fcaf5", HONDA.HONDA_CIVIC_2022), # Civic Type R with manual transmission + CarTestRoute("b1c832ad56b6bc9d/00000010--debfcf5867", HONDA.HONDA_CIVIC_2022), # 2025 Civic Hatch Hybrid with new eCVT transmission + CarTestRoute("f9c43864cf057d05|2024-01-15--23-01-20", HONDA.HONDA_PILOT_4G), # TODO: Replace with a newer route CarTestRoute("87d7f06ade479c2e|2023-09-11--23-30-11", HYUNDAI.HYUNDAI_AZERA_6TH_GEN), CarTestRoute("66189dd8ec7b50e6|2023-09-20--07-02-12", HYUNDAI.HYUNDAI_AZERA_HEV_6TH_GEN), diff --git a/opendbc/car/tests/test_car_interfaces.py b/opendbc/car/tests/test_car_interfaces.py index 50f3b4df201..f33deed6ed0 100644 --- a/opendbc/car/tests/test_car_interfaces.py +++ b/opendbc/car/tests/test_car_interfaces.py @@ -36,7 +36,7 @@ def get_fuzzy_car_interface_args(draw: DrawType) -> dict: params_strategy = st.fixed_dictionaries({ 'fingerprints': fingerprint_strategy, 'car_fw': car_fw_strategy, - 'experimental_long': st.booleans(), + 'alpha_long': st.booleans(), }) params: dict = draw(params_strategy) @@ -59,7 +59,7 @@ def test_car_interfaces(self, car_name, data): args = get_fuzzy_car_interface_args(data.draw) car_params = CarInterface.get_params(car_name, args['fingerprints'], args['car_fw'], - experimental_long=args['experimental_long'], docs=False) + alpha_long=args['alpha_long'], docs=False) car_interface = CarInterface(car_params) assert car_params assert car_interface diff --git a/opendbc/car/torque_data/override.toml b/opendbc/car/torque_data/override.toml index df5be8ba41a..266782e425b 100644 --- a/opendbc/car/torque_data/override.toml +++ b/opendbc/car/torque_data/override.toml @@ -41,7 +41,7 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"] "CADILLAC_ESCALADE" = [1.899999976158142, 1.842270016670227, 0.1120000034570694] "CADILLAC_ESCALADE_ESV_2019" = [1.15, 1.3, 0.2] "CADILLAC_XT4" = [1.45, 1.6, 0.2] -"CHEVROLET_BOLT_EUV" = [2.0, 2.0, 0.05] +"CHEVROLET_BOLT_EUV" = [1.0, 2.0, 0.175] "CHEVROLET_SILVERADO" = [1.9, 1.9, 0.112] "CHEVROLET_TRAILBLAZER" = [1.33, 1.9, 0.16] "CHEVROLET_TRAVERSE" = [1.33, 1.33, 0.18] @@ -86,3 +86,4 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"] # Manually checked "HONDA_CIVIC_2022" = [2.5, 1.2, 0.15] "HONDA_HRV_3G" = [2.5, 1.2, 0.2] +"HONDA_PILOT_4G" = [1.0, 1.0, 0.2] diff --git a/opendbc/car/toyota/interface.py b/opendbc/car/toyota/interface.py index 1515ebd9d97..21403aa90c9 100644 --- a/opendbc/car/toyota/interface.py +++ b/opendbc/car/toyota/interface.py @@ -21,7 +21,7 @@ def get_pid_accel_limits(CP, current_speed, cruise_speed): return CarControllerParams(CP).ACCEL_MIN, CarControllerParams(CP).ACCEL_MAX @staticmethod - def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experimental_long, docs) -> structs.CarParams: + def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, alpha_long, docs) -> structs.CarParams: ret.brand = "toyota" ret.safetyConfigs = [get_safety_config(structs.CarParams.SafetyModel.toyota)] ret.safetyConfigs[0].safetyParam = EPS_SCALE[candidate] @@ -111,10 +111,10 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experime # since we don't yet parse radar on TSS2/TSS-P radar-based ACC cars, gate longitudinal behind experimental toggle if candidate in (RADAR_ACC_CAR | NO_DSU_CAR): - ret.experimentalLongitudinalAvailable = candidate in RADAR_ACC_CAR + ret.alphaLongitudinalAvailable = candidate in RADAR_ACC_CAR # Disabling radar is only supported on TSS2 radar-ACC cars - if experimental_long and candidate in RADAR_ACC_CAR: + if alpha_long and candidate in RADAR_ACC_CAR: ret.flags |= ToyotaFlags.DISABLE_RADAR.value # openpilot longitudinal enabled by default: diff --git a/opendbc/car/volkswagen/interface.py b/opendbc/car/volkswagen/interface.py index 70a67857c80..1a07ba1e1d8 100644 --- a/opendbc/car/volkswagen/interface.py +++ b/opendbc/car/volkswagen/interface.py @@ -10,7 +10,7 @@ class CarInterface(CarInterfaceBase): CarController = CarController @staticmethod - def _get_params(ret: structs.CarParams, candidate: CAR, fingerprint, car_fw, experimental_long, docs) -> structs.CarParams: + def _get_params(ret: structs.CarParams, candidate: CAR, fingerprint, car_fw, alpha_long, docs) -> structs.CarParams: ret.brand = "volkswagen" ret.radarUnavailable = True @@ -73,8 +73,8 @@ def _get_params(ret: structs.CarParams, candidate: CAR, fingerprint, car_fw, exp # Global longitudinal tuning defaults, can be overridden per-vehicle - ret.experimentalLongitudinalAvailable = ret.networkLocation == NetworkLocation.gateway or docs - if experimental_long: + ret.alphaLongitudinalAvailable = ret.networkLocation == NetworkLocation.gateway or docs + if alpha_long: # Proof-of-concept, prep for E2E only. No radar points available. Panda ALLOW_DEBUG firmware required. ret.openpilotLongitudinalControl = True ret.safetyConfigs[0].safetyParam |= VolkswagenSafetyFlags.LONG_CONTROL.value diff --git a/opendbc/dbc/generator/honda/_bosch_adas_2018.dbc b/opendbc/dbc/generator/honda/_bosch_adas_2018.dbc index dc8def55cb1..ec7c41ceece 100644 --- a/opendbc/dbc/generator/honda/_bosch_adas_2018.dbc +++ b/opendbc/dbc/generator/honda/_bosch_adas_2018.dbc @@ -28,16 +28,17 @@ BO_ 829 LKAS_HUD: 5 ADAS SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY SG_ SET_ME_X41 : 6|7@0+ (1,0) [0|127] "" BDY SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY + SG_ CAMERA_OVERHEAT : 15|1@0+ (1,0) [0|1] "" BDY SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY - SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY + SG_ LANE_DEPARTURE_ALERT : 9|1@0+ (1,0) [0|1] "" BDY SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY - SG_ BOH_2 : 23|2@0+ (1,0) [0|4] "" BDY + SG_ LDW_ICON : 22|1@0+ (1,0) [0|1] "" BDY SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY - SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY + SG_ BEEP : 18|3@0+ (1,0) [0|7] "" BDY SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY @@ -50,5 +51,7 @@ CM_ SG_ 479 AEB_STATUS "set for the duration of AEB event"; CM_ SG_ 479 AEB_BRAKING "set when braking is commanded during AEB event"; CM_ SG_ 479 AEB_PREPARE "set 1s before AEB"; CM_ SG_ 829 BEEP "beeps are pleasant, chimes are for warnngs etc..."; +CM_ SG_ 829 CAM_TEMP_HIGH "Some Driver Assist Systems Cannot Operate: Camera Temperature Too High"; +CM_ SG_ 829 CAMERA_OVERHEAT "Lane Keeping Assist Cannot Operate: Camera Too Hot"; -VAL_ 829 BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep"; +VAL_ 829 BEEP 5 "solid_beep" 4 "double_beep" 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep"; diff --git a/opendbc/dbc/generator/nissan/_nissan_common.dbc b/opendbc/dbc/generator/nissan/_nissan_common.dbc index 13da6361b66..46a65a7b7e1 100644 --- a/opendbc/dbc/generator/nissan/_nissan_common.dbc +++ b/opendbc/dbc/generator/nissan/_nissan_common.dbc @@ -58,6 +58,10 @@ BO_ 689 PROPILOT_HUD: 8 XXX SG_ unknown55 : 55|8@0+ (1,0) [0|63] "" XXX SG_ unknown59 : 59|4@0+ (1,0) [0|15] "" XXX +BO_ 451 PROPILOT_BRAKE: 8 XXX + SG_ BRAKE_PRESSURE : 5|9@0+ (1,0) [0|511] "" XXX + SG_ BRAKE_ACTIVE : 47|1@0+ (1,0) [0|1] "" XXX + BO_ 783 CRUISE_STATE: 3 XXX SG_ CRUISE_ENABLED : 3|1@0+ (1,0) [0|1] "" XXX diff --git a/opendbc/dbc/rivian_park_assist_can.dbc b/opendbc/dbc/rivian_park_assist_can.dbc new file mode 100644 index 00000000000..1d5955125b7 --- /dev/null +++ b/opendbc/dbc/rivian_park_assist_can.dbc @@ -0,0 +1,52 @@ +VERSION "ParkAssistCAN" + + +NS_ : + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + VAL_TABLE_ + SIG_GROUP_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BS_: + +BU_: ACM CGM EPAS_P ESP IBM OCS RCM SAS TestTool VDM Vector_XXX + +BO_ 794 WheelButtons: 7 XXX + SG_ LeftButton_ScrollClick : 19|2@0+ (1,0) [0|3] "" XXX + SG_ LeftButton_RightClick : 21|2@0+ (1,0) [0|3] "" XXX + SG_ LeftButton_LeftClick : 22|2@1+ (1,0) [0|3] "" XXX + SG_ LeftBUtton_Scroll : 31|8@0+ (1,0) [0|255] "" XXX + SG_ RightButton_ScrollClick : 35|2@0+ (1,0) [0|3] "" XXX + SG_ RightButton_RightClick : 37|2@0+ (1,0) [0|3] "" XXX + SG_ RightButton_LeftClick : 38|2@1+ (1,0) [0|3] "" XXX + SG_ RightButton_Scroll : 47|8@0+ (1,0) [0|255] "" XXX + +BO_ 848 BSM_BlindSpotIndicator: 4 XXX + SG_ BSM_BlindSpotIndicator_Checksum : 0|8@1+ (1,0) [0|255] "" XXX + SG_ BSM_BlindSpotIndicator_Counter : 11|4@0+ (1,0) [0|15] "" XXX + SG_ BSM_BlindSpotIndicator_Left : 28|1@0+ (1,0) [0|1] "" XXX + SG_ BSM_BlindSpotIndicator_Right : 30|1@0+ (1,0) [0|1] "" XXX \ No newline at end of file diff --git a/opendbc/dbc/rivian_primary_actuator.dbc b/opendbc/dbc/rivian_primary_actuator.dbc index 6422562d0d7..af0489239d6 100644 --- a/opendbc/dbc/rivian_primary_actuator.dbc +++ b/opendbc/dbc/rivian_primary_actuator.dbc @@ -327,6 +327,7 @@ BO_ 565 IndicatorLights: 8 XXX SG_ DriverDoor : 28|2@0+ (1,0) [0|3] "" XXX SG_ RearPassengerDoor : 38|2@0+ (1,0) [0|3] "" XXX SG_ TurnLightLeft : 40|2@0+ (1,0) [0|3] "" XXX + SG_ IgnitionOn : 48|1@0+ (1,0) [0|1] "" XXX SG_ TurnLightRight : 54|2@0+ (1,0) [0|3] "" XXX BO_ 592 VDM_EcasStatus: 8 VDM diff --git a/opendbc/dbc/tesla_model3_party.dbc b/opendbc/dbc/tesla_model3_party.dbc index 2f7b67a0c42..86dc20a0f63 100644 --- a/opendbc/dbc/tesla_model3_party.dbc +++ b/opendbc/dbc/tesla_model3_party.dbc @@ -189,7 +189,9 @@ BO_ 599 DI_speed: 8 PARTY SG_ DI_speedCounter : 8|4@1+ (1,0) [0|15] "" park SG_ DI_speedChecksum : 0|8@1+ (1,0) [0|255] "" park -BO_ 605 XXX_longitudinalRelated: 6 XXX +BO_ 605 DAS_road: 6 XXX + SG_ DAS_stopLineDist : 16|8@1+ (0.5,0) [0|127.5] "m" XXX + SG_ DAS_trafficLightColor : 26|3@0+ (1,0) [0|7] "" XXX BO_ 1160 DAS_steeringControl: 4 PARTY SG_ DAS_steeringControlChecksum : 31|8@0+ (1,0) [0|255] "" aps @@ -347,6 +349,7 @@ VAL_ 280 DI_immobilizerState 2 "DI_IMM_STATE_AUTHENTICATING" 0 "DI_IMM_STATE_INI VAL_ 280 DI_gear 1 "DI_GEAR_P" 0 "DI_GEAR_INVALID" 7 "DI_GEAR_SNA" 2 "DI_GEAR_R" 3 "DI_GEAR_N" 4 "DI_GEAR_D" ; VAL_ 280 DI_brakePedalState 2 "INVALID" 0 "OFF" 1 "ON" ; VAL_ 280 DI_systemState 5 "DI_SYS_ENABLE" 1 "DI_SYS_IDLE" 2 "DI_SYS_STANDBY" 0 "DI_SYS_UNAVAILABLE" 3 "DI_SYS_FAULT" 4 "DI_SYS_ABORT" ; +VAL_ 605 DAS_trafficLightColor 0 "NONE" 1 "RED" 2 "GREEN" 3 "YELLOW" ; VAL_ 697 DAS_accelMax 511 "SNA" ; VAL_ 697 DAS_accelMin 511 "SNA" ; VAL_ 697 DAS_jerkMax 255 "SNA" ; diff --git a/opendbc/safety/board/drivers/can_common.h b/opendbc/safety/board/drivers/can_common.h index 52a980cf1d4..306f0c07fa5 100644 --- a/opendbc/safety/board/drivers/can_common.h +++ b/opendbc/safety/board/drivers/can_common.h @@ -1,3 +1,4 @@ +#pragma once #include "can_common_declarations.h" uint8_t calculate_checksum(const uint8_t *dat, uint32_t len) { diff --git a/opendbc/safety/board/utils.h b/opendbc/safety/board/utils.h index f355ce8c2f2..20b24621411 100644 --- a/opendbc/safety/board/utils.h +++ b/opendbc/safety/board/utils.h @@ -42,6 +42,6 @@ // compute the time elapsed (in microseconds) from 2 counter samples // case where ts < ts_last is ok: overflow is properly re-casted into uint32_t -uint32_t get_ts_elapsed(uint32_t ts, uint32_t ts_last) { +static inline uint32_t get_ts_elapsed(uint32_t ts, uint32_t ts_last) { return ts - ts_last; } diff --git a/opendbc/safety/safety.h b/opendbc/safety/safety.h index 437e8da69d7..5b337616f7f 100644 --- a/opendbc/safety/safety.h +++ b/opendbc/safety/safety.h @@ -27,36 +27,6 @@ #include "safety/safety_hyundai_canfd.h" #endif -// from cereal.car.CarParams.SafetyModel -#define SAFETY_SILENT 0U -#define SAFETY_HONDA_NIDEC 1U -#define SAFETY_TOYOTA 2U -#define SAFETY_ELM327 3U -#define SAFETY_GM 4U -#define SAFETY_HONDA_BOSCH_GIRAFFE 5U -#define SAFETY_FORD 6U -#define SAFETY_HYUNDAI 8U -#define SAFETY_CHRYSLER 9U -#define SAFETY_TESLA 10U -#define SAFETY_SUBARU 11U -#define SAFETY_MAZDA 13U -#define SAFETY_NISSAN 14U -#define SAFETY_VOLKSWAGEN_MQB 15U -#define SAFETY_ALLOUTPUT 17U -#define SAFETY_GM_ASCM 18U -#define SAFETY_NOOUTPUT 19U -#define SAFETY_HONDA_BOSCH 20U -#define SAFETY_VOLKSWAGEN_PQ 21U -#define SAFETY_SUBARU_PREGLOBAL 22U -#define SAFETY_HYUNDAI_LEGACY 23U -#define SAFETY_HYUNDAI_COMMUNITY 24U -#define SAFETY_STELLANTIS 25U -#define SAFETY_FAW 26U -#define SAFETY_BODY 27U -#define SAFETY_HYUNDAI_CANFD 28U -#define SAFETY_RIVIAN 33U -#define SAFETY_VOLKSWAGEN_MEB 34U - uint32_t GET_BYTES(const CANPacket_t *msg, int start, int len) { uint32_t ret = 0U; for (int i = 0; i < len; i++) { @@ -114,6 +84,9 @@ uint16_t current_safety_param = 0; static const safety_hooks *current_hooks = &nooutput_hooks; safety_config current_safety_config; +static void generic_rx_checks(void); +static void stock_ecu_check(bool stock_ecu_detected); + static bool is_msg_valid(RxCheck addr_list[], int index) { bool valid = true; if (index != -1) { @@ -216,15 +189,18 @@ bool safety_rx_hook(const CANPacket_t *to_push) { current_hooks->rx(to_push); } + // Handles gas, brake, and regen paddle + generic_rx_checks(); + // the relay malfunction hook runs on all incoming rx messages. - // check all tx msgs for liveness on sending bus if specified. + // check all applicable tx msgs for liveness on sending bus. // used to detect a relay malfunction or control messages from disabled ECUs like the radar const int bus = GET_BUS(to_push); const int addr = GET_ADDR(to_push); for (int i = 0; i < current_safety_config.tx_msgs_len; i++) { const CanMsg *m = ¤t_safety_config.tx_msgs[i]; if (m->check_relay) { - generic_rx_checks((m->addr == addr) && (m->bus == bus)); + stock_ecu_check((m->addr == addr) && (m->bus == bus)); } } @@ -280,11 +256,24 @@ static int get_fwd_bus(int bus_num) { int safety_fwd_hook(int bus_num, int addr) { bool blocked = relay_malfunction || current_safety_config.disable_forwarding; + // Block messages that are being checked for relay malfunctions. Safety modes can opt out of this + // in the case of selective AEB forwarding + const int destination_bus = get_fwd_bus(bus_num); + if (!blocked) { + for (int i = 0; i < current_safety_config.tx_msgs_len; i++) { + const CanMsg *m = ¤t_safety_config.tx_msgs[i]; + if (m->check_relay && !m->disable_static_blocking && (m->addr == addr) && (m->bus == destination_bus)) { + blocked = true; + break; + } + } + } + if (!blocked && (current_hooks->fwd != NULL)) { blocked = current_hooks->fwd(bus_num, addr); } - return blocked ? -1 : get_fwd_bus(bus_num); + return blocked ? -1 : destination_bus; } bool get_longitudinal_allowed(void) { @@ -355,10 +344,7 @@ static void relay_malfunction_set(void) { fault_occurred(FAULT_RELAY_MALFUNCTION); } -static void generic_rx_checks(bool stock_ecu_detected) { - // allow 1s of transition timeout after relay changes state before assessing malfunctioning - const uint32_t RELAY_TRNS_TIMEOUT = 1U; - +static void generic_rx_checks(void) { // exit controls on rising edge of gas press if (gas_pressed && !gas_pressed_prev && !(alternative_experience & ALT_EXP_DISABLE_DISENGAGE_ON_GAS)) { controls_allowed = false; @@ -376,6 +362,11 @@ static void generic_rx_checks(bool stock_ecu_detected) { controls_allowed = false; } regen_braking_prev = regen_braking; +} + +static void stock_ecu_check(bool stock_ecu_detected) { + // allow 1s of transition timeout after relay changes state before assessing malfunctioning + const uint32_t RELAY_TRNS_TIMEOUT = 1U; // check if stock ECU is on bus broken by car harness if ((safety_mode_cnt > RELAY_TRNS_TIMEOUT) && stock_ecu_detected) { diff --git a/opendbc/safety/safety/safety_body.h b/opendbc/safety/safety/safety_body.h index 9960d57bea9..6536178aaf0 100644 --- a/opendbc/safety/safety/safety_body.h +++ b/opendbc/safety/safety/safety_body.h @@ -34,9 +34,9 @@ static safety_config body_init(uint16_t param) { {.msg = {{0x201, 0, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 100U}, { 0 }, { 0 }}}, }; - static const CanMsg BODY_TX_MSGS[] = {{0x250, 0, 8, false}, {0x250, 0, 6, false}, {0x251, 0, 5, false}, // body - {0x350, 0, 8, false}, {0x350, 0, 6, false}, {0x351, 0, 5, false}, // knee - {0x1, 0, 8, false}}; // CAN flasher + static const CanMsg BODY_TX_MSGS[] = {{0x250, 0, 8, .check_relay = false}, {0x250, 0, 6, .check_relay = false}, {0x251, 0, 5, .check_relay = false}, // body + {0x350, 0, 8, .check_relay = false}, {0x350, 0, 6, .check_relay = false}, {0x351, 0, 5, .check_relay = false}, // knee + {0x1, 0, 8, .check_relay = false}}; // CAN flasher UNUSED(param); safety_config ret = BUILD_SAFETY_CFG(body_rx_checks, BODY_TX_MSGS); diff --git a/opendbc/safety/safety/safety_chrysler.h b/opendbc/safety/safety/safety_chrysler.h index 67bda5624ba..628bf6ed0c9 100644 --- a/opendbc/safety/safety/safety_chrysler.h +++ b/opendbc/safety/safety/safety_chrysler.h @@ -161,18 +161,6 @@ static bool chrysler_tx_hook(const CANPacket_t *to_send) { return tx; } -static bool chrysler_fwd_hook(int bus_num, int addr) { - bool block_msg = false; - - // forward all messages from camera except LKAS messages - const bool is_lkas = ((addr == chrysler_addrs->LKAS_COMMAND) || (addr == chrysler_addrs->DAS_6)); - if ((bus_num == 2) && is_lkas){ - block_msg = true; - } - - return block_msg; -} - static safety_config chrysler_init(uint16_t param) { const uint32_t CHRYSLER_PARAM_RAM_DT = 1U; // set for Ram DT platform @@ -219,15 +207,15 @@ static safety_config chrysler_init(uint16_t param) { }; static const CanMsg CHRYSLER_TX_MSGS[] = { - {CHRYSLER_ADDRS.CRUISE_BUTTONS, 0, 3, false}, - {CHRYSLER_ADDRS.LKAS_COMMAND, 0, 6, true}, - {CHRYSLER_ADDRS.DAS_6, 0, 8, false}, + {CHRYSLER_ADDRS.CRUISE_BUTTONS, 0, 3, .check_relay = false}, + {CHRYSLER_ADDRS.LKAS_COMMAND, 0, 6, .check_relay = true}, + {CHRYSLER_ADDRS.DAS_6, 0, 8, .check_relay = true}, }; static const CanMsg CHRYSLER_RAM_DT_TX_MSGS[] = { - {CHRYSLER_RAM_DT_ADDRS.CRUISE_BUTTONS, 2, 3, false}, - {CHRYSLER_RAM_DT_ADDRS.LKAS_COMMAND, 0, 8, true}, - {CHRYSLER_RAM_DT_ADDRS.DAS_6, 0, 8, false}, + {CHRYSLER_RAM_DT_ADDRS.CRUISE_BUTTONS, 2, 3, .check_relay = false}, + {CHRYSLER_RAM_DT_ADDRS.LKAS_COMMAND, 0, 8, .check_relay = true}, + {CHRYSLER_RAM_DT_ADDRS.DAS_6, 0, 8, .check_relay = true}, }; #ifdef ALLOW_DEBUG @@ -252,9 +240,9 @@ static safety_config chrysler_init(uint16_t param) { }; static const CanMsg CHRYSLER_RAM_HD_TX_MSGS[] = { - {CHRYSLER_RAM_HD_ADDRS.CRUISE_BUTTONS, 2, 3, false}, - {CHRYSLER_RAM_HD_ADDRS.LKAS_COMMAND, 0, 8, true}, - {CHRYSLER_RAM_HD_ADDRS.DAS_6, 0, 8, false}, + {CHRYSLER_RAM_HD_ADDRS.CRUISE_BUTTONS, 2, 3, .check_relay = false}, + {CHRYSLER_RAM_HD_ADDRS.LKAS_COMMAND, 0, 8, .check_relay = true}, + {CHRYSLER_RAM_HD_ADDRS.DAS_6, 0, 8, .check_relay = true}, }; const uint32_t CHRYSLER_PARAM_RAM_HD = 2U; // set for Ram HD platform @@ -287,7 +275,6 @@ const safety_hooks chrysler_hooks = { .init = chrysler_init, .rx = chrysler_rx_hook, .tx = chrysler_tx_hook, - .fwd = chrysler_fwd_hook, .get_counter = chrysler_get_counter, .get_checksum = chrysler_get_checksum, .compute_checksum = chrysler_compute_checksum, diff --git a/opendbc/safety/safety/safety_ford.h b/opendbc/safety/safety/safety_ford.h index f7943562740..c45bc9a618f 100644 --- a/opendbc/safety/safety/safety_ford.h +++ b/opendbc/safety/safety/safety_ford.h @@ -87,9 +87,6 @@ static bool ford_get_quality_flag_valid(const CANPacket_t *to_push) { return valid; } -static bool ford_canfd = false; -static bool ford_longitudinal = false; - #define FORD_INACTIVE_CURVATURE 1000U #define FORD_INACTIVE_CURVATURE_RATE 4096U #define FORD_INACTIVE_PATH_OFFSET 512U @@ -99,14 +96,6 @@ static bool ford_longitudinal = false; #define FORD_MAX_SPEED_DELTA 2.0 // m/s -static bool ford_lkas_msg_check(int addr) { - return (addr == FORD_ACCDATA_3) - || (addr == FORD_Lane_Assist_Data1) - || ((addr == FORD_LateralMotionControl) && !ford_canfd) - || ((addr == FORD_LateralMotionControl2) && ford_canfd) - || (addr == FORD_IPMA_Data); -} - // Curvature rate limits #define FORD_LIMITS(limit_lateral_acceleration) { \ .max_angle = 1000, /* 0.02 curvature */ \ @@ -311,29 +300,6 @@ static bool ford_tx_hook(const CANPacket_t *to_send) { return tx; } -static bool ford_fwd_hook(int bus_num, int addr) { - bool block_msg = false; - - switch (bus_num) { - case FORD_CAM_BUS: { - if (ford_lkas_msg_check(addr)) { - // Block stock LKAS and UI messages - block_msg = true; - } else if (ford_longitudinal && (addr == FORD_ACCDATA)) { - // Block stock ACC message - block_msg = true; - } else { - } - break; - } - default: { - break; - } - } - - return block_msg; -} - static safety_config ford_init(uint16_t param) { // warning: quality flags are not yet checked in openpilot's CAN parser, // this may be the cause of blocked messages @@ -350,39 +316,39 @@ static safety_config ford_init(uint16_t param) { {.msg = {{FORD_DesiredTorqBrk, 0, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 50U}, { 0 }, { 0 }}}, }; - #define FORD_COMMON_TX_MSGS \ - {FORD_Steering_Data_FD1, 0, 8, false}, \ - {FORD_Steering_Data_FD1, 2, 8, false}, \ - {FORD_ACCDATA_3, 0, 8, true}, \ - {FORD_Lane_Assist_Data1, 0, 8, true}, \ - {FORD_IPMA_Data, 0, 8, true}, \ + #define FORD_COMMON_TX_MSGS \ + {FORD_Steering_Data_FD1, 0, 8, .check_relay = false}, \ + {FORD_Steering_Data_FD1, 2, 8, .check_relay = false}, \ + {FORD_ACCDATA_3, 0, 8, .check_relay = true}, \ + {FORD_Lane_Assist_Data1, 0, 8, .check_relay = true}, \ + {FORD_IPMA_Data, 0, 8, .check_relay = true}, \ static const CanMsg FORD_CANFD_LONG_TX_MSGS[] = { FORD_COMMON_TX_MSGS - {FORD_ACCDATA, 0, 8, true}, - {FORD_LateralMotionControl2, 0, 8, true}, + {FORD_ACCDATA, 0, 8, .check_relay = true}, + {FORD_LateralMotionControl2, 0, 8, .check_relay = true}, }; static const CanMsg FORD_CANFD_STOCK_TX_MSGS[] = { FORD_COMMON_TX_MSGS - {FORD_LateralMotionControl2, 0, 8, true}, + {FORD_LateralMotionControl2, 0, 8, .check_relay = true}, }; static const CanMsg FORD_STOCK_TX_MSGS[] = { FORD_COMMON_TX_MSGS - {FORD_LateralMotionControl, 0, 8, true}, + {FORD_LateralMotionControl, 0, 8, .check_relay = true}, }; static const CanMsg FORD_LONG_TX_MSGS[] = { FORD_COMMON_TX_MSGS - {FORD_ACCDATA, 0, 8, true}, - {FORD_LateralMotionControl, 0, 8, true}, + {FORD_ACCDATA, 0, 8, .check_relay = true}, + {FORD_LateralMotionControl, 0, 8, .check_relay = true}, }; const uint16_t FORD_PARAM_CANFD = 2; - ford_canfd = GET_FLAG(param, FORD_PARAM_CANFD); + const bool ford_canfd = GET_FLAG(param, FORD_PARAM_CANFD); - ford_longitudinal = false; + bool ford_longitudinal = false; #ifdef ALLOW_DEBUG const uint16_t FORD_PARAM_LONGITUDINAL = 1; @@ -407,7 +373,6 @@ const safety_hooks ford_hooks = { .init = ford_init, .rx = ford_rx_hook, .tx = ford_tx_hook, - .fwd = ford_fwd_hook, .get_counter = ford_get_counter, .get_checksum = ford_get_checksum, .compute_checksum = ford_compute_checksum, diff --git a/opendbc/safety/safety/safety_gm.h b/opendbc/safety/safety/safety_gm.h index 17e089959e5..4c4f19d1dc3 100644 --- a/opendbc/safety/safety/safety_gm.h +++ b/opendbc/safety/safety/safety_gm.h @@ -27,7 +27,6 @@ typedef enum { GM_CAM } GmHardware; static GmHardware gm_hw = GM_ASCM; -static bool gm_cam_long = false; static bool gm_pcm_cruise = false; static void gm_rx_hook(const CANPacket_t *to_push) { @@ -160,31 +159,6 @@ static bool gm_tx_hook(const CANPacket_t *to_send) { return tx; } -static bool gm_fwd_hook(int bus_num, int addr) { - bool block_msg = false; - - if (gm_hw == GM_CAM) { - if (bus_num == 0) { - // block PSCMStatus; forwarded through openpilot to hide an alert from the camera - bool is_pscm_msg = (addr == 0x184); - if (is_pscm_msg) { - block_msg = true; - } - } - - if (bus_num == 2) { - // block lkas message and acc messages if gm_cam_long, forward all others - bool is_lkas_msg = (addr == 0x180); - bool is_acc_msg = (addr == 0x315) || (addr == 0x2CB) || (addr == 0x370); - block_msg = is_lkas_msg || (is_acc_msg && gm_cam_long); - } - } else { - block_msg = true; - } - - return block_msg; -} - static safety_config gm_init(uint16_t param) { const uint16_t GM_PARAM_HW_CAM = 1; const uint16_t GM_PARAM_EV = 4; @@ -199,9 +173,9 @@ static safety_config gm_init(uint16_t param) { .max_brake = 400, }; - static const CanMsg GM_ASCM_TX_MSGS[] = {{0x180, 0, 4, true}, {0x409, 0, 7, false}, {0x40A, 0, 7, false}, {0x2CB, 0, 8, true}, {0x370, 0, 6, false}, // pt bus - {0xA1, 1, 7, false}, {0x306, 1, 8, false}, {0x308, 1, 7, false}, {0x310, 1, 2, false}, // obs bus - {0x315, 2, 5, false}}; // ch bus + static const CanMsg GM_ASCM_TX_MSGS[] = {{0x180, 0, 4, .check_relay = true}, {0x409, 0, 7, .check_relay = false}, {0x40A, 0, 7, .check_relay = false}, {0x2CB, 0, 8, .check_relay = true}, {0x370, 0, 6, .check_relay = false}, // pt bus + {0xA1, 1, 7, .check_relay = false}, {0x306, 1, 8, .check_relay = false}, {0x308, 1, 7, .check_relay = false}, {0x310, 1, 2, .check_relay = false}, // obs bus + {0x315, 2, 5, .check_relay = false}}; // ch bus static const LongitudinalLimits GM_CAM_LONG_LIMITS = { @@ -211,8 +185,9 @@ static safety_config gm_init(uint16_t param) { .max_brake = 400, }; - static const CanMsg GM_CAM_LONG_TX_MSGS[] = {{0x180, 0, 4, true}, {0x315, 0, 5, false}, {0x2CB, 0, 8, true}, {0x370, 0, 6, false}, // pt bus - {0x184, 2, 8, false}}; // camera bus + // block PSCMStatus (0x184); forwarded through openpilot to hide an alert from the camera + static const CanMsg GM_CAM_LONG_TX_MSGS[] = {{0x180, 0, 4, .check_relay = true}, {0x315, 0, 5, .check_relay = true}, {0x2CB, 0, 8, .check_relay = true}, {0x370, 0, 6, .check_relay = true}, // pt bus + {0x184, 2, 8, .check_relay = true}}; // camera bus static RxCheck gm_rx_checks[] = { @@ -224,8 +199,8 @@ static safety_config gm_init(uint16_t param) { {.msg = {{0xBD, 0, 7, .ignore_checksum = true, .ignore_counter = true, .frequency = 40U}, { 0 }, { 0 }}}, }; - static const CanMsg GM_CAM_TX_MSGS[] = {{0x180, 0, 4, true}, // pt bus - {0x1E1, 2, 7, false}, {0x184, 2, 8, false}}; // camera bus + static const CanMsg GM_CAM_TX_MSGS[] = {{0x180, 0, 4, .check_relay = true}, // pt bus + {0x1E1, 2, 7, .check_relay = false}, {0x184, 2, 8, .check_relay = true}}; // camera bus gm_hw = GET_FLAG(param, GM_PARAM_HW_CAM) ? GM_CAM : GM_ASCM; @@ -236,6 +211,8 @@ static safety_config gm_init(uint16_t param) { } else { } + bool gm_cam_long = false; + #ifdef ALLOW_DEBUG const uint16_t GM_PARAM_HW_CAM_LONG = 2; gm_cam_long = GET_FLAG(param, GM_PARAM_HW_CAM_LONG); @@ -256,6 +233,11 @@ static safety_config gm_init(uint16_t param) { if (gm_ev) { SET_RX_CHECKS(gm_ev_rx_checks, ret); } + + // ASCM does not forward any messages + if (gm_hw == GM_ASCM) { + ret.disable_forwarding = true; + } return ret; } @@ -263,5 +245,4 @@ const safety_hooks gm_hooks = { .init = gm_init, .rx = gm_rx_hook, .tx = gm_tx_hook, - .fwd = gm_fwd_hook, }; diff --git a/opendbc/safety/safety/safety_honda.h b/opendbc/safety/safety/safety_honda.h index 6361ba31f9a..ffeaf89a4dc 100644 --- a/opendbc/safety/safety/safety_honda.h +++ b/opendbc/safety/safety/safety_honda.h @@ -278,7 +278,11 @@ static bool honda_tx_hook(const CANPacket_t *to_send) { } static safety_config honda_nidec_init(uint16_t param) { - static CanMsg HONDA_N_TX_MSGS[] = {{0xE4, 0, 5, true}, {0x194, 0, 4, true}, {0x1FA, 0, 8, false}, {0x30C, 0, 8, false}, {0x33D, 0, 5, false}}; + // 0x1FA is dynamically forwarded based on stock AEB + // 0xE4 is steering on all cars except CRV and RDX, 0x194 for CRV and RDX, + // 0x1FA is brake control, 0x30C is acc hud, 0x33D is lkas hud + static CanMsg HONDA_N_TX_MSGS[] = {{0xE4, 0, 5, .check_relay = true}, {0x194, 0, 4, .check_relay = true}, {0x1FA, 0, 8, .check_relay = false}, + {0x30C, 0, 8, .check_relay = true}, {0x33D, 0, 5, .check_relay = true}}; const uint16_t HONDA_PARAM_NIDEC_ALT = 4; @@ -318,10 +322,21 @@ static safety_config honda_nidec_init(uint16_t param) { } static safety_config honda_bosch_init(uint16_t param) { - static CanMsg HONDA_BOSCH_TX_MSGS[] = {{0xE4, 0, 5, true}, {0xE5, 0, 8, false}, {0x296, 1, 4, false}, {0x33D, 0, 5, false}, {0x33DA, 0, 5, false}, {0x33DB, 0, 8, false}}; // Bosch - static CanMsg HONDA_BOSCH_LONG_TX_MSGS[] = {{0xE4, 1, 5, true}, {0x1DF, 1, 8, true}, {0x1EF, 1, 8, false}, {0x1FA, 1, 8, false}, {0x30C, 1, 8, false}, {0x33D, 1, 5, false}, {0x33DA, 1, 5, false}, {0x33DB, 1, 8, false}, {0x39F, 1, 8, false}, {0x18DAB0F1, 1, 8, false}}; // Bosch w/ gas and brakes - static CanMsg HONDA_RADARLESS_TX_MSGS[] = {{0xE4, 0, 5, true}, {0x296, 2, 4, false}, {0x33D, 0, 8, false}}; // Bosch radarless - static CanMsg HONDA_RADARLESS_LONG_TX_MSGS[] = {{0xE4, 0, 5, true}, {0x33D, 0, 8, false}, {0x1C8, 0, 8, false}, {0x30C, 0, 8, false}}; // Bosch radarless w/ gas and brakes + // HONDA_BOSCH_TX_MSGS is used by Bosch and Bosch CAN FD + static CanMsg HONDA_BOSCH_TX_MSGS[] = {{0xE4, 0, 5, .check_relay = true}, {0xE5, 0, 8, .check_relay = true}, + // Send buttons on powertrain bus: 0 for Bosch CAN FD, 1 for CAN + {0x296, 0, 4, .check_relay = false}, {0x296, 1, 4, .check_relay = false}, + {0x33D, 0, 5, .check_relay = true}, {0x33DA, 0, 5, .check_relay = true}, {0x33DB, 0, 8, .check_relay = true}}; // Bosch + + static CanMsg HONDA_BOSCH_LONG_TX_MSGS[] = {{0xE4, 1, 5, .check_relay = true}, {0x1DF, 1, 8, .check_relay = true}, {0x1EF, 1, 8, .check_relay = false}, + {0x1FA, 1, 8, .check_relay = false}, {0x30C, 1, 8, .check_relay = false}, {0x33D, 1, 5, .check_relay = true}, + {0x33DA, 1, 5, .check_relay = true}, {0x33DB, 1, 8, .check_relay = true}, {0x39F, 1, 8, .check_relay = false}, + {0x18DAB0F1, 1, 8, .check_relay = false}}; // Bosch w/ gas and brakes + + static CanMsg HONDA_RADARLESS_TX_MSGS[] = {{0xE4, 0, 5, .check_relay = true}, {0x296, 2, 4, .check_relay = false}, {0x33D, 0, 8, .check_relay = true}}; // Bosch radarless + + static CanMsg HONDA_RADARLESS_LONG_TX_MSGS[] = {{0xE4, 0, 5, .check_relay = true}, {0x33D, 0, 8, .check_relay = true}, {0x1C8, 0, 8, .check_relay = true}, + {0x30C, 0, 8, .check_relay = true}}; // Bosch radarless w/ gas and brakes const uint16_t HONDA_PARAM_ALT_BRAKE = 1; const uint16_t HONDA_PARAM_RADARLESS = 8; @@ -386,29 +401,12 @@ static safety_config honda_bosch_init(uint16_t param) { } static bool honda_nidec_fwd_hook(int bus_num, int addr) { - // fwd from car to camera. also fwd certain msgs from camera to car - // 0xE4 is steering on all cars except CRV and RDX, 0x194 for CRV and RDX, - // 0x1FA is brake control, 0x30C is acc hud, 0x33D is lkas hud bool block_msg = false; if (bus_num == 2) { - // block stock lkas messages and stock acc messages (if OP is doing ACC) - bool is_lkas_msg = (addr == 0xE4) || (addr == 0x194) || (addr == 0x33D); - bool is_acc_hud_msg = addr == 0x30C; + // forwarded if stock AEB is active bool is_brake_msg = addr == 0x1FA; - block_msg = is_lkas_msg || is_acc_hud_msg || (is_brake_msg && !honda_fwd_brake); - } - - return block_msg; -} - -static bool honda_bosch_fwd_hook(int bus_num, int addr) { - bool block_msg = false; - - if (bus_num == 2) { - bool is_lkas_msg = (addr == 0xE4) || (addr == 0xE5) || (addr == 0x33D) || (addr == 0x33DA) || (addr == 0x33DB); - bool is_acc_msg = ((addr == 0x1C8) || (addr == 0x30C)) && honda_bosch_radarless && honda_bosch_long; - block_msg = is_lkas_msg || is_acc_msg; + block_msg = is_brake_msg && !honda_fwd_brake; } return block_msg; @@ -428,7 +426,6 @@ const safety_hooks honda_bosch_hooks = { .init = honda_bosch_init, .rx = honda_rx_hook, .tx = honda_tx_hook, - .fwd = honda_bosch_fwd_hook, .get_counter = honda_get_counter, .get_checksum = honda_get_checksum, .compute_checksum = honda_compute_checksum, diff --git a/opendbc/safety/safety/safety_hyundai.h b/opendbc/safety/safety/safety_hyundai.h index 3b6564882b5..a7a8423b6f0 100644 --- a/opendbc/safety/safety/safety_hyundai.h +++ b/opendbc/safety/safety/safety_hyundai.h @@ -26,17 +26,17 @@ const LongitudinalLimits HYUNDAI_LONG_LIMITS = { }; #define HYUNDAI_COMMON_TX_MSGS(scc_bus) \ - {0x340, 0, 8, true}, /* LKAS11 Bus 0 */ \ - {0x4F1, scc_bus, 4, false}, /* CLU11 Bus 0 (radar-SCC) or 2 (camera-SCC) */ \ - {0x485, 0, 4, false}, /* LFAHDA_MFC Bus 0 */ \ + {0x340, 0, 8, .check_relay = true}, /* LKAS11 Bus 0 */ \ + {0x4F1, scc_bus, 4, .check_relay = false}, /* CLU11 Bus 0 (radar-SCC) or 2 (camera-SCC) */ \ + {0x485, 0, 4, .check_relay = true}, /* LFAHDA_MFC Bus 0 */ \ #define HYUNDAI_LONG_COMMON_TX_MSGS(scc_bus) \ - HYUNDAI_COMMON_TX_MSGS(scc_bus) \ - {0x420, 0, 8, false}, /* SCC11 Bus 0 */ \ - {0x421, 0, 8, (scc_bus) == 0}, /* SCC12 Bus 0 */ \ - {0x50A, 0, 8, false}, /* SCC13 Bus 0 */ \ - {0x389, 0, 8, false}, /* SCC14 Bus 0 */ \ - {0x4A2, 0, 2, false}, /* FRT_RADAR11 Bus 0 */ \ + HYUNDAI_COMMON_TX_MSGS(scc_bus) \ + {0x420, 0, 8, .check_relay = true}, /* SCC11 Bus 0 */ \ + {0x421, 0, 8, .check_relay = true}, /* SCC12 Bus 0 */ \ + {0x50A, 0, 8, .check_relay = true}, /* SCC13 Bus 0 */ \ + {0x389, 0, 8, .check_relay = true}, /* SCC14 Bus 0 */ \ + {0x4A2, 0, 2, .check_relay = false}, /* FRT_RADAR11 Bus 0 */ \ #define HYUNDAI_COMMON_RX_CHECKS(legacy) \ {.msg = {{0x260, 0, 8, .max_counter = 3U, .frequency = 100U}, \ @@ -255,29 +255,12 @@ static bool hyundai_tx_hook(const CANPacket_t *to_send) { return tx; } -static bool hyundai_fwd_hook(int bus_num, int addr) { - bool block_msg = false; - - if (bus_num == 2) { - // Stock LKAS11 messages - bool is_lkas_11 = (addr == 0x340); - // LFA and HDA cluster icons - bool is_lfahda_mfc = (addr == 0x485); - // Stock SCC messages, blocking when doing openpilot longitudinal on camera SCC cars - bool is_scc_msg = (addr == 0x420) || (addr == 0x421) || (addr == 0x50A) || (addr == 0x389); - - block_msg = is_lkas_11 || is_lfahda_mfc || (is_scc_msg && hyundai_longitudinal && hyundai_camera_scc); - } - - return block_msg; -} - static safety_config hyundai_init(uint16_t param) { static const CanMsg HYUNDAI_LONG_TX_MSGS[] = { HYUNDAI_LONG_COMMON_TX_MSGS(0) - {0x38D, 0, 8, false}, // FCA11 Bus 0 - {0x483, 0, 8, false}, // FCA12 Bus 0 - {0x7D0, 0, 8, false}, // radar UDS TX addr Bus 0 (for radar disable) + {0x38D, 0, 8, .check_relay = false}, // FCA11 Bus 0 + {0x483, 0, 8, .check_relay = false}, // FCA12 Bus 0 + {0x7D0, 0, 8, .check_relay = false}, // radar UDS TX addr Bus 0 (for radar disable) }; static const CanMsg HYUNDAI_CAMERA_SCC_TX_MSGS[] = { @@ -361,7 +344,6 @@ const safety_hooks hyundai_hooks = { .init = hyundai_init, .rx = hyundai_rx_hook, .tx = hyundai_tx_hook, - .fwd = hyundai_fwd_hook, .get_counter = hyundai_get_counter, .get_checksum = hyundai_get_checksum, .compute_checksum = hyundai_compute_checksum, @@ -371,7 +353,6 @@ const safety_hooks hyundai_legacy_hooks = { .init = hyundai_legacy_init, .rx = hyundai_rx_hook, .tx = hyundai_tx_hook, - .fwd = hyundai_fwd_hook, .get_counter = hyundai_get_counter, .get_checksum = hyundai_get_checksum, .compute_checksum = hyundai_compute_checksum, diff --git a/opendbc/safety/safety/safety_hyundai_canfd.h b/opendbc/safety/safety/safety_hyundai_canfd.h index 63e52a0c75c..99812026ffe 100644 --- a/opendbc/safety/safety/safety_hyundai_canfd.h +++ b/opendbc/safety/safety/safety_hyundai_canfd.h @@ -4,24 +4,24 @@ #include "safety_hyundai_common.h" #define HYUNDAI_CANFD_CRUISE_BUTTON_TX_MSGS(bus) \ - {0x1CF, bus, 8, false}, /* CRUISE_BUTTON */ \ + {0x1CF, bus, 8, .check_relay = false}, /* CRUISE_BUTTON */ \ #define HYUNDAI_CANFD_LKA_STEERING_COMMON_TX_MSGS(a_can, e_can) \ - HYUNDAI_CANFD_CRUISE_BUTTON_TX_MSGS(e_can) \ - {0x50, a_can, 16, (a_can) == 0}, /* LKAS */ \ - {0x2A4, a_can, 24, false}, /* CAM_0x2A4 */ \ + HYUNDAI_CANFD_CRUISE_BUTTON_TX_MSGS(e_can) \ + {0x50, a_can, 16, .check_relay = (a_can) == 0}, /* LKAS */ \ + {0x2A4, a_can, 24, .check_relay = (a_can) == 0}, /* CAM_0x2A4 */ \ #define HYUNDAI_CANFD_LKA_STEERING_ALT_COMMON_TX_MSGS(a_can, e_can) \ HYUNDAI_CANFD_CRUISE_BUTTON_TX_MSGS(e_can) \ - {0x110, a_can, 32, (a_can) == 0}, /* LKAS_ALT */ \ - {0x362, a_can, 32, false}, /* CAM_0x362 */ \ + {0x110, a_can, 32, .check_relay = (a_can) == 0}, /* LKAS_ALT */ \ + {0x362, a_can, 32, .check_relay = (a_can) == 0}, /* CAM_0x362 */ \ #define HYUNDAI_CANFD_LFA_STEERING_COMMON_TX_MSGS(e_can) \ - {0x12A, e_can, 16, (e_can) == 0}, /* LFA */ \ - {0x1E0, e_can, 16, false}, /* LFAHDA_CLUSTER */ \ + {0x12A, e_can, 16, .check_relay = (e_can) == 0}, /* LFA */ \ + {0x1E0, e_can, 16, .check_relay = (e_can) == 0}, /* LFAHDA_CLUSTER */ \ -#define HYUNDAI_CANFD_SCC_CONTROL_COMMON_TX_MSGS(e_can, longitudinal) \ - {0x1A0, e_can, 32, (longitudinal)}, /* SCC_CONTROL */ \ +#define HYUNDAI_CANFD_SCC_CONTROL_COMMON_TX_MSGS(e_can, longitudinal) \ + {0x1A0, e_can, 32, .check_relay = (longitudinal)}, /* SCC_CONTROL */ \ // *** Addresses checked in rx hook *** // EV, ICE, HYBRID: ACCELERATOR (0x35), ACCELERATOR_BRAKE_ALT (0x100), ACCELERATOR_ALT (0x105) @@ -49,6 +49,10 @@ static bool hyundai_canfd_alt_buttons = false; static bool hyundai_canfd_lka_steering_alt = false; static bool hyundai_ccnc = false; +static bool get_hyundai_ccnc(void) { + return hyundai_ccnc; +} + static int hyundai_canfd_get_lka_addr(void) { return hyundai_canfd_lka_steering_alt ? 0x110 : 0x50; } @@ -219,34 +223,6 @@ static bool hyundai_canfd_tx_hook(const CANPacket_t *to_send) { return tx; } -static bool hyundai_canfd_fwd_hook(int bus_num, int addr) { - bool block_msg = false; - - if (bus_num == 0) { - block_msg = ((hyundai_ccnc) && (((addr) == 0xEA) || ((addr) == 0x7C4))); - } else if (bus_num == 2) { - // LKAS for cars with LKAS and LFA messages, LFA for cars with no LKAS messages - int lfa_block_addr = hyundai_canfd_lka_steering_alt ? 0x362 : 0x2a4; - bool is_lka_msg = ((addr == hyundai_canfd_get_lka_addr()) || (addr == lfa_block_addr)) && hyundai_canfd_lka_steering; - bool is_lfa_msg = ((addr == 0x12a) && !hyundai_canfd_lka_steering); - - // HUD icons - bool is_lfahda_msg = ((addr == 0x1e0) && !hyundai_canfd_lka_steering); - - // SCC_CONTROL and ADRV_0x160 for camera SCC cars, we send our own longitudinal commands and to show FCA light - bool is_scc_msg = (((addr == 0x1a0) || (!hyundai_ccnc && (addr == 0x160))) && hyundai_longitudinal && !hyundai_canfd_lka_steering); - - // CCNC messages - bool is_ccnc_msg = (addr == 0x161) || (addr == 0x162); - - block_msg = is_lka_msg || is_lfa_msg || is_lfahda_msg || is_scc_msg || is_ccnc_msg; - } else { - block_msg = false; - } - - return block_msg; -} - static safety_config hyundai_canfd_init(uint16_t param) { const int HYUNDAI_PARAM_CANFD_LKA_STEERING_ALT = 128; const int HYUNDAI_PARAM_CANFD_ALT_BUTTONS = 32; @@ -264,13 +240,13 @@ static safety_config hyundai_canfd_init(uint16_t param) { HYUNDAI_CANFD_LKA_STEERING_COMMON_TX_MSGS(0, 1) HYUNDAI_CANFD_LFA_STEERING_COMMON_TX_MSGS(1) HYUNDAI_CANFD_SCC_CONTROL_COMMON_TX_MSGS(1, true) - {0x51, 0, 32, false}, // ADRV_0x51 - {0x730, 1, 8, false}, // tester present for ADAS ECU disable - {0x160, 1, 16, false}, // ADRV_0x160 - {0x1EA, 1, 32, false}, // ADRV_0x1ea - {0x200, 1, 8, false}, // ADRV_0x200 - {0x345, 1, 8, false}, // ADRV_0x345 - {0x1DA, 1, 32, false}, // ADRV_0x1da + {0x51, 0, 32, .check_relay = false}, // ADRV_0x51 + {0x730, 1, 8, .check_relay = false}, // tester present for ADAS ECU disable + {0x160, 1, 16, .check_relay = false}, // ADRV_0x160 + {0x1EA, 1, 32, .check_relay = false}, // ADRV_0x1ea + {0x200, 1, 8, .check_relay = false}, // ADRV_0x200 + {0x345, 1, 8, .check_relay = false}, // ADRV_0x345 + {0x1DA, 1, 32, .check_relay = false}, // ADRV_0x1da }; static const CanMsg HYUNDAI_CANFD_LFA_STEERING_TX_MSGS[] = { @@ -279,21 +255,30 @@ static safety_config hyundai_canfd_init(uint16_t param) { HYUNDAI_CANFD_SCC_CONTROL_COMMON_TX_MSGS(0, false) }; + // ADRV_0x160 is checked for radar liveness static const CanMsg HYUNDAI_CANFD_LFA_STEERING_LONG_TX_MSGS[] = { HYUNDAI_CANFD_CRUISE_BUTTON_TX_MSGS(2) HYUNDAI_CANFD_LFA_STEERING_COMMON_TX_MSGS(0) HYUNDAI_CANFD_SCC_CONTROL_COMMON_TX_MSGS(0, true) - {0x160, 0, 16, false}, // ADRV_0x160 - {0x7D0, 0, 8, false}, // tester present for radar ECU disable + {0x160, 0, 16, .check_relay = true}, // ADRV_0x160 + {0x7D0, 0, 8, .check_relay = false}, // tester present for radar ECU disable }; + // ADRV_0x160 is checked for relay malfunction #define HYUNDAI_CANFD_LFA_STEERING_CAMERA_SCC_TX_MSGS(longitudinal) \ HYUNDAI_CANFD_CRUISE_BUTTON_TX_MSGS(2) \ HYUNDAI_CANFD_LFA_STEERING_COMMON_TX_MSGS(0) \ HYUNDAI_CANFD_SCC_CONTROL_COMMON_TX_MSGS(0, (longitudinal)) \ - {0x160, 0, 16, false}, /* ADRV_0x160 */ \ - {0x161, 0, 32, false}, /* CCNC_0x161 */ \ - {0x162, 0, 32, false}, /* CCNC_0x162 */ \ + {0x160, 0, 16, .check_relay = (longitudinal)}, /* ADRV_0x160 */ \ + +#define HYUNDAI_CANFD_LFA_STEERING_CAMERA_SCC_CCNC_TX_MSGS(longitudinal) \ + HYUNDAI_CANFD_CRUISE_BUTTON_TX_MSGS(2) \ + HYUNDAI_CANFD_LFA_STEERING_COMMON_TX_MSGS(0) \ + HYUNDAI_CANFD_SCC_CONTROL_COMMON_TX_MSGS(0, (longitudinal)) \ + {0x161, 0, 32, .check_relay = true}, /* CCNC_0x161 */ \ + {0x162, 0, 32, .check_relay = true}, /* CCNC_0x162 */ \ + {0x7C4, 2, 8, .check_relay = true}, /* 0x7C4 */ \ + {0xEA, 2, 24, .check_relay = true}, /* MDPS */ \ hyundai_common_init(param); @@ -325,6 +310,10 @@ static safety_config hyundai_canfd_init(uint16_t param) { HYUNDAI_CANFD_LFA_STEERING_CAMERA_SCC_TX_MSGS(true) }; + static CanMsg hyundai_canfd_lfa_steering_camera_scc_ccnc_tx_msgs[] = { + HYUNDAI_CANFD_LFA_STEERING_CAMERA_SCC_CCNC_TX_MSGS(true) + }; + if (hyundai_canfd_alt_buttons) { SET_RX_CHECKS(hyundai_canfd_alt_buttons_long_rx_checks, ret); } else { @@ -332,7 +321,11 @@ static safety_config hyundai_canfd_init(uint16_t param) { } if (hyundai_camera_scc) { - SET_TX_MSGS(hyundai_canfd_lfa_steering_camera_scc_tx_msgs, ret); + if (get_hyundai_ccnc()) { + SET_TX_MSGS(hyundai_canfd_lfa_steering_camera_scc_ccnc_tx_msgs, ret); // LCOV_EXCL_LINE + } else { + SET_TX_MSGS(hyundai_canfd_lfa_steering_camera_scc_tx_msgs, ret); + } } else { SET_TX_MSGS(HYUNDAI_CANFD_LFA_STEERING_LONG_TX_MSGS, ret); } @@ -393,7 +386,15 @@ static safety_config hyundai_canfd_init(uint16_t param) { HYUNDAI_CANFD_LFA_STEERING_CAMERA_SCC_TX_MSGS(false) }; - SET_TX_MSGS(hyundai_canfd_lfa_steering_camera_scc_tx_msgs, ret); + static CanMsg hyundai_canfd_lfa_steering_camera_scc_ccnc_tx_msgs[] = { + HYUNDAI_CANFD_LFA_STEERING_CAMERA_SCC_CCNC_TX_MSGS(false) + }; + + if (get_hyundai_ccnc()) { + SET_TX_MSGS(hyundai_canfd_lfa_steering_camera_scc_ccnc_tx_msgs, ret); // LCOV_EXCL_LINE + } else { + SET_TX_MSGS(hyundai_canfd_lfa_steering_camera_scc_tx_msgs, ret); + } if (hyundai_canfd_alt_buttons) { SET_RX_CHECKS(hyundai_canfd_alt_buttons_rx_checks, ret); @@ -410,7 +411,6 @@ const safety_hooks hyundai_canfd_hooks = { .init = hyundai_canfd_init, .rx = hyundai_canfd_rx_hook, .tx = hyundai_canfd_tx_hook, - .fwd = hyundai_canfd_fwd_hook, .get_counter = hyundai_canfd_get_counter, .get_checksum = hyundai_canfd_get_checksum, .compute_checksum = hyundai_common_canfd_compute_checksum, diff --git a/opendbc/safety/safety/safety_mazda.h b/opendbc/safety/safety/safety_mazda.h index 2723cbb88fd..87088353597 100644 --- a/opendbc/safety/safety/safety_mazda.h +++ b/opendbc/safety/safety/safety_mazda.h @@ -88,18 +88,8 @@ static bool mazda_tx_hook(const CANPacket_t *to_send) { return tx; } -static bool mazda_fwd_hook(int bus, int addr) { - bool block_msg = false; - - if (bus == MAZDA_CAM) { - block_msg = (addr == MAZDA_LKAS) || (addr == MAZDA_LKAS_HUD); - } - - return block_msg; -} - static safety_config mazda_init(uint16_t param) { - static const CanMsg MAZDA_TX_MSGS[] = {{MAZDA_LKAS, 0, 8, true}, {MAZDA_CRZ_BTNS, 0, 8, false}, {MAZDA_LKAS_HUD, 0, 8, false}}; + static const CanMsg MAZDA_TX_MSGS[] = {{MAZDA_LKAS, 0, 8, .check_relay = true}, {MAZDA_CRZ_BTNS, 0, 8, .check_relay = false}, {MAZDA_LKAS_HUD, 0, 8, .check_relay = true}}; static RxCheck mazda_rx_checks[] = { {.msg = {{MAZDA_CRZ_CTRL, 0, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 50U}, { 0 }, { 0 }}}, @@ -117,5 +107,4 @@ const safety_hooks mazda_hooks = { .init = mazda_init, .rx = mazda_rx_hook, .tx = mazda_tx_hook, - .fwd = mazda_fwd_hook, }; diff --git a/opendbc/safety/safety/safety_nissan.h b/opendbc/safety/safety/safety_nissan.h index 30b971f22c0..dd2ad67720b 100644 --- a/opendbc/safety/safety/safety_nissan.h +++ b/opendbc/safety/safety/safety_nissan.h @@ -100,29 +100,14 @@ static bool nissan_tx_hook(const CANPacket_t *to_send) { } -static bool nissan_fwd_hook(int bus_num, int addr) { - bool block_msg = false; - - if (bus_num == 0) { - block_msg = (addr == 0x280); // CANCEL_MSG - } - - if (bus_num == 2) { - // 0x169 is LKAS, 0x2b1 LKAS_HUD, 0x4cc LKAS_HUD_INFO_MSG - block_msg = ((addr == 0x169) || (addr == 0x2b1) || (addr == 0x4cc)); - } - - return block_msg; -} - static safety_config nissan_init(uint16_t param) { static const CanMsg NISSAN_TX_MSGS[] = { - {0x169, 0, 8, true}, // LKAS - {0x2b1, 0, 8, false}, // PROPILOT_HUD - {0x4cc, 0, 8, false}, // PROPILOT_HUD_INFO_MSG - {0x20b, 2, 6, false}, // CRUISE_THROTTLE (X-Trail) - {0x20b, 1, 6, false}, // CRUISE_THROTTLE (Altima) - {0x280, 2, 8, false} // CANCEL_MSG (Leaf) + {0x169, 0, 8, .check_relay = true}, // LKAS + {0x2b1, 0, 8, .check_relay = true}, // PROPILOT_HUD + {0x4cc, 0, 8, .check_relay = true}, // PROPILOT_HUD_INFO_MSG + {0x20b, 2, 6, .check_relay = false}, // CRUISE_THROTTLE (X-Trail) + {0x20b, 1, 6, .check_relay = false}, // CRUISE_THROTTLE (Altima) + {0x280, 2, 8, .check_relay = true} // CANCEL_MSG (Leaf) }; // Signals duplicated below due to the fact that these messages can come in on either CAN bus, depending on car model. @@ -152,5 +137,4 @@ const safety_hooks nissan_hooks = { .init = nissan_init, .rx = nissan_rx_hook, .tx = nissan_tx_hook, - .fwd = nissan_fwd_hook, }; diff --git a/opendbc/safety/safety/safety_rivian.h b/opendbc/safety/safety/safety_rivian.h index 3a1259048cd..1f6d8b722b1 100644 --- a/opendbc/safety/safety/safety_rivian.h +++ b/opendbc/safety/safety/safety_rivian.h @@ -4,8 +4,6 @@ #define RIVIAN_MAX_SPEED_DELTA 2.0 // m/s -static bool rivian_longitudinal = false; - static uint8_t rivian_get_counter(const CANPacket_t *to_push) { int addr = GET_ADDR(to_push); @@ -171,43 +169,13 @@ static bool rivian_tx_hook(const CANPacket_t *to_send) { return tx; } -static bool rivian_fwd_hook(int bus, int addr) { - bool block_msg = false; - - if (bus == 0) { - // SCCM_WheelTouch: for hiding hold wheel alert - if (addr == 0x321) { - block_msg = true; - } - - // VDM_AdasSts: for canceling stock ACC - // cppcheck-suppress knownConditionTrueFalse - if ((addr == 0x162) && !rivian_longitudinal) { - block_msg = true; - } - } - - if (bus == 2) { - // ACM_lkaHbaCmd: lateral control message - if (addr == 0x120) { - block_msg = true; - } - - // ACM_longitudinalRequest: longitudinal control message - // cppcheck-suppress knownConditionTrueFalse - if (rivian_longitudinal && (addr == 0x160)) { - block_msg = true; - } - } - - return block_msg; -} - static safety_config rivian_init(uint16_t param) { + // SCCM_WheelTouch: for hiding hold wheel alert + // VDM_AdasSts: for canceling stock ACC // 0x120 = ACM_lkaHbaCmd, 0x321 = SCCM_WheelTouch, 0x162 = VDM_AdasSts - static const CanMsg RIVIAN_TX_MSGS[] = {{0x120, 0, 8, true}, {0x321, 2, 7, false}, {0x162, 2, 8, false}}; + static const CanMsg RIVIAN_TX_MSGS[] = {{0x120, 0, 8, .check_relay = true}, {0x321, 2, 7, .check_relay = true}, {0x162, 2, 8, .check_relay = true}}; // 0x160 = ACM_longitudinalRequest - static const CanMsg RIVIAN_LONG_TX_MSGS[] = {{0x120, 0, 8, true}, {0x321, 2, 7, false}, {0x160, 0, 5, true}}; + static const CanMsg RIVIAN_LONG_TX_MSGS[] = {{0x120, 0, 8, .check_relay = true}, {0x321, 2, 7, .check_relay = true}, {0x160, 0, 5, .check_relay = true}}; static RxCheck rivian_rx_checks[] = { {.msg = {{0x208, 0, 8, .frequency = 50U, .max_counter = 14U, .quality_flag = true}, { 0 }, { 0 }}}, // ESP_Status (speed) @@ -217,6 +185,8 @@ static safety_config rivian_init(uint16_t param) { {.msg = {{0x100, 2, 8, .frequency = 100U, .ignore_checksum = true, .ignore_counter = true}, { 0 }, { 0 }}}, // ACM_Status (cruise state) }; + bool rivian_longitudinal = false; + UNUSED(param); #ifdef ALLOW_DEBUG const int FLAG_RIVIAN_LONG_CONTROL = 1; @@ -234,7 +204,6 @@ const safety_hooks rivian_hooks = { .init = rivian_init, .rx = rivian_rx_hook, .tx = rivian_tx_hook, - .fwd = rivian_fwd_hook, .get_counter = rivian_get_counter, .get_checksum = rivian_get_checksum, .compute_checksum = rivian_compute_checksum, diff --git a/opendbc/safety/safety/safety_subaru.h b/opendbc/safety/safety/safety_subaru.h index 3b43d392a39..17da4067fc5 100644 --- a/opendbc/safety/safety/safety_subaru.h +++ b/opendbc/safety/safety/safety_subaru.h @@ -43,22 +43,25 @@ #define SUBARU_ALT_BUS 1 #define SUBARU_CAM_BUS 2 -#define SUBARU_COMMON_TX_MSGS(alt_bus, lkas_msg) \ - {lkas_msg, SUBARU_MAIN_BUS, 8, true}, \ - {MSG_SUBARU_ES_Distance, alt_bus, 8, false}, \ - {MSG_SUBARU_ES_DashStatus, SUBARU_MAIN_BUS, 8, false}, \ - {MSG_SUBARU_ES_LKAS_State, SUBARU_MAIN_BUS, 8, false}, \ - {MSG_SUBARU_ES_Infotainment, SUBARU_MAIN_BUS, 8, false}, \ - -#define SUBARU_COMMON_LONG_TX_MSGS(alt_bus) \ - {MSG_SUBARU_ES_Brake, alt_bus, 8, false}, \ - {MSG_SUBARU_ES_Status, alt_bus, 8, false}, \ - -#define SUBARU_GEN2_LONG_ADDITIONAL_TX_MSGS() \ - {MSG_SUBARU_ES_UDS_Request, SUBARU_CAM_BUS, 8, false}, \ - {MSG_SUBARU_ES_HighBeamAssist, SUBARU_MAIN_BUS, 8, false}, \ - {MSG_SUBARU_ES_STATIC_1, SUBARU_MAIN_BUS, 8, false}, \ - {MSG_SUBARU_ES_STATIC_2, SUBARU_MAIN_BUS, 8, false}, \ +#define SUBARU_BASE_TX_MSGS(alt_bus, lkas_msg) \ + {lkas_msg, SUBARU_MAIN_BUS, 8, .check_relay = true}, \ + {MSG_SUBARU_ES_DashStatus, SUBARU_MAIN_BUS, 8, .check_relay = true}, \ + {MSG_SUBARU_ES_LKAS_State, SUBARU_MAIN_BUS, 8, .check_relay = true}, \ + {MSG_SUBARU_ES_Infotainment, SUBARU_MAIN_BUS, 8, .check_relay = true}, \ + +#define SUBARU_COMMON_TX_MSGS(alt_bus) \ + {MSG_SUBARU_ES_Distance, alt_bus, 8, .check_relay = false}, \ + +#define SUBARU_COMMON_LONG_TX_MSGS(alt_bus) \ + {MSG_SUBARU_ES_Distance, alt_bus, 8, .check_relay = true}, \ + {MSG_SUBARU_ES_Brake, alt_bus, 8, .check_relay = true}, \ + {MSG_SUBARU_ES_Status, alt_bus, 8, .check_relay = true}, \ + +#define SUBARU_GEN2_LONG_ADDITIONAL_TX_MSGS() \ + {MSG_SUBARU_ES_UDS_Request, SUBARU_CAM_BUS, 8, .check_relay = false}, \ + {MSG_SUBARU_ES_HighBeamAssist, SUBARU_MAIN_BUS, 8, .check_relay = false}, \ + {MSG_SUBARU_ES_STATIC_1, SUBARU_MAIN_BUS, 8, .check_relay = false}, \ + {MSG_SUBARU_ES_STATIC_2, SUBARU_MAIN_BUS, 8, .check_relay = false}, \ #define SUBARU_COMMON_RX_CHECKS(alt_bus) \ {.msg = {{MSG_SUBARU_Throttle, SUBARU_MAIN_BUS, 8, .max_counter = 15U, .frequency = 100U}, { 0 }, { 0 }}}, \ @@ -204,42 +207,24 @@ static bool subaru_tx_hook(const CANPacket_t *to_send) { return tx; } -static bool subaru_fwd_hook(int bus_num, int addr) { - bool block_msg = false; - - if (bus_num == SUBARU_CAM_BUS) { - // Global platform - bool block_lkas = ((addr == MSG_SUBARU_ES_LKAS) || - (addr == MSG_SUBARU_ES_DashStatus) || - (addr == MSG_SUBARU_ES_LKAS_State) || - (addr == MSG_SUBARU_ES_Infotainment)); - - bool block_long = ((addr == MSG_SUBARU_ES_Brake) || - (addr == MSG_SUBARU_ES_Distance) || - (addr == MSG_SUBARU_ES_Status)); - - block_msg = block_lkas || (subaru_longitudinal && block_long); - } - - return block_msg; -} - static safety_config subaru_init(uint16_t param) { static const CanMsg SUBARU_TX_MSGS[] = { - SUBARU_COMMON_TX_MSGS(SUBARU_MAIN_BUS, MSG_SUBARU_ES_LKAS) + SUBARU_BASE_TX_MSGS(SUBARU_MAIN_BUS, MSG_SUBARU_ES_LKAS) + SUBARU_COMMON_TX_MSGS(SUBARU_MAIN_BUS) }; static const CanMsg SUBARU_LONG_TX_MSGS[] = { - SUBARU_COMMON_TX_MSGS(SUBARU_MAIN_BUS, MSG_SUBARU_ES_LKAS) + SUBARU_BASE_TX_MSGS(SUBARU_MAIN_BUS, MSG_SUBARU_ES_LKAS) SUBARU_COMMON_LONG_TX_MSGS(SUBARU_MAIN_BUS) }; static const CanMsg SUBARU_GEN2_TX_MSGS[] = { - SUBARU_COMMON_TX_MSGS(SUBARU_ALT_BUS, MSG_SUBARU_ES_LKAS) + SUBARU_BASE_TX_MSGS(SUBARU_ALT_BUS, MSG_SUBARU_ES_LKAS) + SUBARU_COMMON_TX_MSGS(SUBARU_ALT_BUS) }; static const CanMsg SUBARU_GEN2_LONG_TX_MSGS[] = { - SUBARU_COMMON_TX_MSGS(SUBARU_ALT_BUS, MSG_SUBARU_ES_LKAS) + SUBARU_BASE_TX_MSGS(SUBARU_ALT_BUS, MSG_SUBARU_ES_LKAS) SUBARU_COMMON_LONG_TX_MSGS(SUBARU_ALT_BUS) SUBARU_GEN2_LONG_ADDITIONAL_TX_MSGS() }; @@ -276,7 +261,6 @@ const safety_hooks subaru_hooks = { .init = subaru_init, .rx = subaru_rx_hook, .tx = subaru_tx_hook, - .fwd = subaru_fwd_hook, .get_counter = subaru_get_counter, .get_checksum = subaru_get_checksum, .compute_checksum = subaru_compute_checksum, diff --git a/opendbc/safety/safety/safety_subaru_preglobal.h b/opendbc/safety/safety/safety_subaru_preglobal.h index b985c7b7f77..f477d8cfce1 100644 --- a/opendbc/safety/safety/safety_subaru_preglobal.h +++ b/opendbc/safety/safety/safety_subaru_preglobal.h @@ -82,20 +82,10 @@ static bool subaru_preglobal_tx_hook(const CANPacket_t *to_send) { return tx; } -static bool subaru_preglobal_fwd_hook(int bus_num, int addr) { - bool block_msg = false; - - if (bus_num == SUBARU_PG_CAM_BUS) { - block_msg = ((addr == MSG_SUBARU_PG_ES_Distance) || (addr == MSG_SUBARU_PG_ES_LKAS)); - } - - return block_msg; -} - static safety_config subaru_preglobal_init(uint16_t param) { static const CanMsg SUBARU_PG_TX_MSGS[] = { - {MSG_SUBARU_PG_ES_Distance, SUBARU_PG_MAIN_BUS, 8, false}, - {MSG_SUBARU_PG_ES_LKAS, SUBARU_PG_MAIN_BUS, 8, true} + {MSG_SUBARU_PG_ES_Distance, SUBARU_PG_MAIN_BUS, 8, .check_relay = true}, + {MSG_SUBARU_PG_ES_LKAS, SUBARU_PG_MAIN_BUS, 8, .check_relay = true} }; // TODO: do checksum and counter checks after adding the signals to the outback dbc file @@ -117,5 +107,4 @@ const safety_hooks subaru_preglobal_hooks = { .init = subaru_preglobal_init, .rx = subaru_preglobal_rx_hook, .tx = subaru_preglobal_tx_hook, - .fwd = subaru_preglobal_fwd_hook, }; diff --git a/opendbc/safety/safety/safety_tesla.h b/opendbc/safety/safety/safety_tesla.h index 26b7098adb1..9083ad54bcd 100644 --- a/opendbc/safety/safety/safety_tesla.h +++ b/opendbc/safety/safety/safety_tesla.h @@ -146,11 +146,6 @@ static bool tesla_fwd_hook(int bus_num, int addr) { bool block_msg = false; if (bus_num == 2) { - // DAS_steeringControl, APS_eacMonitor - if ((addr == 0x488) || (addr == 0x27d)) { - block_msg = true; - } - // DAS_control if (tesla_longitudinal && (addr == 0x2b9) && !tesla_stock_aeb) { block_msg = true; @@ -163,15 +158,15 @@ static bool tesla_fwd_hook(int bus_num, int addr) { static safety_config tesla_init(uint16_t param) { static const CanMsg TESLA_M3_Y_TX_MSGS[] = { - {0x488, 0, 4, true}, // DAS_steeringControl - {0x2b9, 0, 8, false}, // DAS_control (for cancel) - {0x27D, 0, 3, true}, // APS_eacMonitor + {0x488, 0, 4, .check_relay = true}, // DAS_steeringControl + {0x2b9, 0, 8, .check_relay = false}, // DAS_control (for cancel) + {0x27D, 0, 3, .check_relay = true}, // APS_eacMonitor }; static const CanMsg TESLA_M3_Y_LONG_TX_MSGS[] = { - {0x488, 0, 4, true}, // DAS_steeringControl - {0x2b9, 0, 8, true}, // DAS_control - {0x27D, 0, 3, true}, // APS_eacMonitor + {0x488, 0, 4, .check_relay = true}, // DAS_steeringControl + {0x2b9, 0, 8, .check_relay = true, .disable_static_blocking = true}, // DAS_control + {0x27D, 0, 3, .check_relay = true}, // APS_eacMonitor }; UNUSED(param); @@ -183,13 +178,13 @@ static safety_config tesla_init(uint16_t param) { tesla_stock_aeb = false; static RxCheck tesla_model3_y_rx_checks[] = { - {.msg = {{0x2b9, 2, 8, .ignore_checksum = true, .ignore_counter = true,.frequency = 25U}, { 0 }, { 0 }}}, // DAS_control - {.msg = {{0x257, 0, 8, .ignore_checksum = true, .ignore_counter = true,.frequency = 50U}, { 0 }, { 0 }}}, // DI_speed (speed in kph) - {.msg = {{0x370, 0, 8, .ignore_checksum = true, .ignore_counter = true,.frequency = 100U}, { 0 }, { 0 }}}, // EPAS3S_internalSAS (steering angle) - {.msg = {{0x118, 0, 8, .ignore_checksum = true, .ignore_counter = true,.frequency = 100U}, { 0 }, { 0 }}}, // DI_systemStatus (gas pedal) - {.msg = {{0x39d, 0, 5, .ignore_checksum = true, .ignore_counter = true,.frequency = 25U}, { 0 }, { 0 }}}, // IBST_status (brakes) - {.msg = {{0x286, 0, 8, .ignore_checksum = true, .ignore_counter = true,.frequency = 10U}, { 0 }, { 0 }}}, // DI_state (acc state) - {.msg = {{0x311, 0, 7, .ignore_checksum = true, .ignore_counter = true,.frequency = 10U}, { 0 }, { 0 }}}, // UI_warning (blinkers, buckle switch & doors) + {.msg = {{0x2b9, 2, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 25U}, { 0 }, { 0 }}}, // DAS_control + {.msg = {{0x257, 0, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 50U}, { 0 }, { 0 }}}, // DI_speed (speed in kph) + {.msg = {{0x370, 0, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 100U}, { 0 }, { 0 }}}, // EPAS3S_internalSAS (steering angle) + {.msg = {{0x118, 0, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 100U}, { 0 }, { 0 }}}, // DI_systemStatus (gas pedal) + {.msg = {{0x39d, 0, 5, .ignore_checksum = true, .ignore_counter = true, .frequency = 25U}, { 0 }, { 0 }}}, // IBST_status (brakes) + {.msg = {{0x286, 0, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 10U}, { 0 }, { 0 }}}, // DI_state (acc state) + {.msg = {{0x311, 0, 7, .ignore_checksum = true, .ignore_counter = true, .frequency = 10U}, { 0 }, { 0 }}}, // UI_warning (blinkers, buckle switch & doors) }; safety_config ret; diff --git a/opendbc/safety/safety/safety_toyota.h b/opendbc/safety/safety/safety_toyota.h index d9210ec825b..d97d6178f10 100644 --- a/opendbc/safety/safety/safety_toyota.h +++ b/opendbc/safety/safety/safety_toyota.h @@ -4,25 +4,32 @@ // Stock longitudinal #define TOYOTA_BASE_TX_MSGS \ - {0x191, 0, 8, false}, {0x412, 0, 8, false}, {0x1D2, 0, 8, false}, /* LKAS + LTA + PCM cancel cmd */ \ + {0x191, 0, 8, .check_relay = true}, {0x412, 0, 8, .check_relay = true}, {0x1D2, 0, 8, .check_relay = false}, /* LKAS + LTA + PCM cancel cmd */ \ #define TOYOTA_COMMON_TX_MSGS \ TOYOTA_BASE_TX_MSGS \ - {0x2E4, 0, 5, true}, \ - {0x343, 0, 8, false}, /* ACC cancel cmd */ \ + {0x2E4, 0, 5, .check_relay = true}, \ + {0x343, 0, 8, .check_relay = false}, /* ACC cancel cmd */ \ #define TOYOTA_COMMON_SECOC_TX_MSGS \ TOYOTA_BASE_TX_MSGS \ - {0x2E4, 0, 8, true}, {0x131, 0, 8, false}, \ - {0x343, 0, 8, false}, /* ACC cancel cmd */ \ - -#define TOYOTA_COMMON_LONG_TX_MSGS \ - TOYOTA_COMMON_TX_MSGS \ - {0x283, 0, 7, false}, {0x2E6, 0, 8, false}, {0x2E7, 0, 8, false}, {0x33E, 0, 7, false}, {0x344, 0, 8, false}, {0x365, 0, 7, false}, {0x366, 0, 7, false}, {0x4CB, 0, 8, false}, /* DSU bus 0 */ \ - {0x128, 1, 6, false}, {0x141, 1, 4, false}, {0x160, 1, 8, false}, {0x161, 1, 7, false}, {0x470, 1, 4, false}, /* DSU bus 1 */ \ - {0x411, 0, 8, false}, /* PCS_HUD */ \ - {0x750, 0, 8, false}, /* radar diagnostic address */ \ - {0x343, 0, 8, true}, /* ACC */ \ + {0x2E4, 0, 8, .check_relay = true}, {0x131, 0, 8, .check_relay = true}, \ + {0x343, 0, 8, .check_relay = false}, /* ACC cancel cmd */ \ + +#define TOYOTA_COMMON_LONG_TX_MSGS \ + TOYOTA_COMMON_TX_MSGS \ + /* DSU bus 0 */ \ + {0x283, 0, 7, .check_relay = false}, {0x2E6, 0, 8, .check_relay = false}, {0x2E7, 0, 8, .check_relay = false}, {0x33E, 0, 7, .check_relay = false}, \ + {0x344, 0, 8, .check_relay = false}, {0x365, 0, 7, .check_relay = false}, {0x366, 0, 7, .check_relay = false}, {0x4CB, 0, 8, .check_relay = false}, \ + /* DSU bus 1 */ \ + {0x128, 1, 6, .check_relay = false}, {0x141, 1, 4, .check_relay = false}, {0x160, 1, 8, .check_relay = false}, {0x161, 1, 7, .check_relay = false}, \ + {0x470, 1, 4, .check_relay = false}, \ + /* PCS_HUD */ \ + {0x411, 0, 8, .check_relay = false}, \ + /* radar diagnostic address */ \ + {0x750, 0, 8, .check_relay = false}, \ + /* ACC */ \ + {0x343, 0, 8, .check_relay = true}, \ #define TOYOTA_COMMON_RX_CHECKS(lta) \ {.msg = {{ 0xaa, 0, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 83U}, { 0 }, { 0 }}}, \ @@ -398,27 +405,10 @@ static safety_config toyota_init(uint16_t param) { return ret; } -static bool toyota_fwd_hook(int bus_num, int addr) { - bool block_msg = false; - if (bus_num == 2) { - // block stock lkas messages and stock acc messages (if OP is doing ACC) - // in TSS2, 0x191 is LTA which we need to block to avoid controls collision - bool is_lkas_msg = ((addr == 0x2E4) || (addr == 0x412) || (addr == 0x191)); - // on SecOC cars 0x131 is also LTA - is_lkas_msg |= toyota_secoc && (addr == 0x131); - // in TSS2 the camera does ACC as well, so filter 0x343 - bool is_acc_msg = (addr == 0x343); - block_msg = is_lkas_msg || (is_acc_msg && !toyota_stock_longitudinal); - } - - return block_msg; -} - const safety_hooks toyota_hooks = { .init = toyota_init, .rx = toyota_rx_hook, .tx = toyota_tx_hook, - .fwd = toyota_fwd_hook, .get_checksum = toyota_get_checksum, .compute_checksum = toyota_compute_checksum, .get_quality_flag_valid = toyota_get_quality_flag_valid, diff --git a/opendbc/safety/safety/safety_volkswagen_mqb.h b/opendbc/safety/safety/safety_volkswagen_mqb.h index ebbff4969fb..a87f9b3cfd2 100644 --- a/opendbc/safety/safety/safety_volkswagen_mqb.h +++ b/opendbc/safety/safety/safety_volkswagen_mqb.h @@ -9,11 +9,12 @@ static bool volkswagen_mqb_brake_pressure_detected = false; static safety_config volkswagen_mqb_init(uint16_t param) { // Transmit of GRA_ACC_01 is allowed on bus 0 and 2 to keep compatibility with gateway and camera integration - static const CanMsg VOLKSWAGEN_MQB_STOCK_TX_MSGS[] = {{MSG_HCA_01, 0, 8, true}, {MSG_GRA_ACC_01, 0, 8, false}, {MSG_GRA_ACC_01, 2, 8, false}, - {MSG_LDW_02, 0, 8, false}, {MSG_LH_EPS_03, 2, 8, false}}; + // MSG_LH_EPS_03: openpilot needs to replace apparent driver steering input torque to pacify VW Emergency Assist + static const CanMsg VOLKSWAGEN_MQB_STOCK_TX_MSGS[] = {{MSG_HCA_01, 0, 8, .check_relay = true}, {MSG_GRA_ACC_01, 0, 8, .check_relay = false}, {MSG_GRA_ACC_01, 2, 8, .check_relay = false}, + {MSG_LDW_02, 0, 8, .check_relay = true}, {MSG_LH_EPS_03, 2, 8, .check_relay = true}}; - static const CanMsg VOLKSWAGEN_MQB_LONG_TX_MSGS[] = {{MSG_HCA_01, 0, 8, true}, {MSG_LDW_02, 0, 8, false}, {MSG_LH_EPS_03, 2, 8, false}, - {MSG_ACC_02, 0, 8, false}, {MSG_ACC_06, 0, 8, false}, {MSG_ACC_07, 0, 8, false}}; + static const CanMsg VOLKSWAGEN_MQB_LONG_TX_MSGS[] = {{MSG_HCA_01, 0, 8, .check_relay = true}, {MSG_LDW_02, 0, 8, .check_relay = true}, {MSG_LH_EPS_03, 2, 8, .check_relay = true}, + {MSG_ACC_02, 0, 8, .check_relay = true}, {MSG_ACC_06, 0, 8, .check_relay = true}, {MSG_ACC_07, 0, 8, .check_relay = true}}; static RxCheck volkswagen_mqb_rx_checks[] = { {.msg = {{MSG_ESP_19, 0, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 100U}, { 0 }, { 0 }}}, @@ -200,38 +201,10 @@ static bool volkswagen_mqb_tx_hook(const CANPacket_t *to_send) { return tx; } -static bool volkswagen_mqb_fwd_hook(int bus_num, int addr) { - bool block_msg = false; - - switch (bus_num) { - case 0: - if (addr == MSG_LH_EPS_03) { - // openpilot needs to replace apparent driver steering input torque to pacify VW Emergency Assist - block_msg = true; - } - break; - case 2: - if ((addr == MSG_HCA_01) || (addr == MSG_LDW_02)) { - // openpilot takes over LKAS steering control and related HUD messages from the camera - block_msg = true; - } else if (volkswagen_longitudinal && ((addr == MSG_ACC_02) || (addr == MSG_ACC_06) || (addr == MSG_ACC_07))) { - // openpilot takes over acceleration/braking control and related HUD messages from the stock ACC radar - block_msg = true; - } else { - } - break; - default: - break; - } - - return block_msg; -} - const safety_hooks volkswagen_mqb_hooks = { .init = volkswagen_mqb_init, .rx = volkswagen_mqb_rx_hook, .tx = volkswagen_mqb_tx_hook, - .fwd = volkswagen_mqb_fwd_hook, .get_counter = volkswagen_mqb_meb_get_counter, .get_checksum = volkswagen_mqb_meb_get_checksum, .compute_checksum = volkswagen_mqb_meb_compute_crc, diff --git a/opendbc/safety/safety/safety_volkswagen_pq.h b/opendbc/safety/safety/safety_volkswagen_pq.h index c4cf014fa2f..193a1254422 100644 --- a/opendbc/safety/safety/safety_volkswagen_pq.h +++ b/opendbc/safety/safety/safety_volkswagen_pq.h @@ -52,11 +52,11 @@ static uint32_t volkswagen_pq_compute_checksum(const CANPacket_t *to_push) { static safety_config volkswagen_pq_init(uint16_t param) { // Transmit of GRA_Neu is allowed on bus 0 and 2 to keep compatibility with gateway and camera integration - static const CanMsg VOLKSWAGEN_PQ_STOCK_TX_MSGS[] = {{MSG_HCA_1, 0, 5, true}, {MSG_LDW_1, 0, 8, false}, - {MSG_GRA_NEU, 0, 4, false}, {MSG_GRA_NEU, 2, 4, false}}; + static const CanMsg VOLKSWAGEN_PQ_STOCK_TX_MSGS[] = {{MSG_HCA_1, 0, 5, .check_relay = true}, {MSG_LDW_1, 0, 8, .check_relay = true}, + {MSG_GRA_NEU, 0, 4, .check_relay = false}, {MSG_GRA_NEU, 2, 4, .check_relay = false}}; - static const CanMsg VOLKSWAGEN_PQ_LONG_TX_MSGS[] = {{MSG_HCA_1, 0, 5, true}, {MSG_LDW_1, 0, 8, false}, - {MSG_ACC_SYSTEM, 0, 8, false}, {MSG_ACC_GRA_ANZEIGE, 0, 8, false}}; + static const CanMsg VOLKSWAGEN_PQ_LONG_TX_MSGS[] = {{MSG_HCA_1, 0, 5, .check_relay = true}, {MSG_LDW_1, 0, 8, .check_relay = true}, + {MSG_ACC_SYSTEM, 0, 8, .check_relay = true}, {MSG_ACC_GRA_ANZEIGE, 0, 8, .check_relay = true}}; static RxCheck volkswagen_pq_rx_checks[] = { {.msg = {{MSG_LENKHILFE_3, 0, 6, .max_counter = 15U, .frequency = 100U}, { 0 }, { 0 }}}, @@ -217,32 +217,10 @@ static bool volkswagen_pq_tx_hook(const CANPacket_t *to_send) { return tx; } -static bool volkswagen_pq_fwd_hook(int bus_num, int addr) { - bool block_msg = false; - - switch (bus_num) { - case 2: - if ((addr == MSG_HCA_1) || (addr == MSG_LDW_1)) { - // openpilot takes over LKAS steering control and related HUD messages from the camera - block_msg = true; - } else if (volkswagen_longitudinal && ((addr == MSG_ACC_SYSTEM) || (addr == MSG_ACC_GRA_ANZEIGE))) { - // openpilot takes over acceleration/braking control and related HUD messages from the stock ACC radar - block_msg = true; - } else { - } - break; - default: - break; - } - - return block_msg; -} - const safety_hooks volkswagen_pq_hooks = { .init = volkswagen_pq_init, .rx = volkswagen_pq_rx_hook, .tx = volkswagen_pq_tx_hook, - .fwd = volkswagen_pq_fwd_hook, .get_counter = volkswagen_pq_get_counter, .get_checksum = volkswagen_pq_get_checksum, .compute_checksum = volkswagen_pq_compute_checksum, diff --git a/opendbc/safety/safety_declarations.h b/opendbc/safety/safety_declarations.h index 03b6af2201f..05a991bf5a5 100644 --- a/opendbc/safety/safety_declarations.h +++ b/opendbc/safety/safety_declarations.h @@ -3,6 +3,36 @@ #include #include +// from cereal.car.CarParams.SafetyModel +#define SAFETY_SILENT 0U +#define SAFETY_HONDA_NIDEC 1U +#define SAFETY_TOYOTA 2U +#define SAFETY_ELM327 3U +#define SAFETY_GM 4U +#define SAFETY_HONDA_BOSCH_GIRAFFE 5U +#define SAFETY_FORD 6U +#define SAFETY_HYUNDAI 8U +#define SAFETY_CHRYSLER 9U +#define SAFETY_TESLA 10U +#define SAFETY_SUBARU 11U +#define SAFETY_MAZDA 13U +#define SAFETY_NISSAN 14U +#define SAFETY_VOLKSWAGEN_MQB 15U +#define SAFETY_ALLOUTPUT 17U +#define SAFETY_GM_ASCM 18U +#define SAFETY_NOOUTPUT 19U +#define SAFETY_HONDA_BOSCH 20U +#define SAFETY_VOLKSWAGEN_PQ 21U +#define SAFETY_SUBARU_PREGLOBAL 22U +#define SAFETY_HYUNDAI_LEGACY 23U +#define SAFETY_HYUNDAI_COMMUNITY 24U +#define SAFETY_STELLANTIS 25U +#define SAFETY_FAW 26U +#define SAFETY_BODY 27U +#define SAFETY_HYUNDAI_CANFD 28U +#define SAFETY_RIVIAN 33U +#define SAFETY_VOLKSWAGEN_MEB 34U + #define GET_BIT(msg, b) ((bool)!!(((msg)->data[((b) / 8U)] >> ((b) % 8U)) & 0x1U)) #define GET_BYTE(msg, b) ((msg)->data[(b)]) #define GET_FLAG(value, mask) (((__typeof__(mask))(value) & (mask)) == (mask)) // cppcheck-suppress misra-c2012-1.2; allow __typeof__ @@ -53,7 +83,8 @@ typedef struct { int addr; int bus; int len; - bool check_relay; + bool check_relay; // if true, trigger relay malfunction if existence on destination bus and block forwarding to destination bus + bool disable_static_blocking; // if true, static blocking is disabled so safety mode can dynamically handle it (e.g. selective AEB pass-through) } CanMsg; typedef enum { @@ -184,7 +215,6 @@ typedef struct { bool safety_rx_hook(const CANPacket_t *to_push); bool safety_tx_hook(CANPacket_t *to_send); -uint32_t get_ts_elapsed(uint32_t ts, uint32_t ts_last); int to_signed(int d, int bits); void update_sample(struct sample_t *sample, int sample_new); bool get_longitudinal_allowed(void); @@ -193,7 +223,6 @@ void gen_crc_lookup_table_8(uint8_t poly, uint8_t crc_lut[]); #ifdef CANFD void gen_crc_lookup_table_16(uint16_t poly, uint16_t crc_lut[]); #endif -static void generic_rx_checks(bool stock_ecu_detected); bool steer_torque_cmd_checks(int desired_torque, int steer_req, const TorqueSteeringLimits limits); bool steer_angle_cmd_checks(int desired_angle, bool steer_control_enabled, const AngleSteeringLimits limits); bool longitudinal_accel_checks(int desired_accel, const LongitudinalLimits limits); diff --git a/opendbc/safety/tests/misra/test_mutation.py b/opendbc/safety/tests/misra/test_mutation.py index 1caf51a8641..e93067e663b 100755 --- a/opendbc/safety/tests/misra/test_mutation.py +++ b/opendbc/safety/tests/misra/test_mutation.py @@ -19,7 +19,7 @@ # default (None, None, False), # general safety - ("opendbc/safety/safety/safety_toyota.h", "s/is_lkas_msg =.*;/is_lkas_msg = addr == 1 || addr == 2;/g", True), + ("opendbc/safety/safety/safety_toyota.h", "s/if (addr == 0x260) {/if (addr == 1 || addr == 2) {/g", True), ] patterns = [ diff --git a/opendbc/safety/tests/test_chrysler.py b/opendbc/safety/tests/test_chrysler.py index 5510e13789e..d8c9825664b 100755 --- a/opendbc/safety/tests/test_chrysler.py +++ b/opendbc/safety/tests/test_chrysler.py @@ -10,7 +10,7 @@ class TestChryslerSafety(common.PandaCarSafetyTest, common.MotorTorqueSteeringSafetyTest): TX_MSGS = [[0x23B, 0], [0x292, 0], [0x2A6, 0]] - RELAY_MALFUNCTION_ADDRS = {0: (0x292,)} + RELAY_MALFUNCTION_ADDRS = {0: (0x292, 0x2A6)} FWD_BLACKLISTED_ADDRS = {2: [0x292, 0x2A6]} MAX_RATE_UP = 3 @@ -74,7 +74,7 @@ def test_buttons(self): class TestChryslerRamDTSafety(TestChryslerSafety): TX_MSGS = [[0xB1, 2], [0xA6, 0], [0xFA, 0]] - RELAY_MALFUNCTION_ADDRS = {0: (0xA6,)} + RELAY_MALFUNCTION_ADDRS = {0: (0xA6, 0xFA)} FWD_BLACKLISTED_ADDRS = {2: [0xA6, 0xFA]} MAX_RATE_UP = 6 @@ -97,7 +97,7 @@ def _speed_msg(self, speed): class TestChryslerRamHDSafety(TestChryslerSafety): TX_MSGS = [[0x275, 0], [0x276, 0], [0x23A, 2]] - RELAY_MALFUNCTION_ADDRS = {0: (0x276,)} + RELAY_MALFUNCTION_ADDRS = {0: (0x276, 0x275)} FWD_BLACKLISTED_ADDRS = {2: [0x275, 0x276]} MAX_TORQUE_LOOKUP = [0], [361] diff --git a/opendbc/safety/tests/test_gm.py b/opendbc/safety/tests/test_gm.py index a92e1173989..29a56d184d5 100755 --- a/opendbc/safety/tests/test_gm.py +++ b/opendbc/safety/tests/test_gm.py @@ -18,7 +18,7 @@ class Buttons: class GmLongitudinalBase(common.PandaCarSafetyTest, common.LongitudinalGasBrakeSafetyTest): # pylint: disable=no-member,abstract-method - RELAY_MALFUNCTION_ADDRS = {0: (0x180, 0x2CB)} # ASCMLKASteeringCmd, ASCMGasRegenCmd + RELAY_MALFUNCTION_ADDRS = {0: (0x180, 0x2CB), 2: (0x184,)} # ASCMLKASteeringCmd, ASCMGasRegenCmd, PSCMStatus MAX_POSSIBLE_BRAKE = 2 ** 12 MAX_BRAKE = 400 @@ -75,7 +75,7 @@ def test_cancel_button(self): class TestGmSafetyBase(common.PandaCarSafetyTest, common.DriverTorqueSteeringSafetyTest): STANDSTILL_THRESHOLD = 10 * 0.0311 # Ensures ASCM is off on ASCM cars, and relay is not malfunctioning for camera-ACC cars - RELAY_MALFUNCTION_ADDRS = {0: (0x180,)} # ASCMLKASteeringCmd + RELAY_MALFUNCTION_ADDRS = {0: (0x180,), 2: (0x184,)} # ASCMLKASteeringCmd, PSCMStatus BUTTONS_BUS = 0 # rx or tx BRAKE_BUS = 0 # tx only @@ -148,6 +148,7 @@ class TestGmAscmSafety(GmLongitudinalBase, TestGmSafetyBase): [0xA1, 1], [0x306, 1], [0x308, 1], [0x310, 1], # obs bus [0x315, 2]] # ch bus FWD_BLACKLISTED_ADDRS: dict[int, list[int]] = {} + RELAY_MALFUNCTION_ADDRS = {0: (0x180, 0x2CB)} # ASCMLKASteeringCmd, ASCMGasRegenCmd FWD_BUS_LOOKUP: dict[int, int] = {} BRAKE_BUS = 2 @@ -209,6 +210,7 @@ class TestGmCameraLongitudinalSafety(GmLongitudinalBase, TestGmCameraSafetyBase) TX_MSGS = [[0x180, 0], [0x315, 0], [0x2CB, 0], [0x370, 0], # pt bus [0x184, 2]] # camera bus FWD_BLACKLISTED_ADDRS = {2: [0x180, 0x2CB, 0x370, 0x315], 0: [0x184]} # block LKAS, ACC messages and PSCMStatus + RELAY_MALFUNCTION_ADDRS = {0: (0x180, 0x2CB, 0x370, 0x315), 2: (0x184,)} BUTTONS_BUS = 0 # rx only MAX_GAS = 1346 diff --git a/opendbc/safety/tests/test_honda.py b/opendbc/safety/tests/test_honda.py index 265842efe4d..a9fc57dd284 100755 --- a/opendbc/safety/tests/test_honda.py +++ b/opendbc/safety/tests/test_honda.py @@ -249,6 +249,7 @@ def test_steer_safety_check(self): class TestHondaNidecSafetyBase(HondaBase): TX_MSGS = HONDA_N_COMMON_TX_MSGS FWD_BLACKLISTED_ADDRS = {2: [0xE4, 0x194, 0x33D, 0x30C]} + RELAY_MALFUNCTION_ADDRS = {0: (0xE4, 0x194, 0x33D, 0x30C)} PT_BUS = 0 STEER_BUS = 0 @@ -374,7 +375,7 @@ class TestHondaBoschSafetyBase(HondaBase): TX_MSGS = [[0xE4, 0], [0xE5, 0], [0x296, 1], [0x33D, 0], [0x33DA, 0], [0x33DB, 0]] FWD_BLACKLISTED_ADDRS = {2: [0xE4, 0xE5, 0x33D, 0x33DA, 0x33DB]} - RELAY_MALFUNCTION_ADDRS = {0: (0xE4,)} # STEERING_CONTROL + RELAY_MALFUNCTION_ADDRS = {0: (0xE4, 0xE5, 0x33D, 0x33DA, 0x33DB)} # STEERING_CONTROL, BOSCH_SUPPLEMENTAL_1 def setUp(self): self.packer = CANPackerPanda("honda_accord_2018_can_generated") @@ -458,9 +459,9 @@ class TestHondaBoschLongSafety(HondaButtonEnableBase, TestHondaBoschSafetyBase): STEER_BUS = 1 TX_MSGS = [[0xE4, 1], [0x1DF, 1], [0x1EF, 1], [0x1FA, 1], [0x30C, 1], [0x33D, 1], [0x33DA, 1], [0x33DB, 1], [0x39F, 1], [0x18DAB0F1, 1]] - FWD_BLACKLISTED_ADDRS = {2: [0xE4, 0xE5, 0x33D, 0x33DA, 0x33DB]} + FWD_BLACKLISTED_ADDRS = {} # 0x1DF is to test that radar is disabled - RELAY_MALFUNCTION_ADDRS = {1: (0xE4, 0x1DF)} # STEERING_CONTROL, ACC_CONTROL + RELAY_MALFUNCTION_ADDRS = {1: (0xE4, 0x1DF, 0x33D, 0x33DA, 0x33DB)} # STEERING_CONTROL, ACC_CONTROL def setUp(self): super().setUp() @@ -510,7 +511,8 @@ class TestHondaBoschRadarlessSafetyBase(TestHondaBoschSafetyBase): BUTTONS_BUS = 2 # camera controls ACC, need to send buttons on bus 2 TX_MSGS = [[0xE4, 0], [0x296, 2], [0x33D, 0]] - FWD_BLACKLISTED_ADDRS = {2: [0xE4, 0xE5, 0x33D, 0x33DA, 0x33DB]} + FWD_BLACKLISTED_ADDRS = {2: [0xE4, 0x33D]} + RELAY_MALFUNCTION_ADDRS = {0: (0xE4, 0x33D)} # STEERING_CONTROL def setUp(self): self.packer = CANPackerPanda("honda_civic_ex_2022_can_generated") @@ -545,7 +547,8 @@ class TestHondaBoschRadarlessLongSafety(common.LongitudinalAccelSafetyTest, Hond Covers the Honda Bosch Radarless safety mode with longitudinal control """ TX_MSGS = [[0xE4, 0], [0x33D, 0], [0x1C8, 0], [0x30C, 0]] - FWD_BLACKLISTED_ADDRS = {2: [0xE4, 0xE5, 0x33D, 0x33DA, 0x33DB, 0x1C8, 0x30C]} + FWD_BLACKLISTED_ADDRS = {2: [0xE4, 0x33D, 0x1C8, 0x30C]} + RELAY_MALFUNCTION_ADDRS = {0: (0xE4, 0x1C8, 0x30C, 0x33D)} def setUp(self): super().setUp() diff --git a/opendbc/safety/tests/test_hyundai.py b/opendbc/safety/tests/test_hyundai.py index 80ec273a292..c0c972caeb6 100755 --- a/opendbc/safety/tests/test_hyundai.py +++ b/opendbc/safety/tests/test_hyundai.py @@ -48,7 +48,7 @@ def checksum(msg): class TestHyundaiSafety(HyundaiButtonBase, common.PandaCarSafetyTest, common.DriverTorqueSteeringSafetyTest, common.SteerRequestCutSafetyTest): TX_MSGS = [[0x340, 0], [0x4F1, 0], [0x485, 0]] STANDSTILL_THRESHOLD = 12 # 0.375 kph - RELAY_MALFUNCTION_ADDRS = {0: (0x340,)} # LKAS11 + RELAY_MALFUNCTION_ADDRS = {0: (0x340, 0x485)} # LKAS11 FWD_BLACKLISTED_ADDRS = {2: [0x340, 0x485]} MAX_RATE_UP = 3 @@ -193,7 +193,9 @@ def _user_gas_msg(self, gas): class TestHyundaiLongitudinalSafety(HyundaiLongitudinalBase, TestHyundaiSafety): TX_MSGS = [[0x340, 0], [0x4F1, 0], [0x485, 0], [0x420, 0], [0x421, 0], [0x50A, 0], [0x389, 0], [0x4A2, 0], [0x38D, 0], [0x483, 0], [0x7D0, 0]] - RELAY_MALFUNCTION_ADDRS = {0: (0x340, 0x421)} # LKAS11, SCC12 + FWD_BLACKLISTED_ADDRS = {2: [0x340, 0x485, 0x421, 0x420, 0x50A, 0x389]} + + RELAY_MALFUNCTION_ADDRS = {0: (0x340, 0x485, 0x421, 0x420, 0x50A, 0x389)} # LKAS11, LFAHDA_MFC, SCC12, SCC11, SCC13, SCC14 DISABLED_ECU_UDS_MSG = (0x7D0, 0) DISABLED_ECU_ACTUATION_MSG = (0x421, 0) @@ -239,6 +241,7 @@ class TestHyundaiLongitudinalSafetyCameraSCC(HyundaiLongitudinalBase, TestHyunda TX_MSGS = [[0x340, 0], [0x4F1, 2], [0x485, 0], [0x420, 0], [0x421, 0], [0x50A, 0], [0x389, 0], [0x4A2, 0]] FWD_BLACKLISTED_ADDRS = {2: [0x340, 0x485, 0x420, 0x421, 0x50A, 0x389]} + RELAY_MALFUNCTION_ADDRS = {0: (0x340, 0x485, 0x421, 0x420, 0x50A, 0x389)} # LKAS11, LFAHDA_MFC, SCC12, SCC11, SCC13, SCC14 def setUp(self): self.packer = CANPackerPanda("hyundai_kia_generic") diff --git a/opendbc/safety/tests/test_hyundai_canfd.py b/opendbc/safety/tests/test_hyundai_canfd.py index 8036da100e4..3fad83d3df1 100755 --- a/opendbc/safety/tests/test_hyundai_canfd.py +++ b/opendbc/safety/tests/test_hyundai_canfd.py @@ -85,8 +85,8 @@ def _button_msg(self, buttons, main_button=0, bus=None): class TestHyundaiCanfdLFASteeringBase(TestHyundaiCanfdBase): TX_MSGS = [[0x12A, 0], [0x1A0, 1], [0x1CF, 0], [0x1E0, 0]] - RELAY_MALFUNCTION_ADDRS = {0: (0x12A,)} # LFA - FWD_BLACKLISTED_ADDRS = {2: [0x12A, 0x1E0, 0x161, 0x162]} + RELAY_MALFUNCTION_ADDRS = {0: (0x12A, 0x1E0)} # LFA, LFAHDA_CLUSTER + FWD_BLACKLISTED_ADDRS = {2: [0x12A, 0x1E0]} STEER_MSG = "LFA" BUTTONS_TX_BUS = 2 @@ -159,8 +159,8 @@ class TestHyundaiCanfdLFASteeringAltButtons(TestHyundaiCanfdLFASteeringAltButton class TestHyundaiCanfdLKASteeringEV(TestHyundaiCanfdBase): TX_MSGS = [[0x50, 0], [0x1CF, 1], [0x2A4, 0]] - RELAY_MALFUNCTION_ADDRS = {0: (0x50,)} # LKAS - FWD_BLACKLISTED_ADDRS = {2: [0x50, 0x2a4, 0x161, 0x162]} + RELAY_MALFUNCTION_ADDRS = {0: (0x50, 0x2a4)} # LKAS, CAM_0x2A4 + FWD_BLACKLISTED_ADDRS = {2: [0x50, 0x2a4]} PT_BUS = 1 SCC_BUS = 1 @@ -178,8 +178,8 @@ def setUp(self): class TestHyundaiCanfdLKASteeringAltEV(TestHyundaiCanfdBase): TX_MSGS = [[0x110, 0], [0x1CF, 1], [0x362, 0]] - RELAY_MALFUNCTION_ADDRS = {0: (0x110,)} # LKAS_ALT - FWD_BLACKLISTED_ADDRS = {2: [0x110, 0x362, 0x161, 0x162]} + RELAY_MALFUNCTION_ADDRS = {0: (0x110, 0x362)} # LKAS_ALT, CAM_0x362 + FWD_BLACKLISTED_ADDRS = {2: [0x110, 0x362]} PT_BUS = 1 SCC_BUS = 1 @@ -199,7 +199,7 @@ class TestHyundaiCanfdLKASteeringLongEV(HyundaiLongitudinalBase, TestHyundaiCanf TX_MSGS = [[0x50, 0], [0x1CF, 1], [0x2A4, 0], [0x51, 0], [0x730, 1], [0x12a, 1], [0x160, 1], [0x1e0, 1], [0x1a0, 1], [0x1ea, 1], [0x200, 1], [0x345, 1], [0x1da, 1]] - RELAY_MALFUNCTION_ADDRS = {0: (0x50,), 1: (0x1a0,)} # LKAS, SCC_CONTROL + RELAY_MALFUNCTION_ADDRS = {0: (0x50, 0x2a4), 1: (0x1a0,)} # LKAS, CAM_0x2A4, SCC_CONTROL DISABLED_ECU_UDS_MSG = (0x730, 1) DISABLED_ECU_ACTUATION_MSG = (0x1a0, 1) @@ -226,9 +226,9 @@ def _accel_msg(self, accel, aeb_req=False, aeb_decel=0): # Tests longitudinal for ICE, hybrid, EV cars with LFA steering class TestHyundaiCanfdLFASteeringLongBase(HyundaiLongitudinalBase, TestHyundaiCanfdLFASteeringBase): - FWD_BLACKLISTED_ADDRS = {2: [0x12a, 0x1e0, 0x1a0, 0x160, 0x161, 0x162]} + FWD_BLACKLISTED_ADDRS = {2: [0x12a, 0x1e0, 0x1a0, 0x160]} - RELAY_MALFUNCTION_ADDRS = {0: (0x12A, 0x1a0)} # LFA, SCC_CONTROL + RELAY_MALFUNCTION_ADDRS = {0: (0x12A, 0x1E0, 0x1a0, 0x160)} # LFA, LFAHDA_CLUSTER, SCC_CONTROL, ADRV_0x160 DISABLED_ECU_UDS_MSG = (0x7D0, 0) DISABLED_ECU_ACTUATION_MSG = (0x1a0, 0) diff --git a/opendbc/safety/tests/test_mazda.py b/opendbc/safety/tests/test_mazda.py index 67a22d492d4..a39b25b4aa7 100755 --- a/opendbc/safety/tests/test_mazda.py +++ b/opendbc/safety/tests/test_mazda.py @@ -11,7 +11,7 @@ class TestMazdaSafety(common.PandaCarSafetyTest, common.DriverTorqueSteeringSafe TX_MSGS = [[0x243, 0], [0x09d, 0], [0x440, 0]] STANDSTILL_THRESHOLD = .1 - RELAY_MALFUNCTION_ADDRS = {0: (0x243,)} + RELAY_MALFUNCTION_ADDRS = {0: (0x243, 0x440)} FWD_BLACKLISTED_ADDRS = {2: [0x243, 0x440]} MAX_RATE_UP = 10 diff --git a/opendbc/safety/tests/test_nissan.py b/opendbc/safety/tests/test_nissan.py index 22f556f4dc1..588bc9612c1 100755 --- a/opendbc/safety/tests/test_nissan.py +++ b/opendbc/safety/tests/test_nissan.py @@ -12,7 +12,7 @@ class TestNissanSafety(common.PandaCarSafetyTest, common.AngleSteeringSafetyTest TX_MSGS = [[0x169, 0], [0x2b1, 0], [0x4cc, 0], [0x20b, 2], [0x280, 2]] GAS_PRESSED_THRESHOLD = 3 - RELAY_MALFUNCTION_ADDRS = {0: (0x169,)} + RELAY_MALFUNCTION_ADDRS = {0: (0x169, 0x2b1, 0x4cc), 2: (0x280,)} FWD_BLACKLISTED_ADDRS = {0: [0x280], 2: [0x169, 0x2b1, 0x4cc]} EPS_BUS = 0 diff --git a/opendbc/safety/tests/test_rivian.py b/opendbc/safety/tests/test_rivian.py index e3f888564e3..8867c94a78d 100755 --- a/opendbc/safety/tests/test_rivian.py +++ b/opendbc/safety/tests/test_rivian.py @@ -27,7 +27,7 @@ class TestRivianSafetyBase(common.PandaCarSafetyTest, common.DriverTorqueSteerin common.VehicleSpeedSafetyTest): TX_MSGS = [[0x120, 0], [0x321, 2], [0x162, 2]] - RELAY_MALFUNCTION_ADDRS = {0: (0x120,)} + RELAY_MALFUNCTION_ADDRS = {0: (0x120,), 2: (0x321, 0x162)} FWD_BLACKLISTED_ADDRS = {0: [0x321, 0x162], 2: [0x120]} MAX_TORQUE_LOOKUP = [9, 17], [350, 250] @@ -149,7 +149,7 @@ def test_adas_status(self): class TestRivianLongitudinalSafety(TestRivianSafetyBase): TX_MSGS = [[0x120, 0], [0x321, 2], [0x160, 0]] - RELAY_MALFUNCTION_ADDRS = {0: (0x120, 0x160)} + RELAY_MALFUNCTION_ADDRS = {0: (0x120, 0x160), 2: (0x321,)} FWD_BLACKLISTED_ADDRS = {0: [0x321], 2: [0x120, 0x160]} def setUp(self): diff --git a/opendbc/safety/tests/test_subaru.py b/opendbc/safety/tests/test_subaru.py index 4936eae13a4..f31a8df5c9a 100755 --- a/opendbc/safety/tests/test_subaru.py +++ b/opendbc/safety/tests/test_subaru.py @@ -56,7 +56,8 @@ def fwd_blacklisted_addr(lkas_msg=SubaruMsg.ES_LKAS): class TestSubaruSafetyBase(common.PandaCarSafetyTest): FLAGS = 0 - RELAY_MALFUNCTION_ADDRS = {SUBARU_MAIN_BUS: (SubaruMsg.ES_LKAS,)} + RELAY_MALFUNCTION_ADDRS = {SUBARU_MAIN_BUS: (SubaruMsg.ES_LKAS, SubaruMsg.ES_DashStatus, SubaruMsg.ES_LKAS_State, + SubaruMsg.ES_Infotainment)} FWD_BLACKLISTED_ADDRS = fwd_blacklisted_addr() MAX_RT_DELTA = 940 @@ -188,11 +189,19 @@ class TestSubaruGen2TorqueStockLongitudinalSafety(TestSubaruStockLongitudinalSaf class TestSubaruGen1LongitudinalSafety(TestSubaruLongitudinalSafetyBase, TestSubaruTorqueSafetyBase): FLAGS = SubaruSafetyFlags.LONG TX_MSGS = lkas_tx_msgs(SUBARU_MAIN_BUS) + long_tx_msgs(SUBARU_MAIN_BUS) + RELAY_MALFUNCTION_ADDRS = {SUBARU_MAIN_BUS: (SubaruMsg.ES_LKAS, SubaruMsg.ES_DashStatus, SubaruMsg.ES_LKAS_State, + SubaruMsg.ES_Infotainment, SubaruMsg.ES_Brake, SubaruMsg.ES_Status, + SubaruMsg.ES_Distance)} class TestSubaruGen2LongitudinalSafety(TestSubaruLongitudinalSafetyBase, TestSubaruGen2TorqueSafetyBase): FLAGS = SubaruSafetyFlags.LONG | SubaruSafetyFlags.GEN2 TX_MSGS = lkas_tx_msgs(SUBARU_ALT_BUS) + long_tx_msgs(SUBARU_ALT_BUS) + gen2_long_additional_tx_msgs() + FWD_BLACKLISTED_ADDRS = {2: [SubaruMsg.ES_LKAS, SubaruMsg.ES_DashStatus, SubaruMsg.ES_LKAS_State, + SubaruMsg.ES_Infotainment]} + RELAY_MALFUNCTION_ADDRS = {SUBARU_MAIN_BUS: (SubaruMsg.ES_LKAS, SubaruMsg.ES_DashStatus, SubaruMsg.ES_LKAS_State, + SubaruMsg.ES_Infotainment), + SUBARU_ALT_BUS: (SubaruMsg.ES_Brake, SubaruMsg.ES_Status, SubaruMsg.ES_Distance)} def _rdbi_msg(self, did: int): return b'\x03\x22' + did.to_bytes(2) + b'\x00\x00\x00\x00' diff --git a/opendbc/safety/tests/test_subaru_preglobal.py b/opendbc/safety/tests/test_subaru_preglobal.py index af2c6cec238..44aef0812e4 100755 --- a/opendbc/safety/tests/test_subaru_preglobal.py +++ b/opendbc/safety/tests/test_subaru_preglobal.py @@ -12,7 +12,7 @@ class TestSubaruPreglobalSafety(common.PandaCarSafetyTest, common.DriverTorqueSt FLAGS = 0 DBC = "subaru_outback_2015_generated" TX_MSGS = [[0x161, 0], [0x164, 0]] - RELAY_MALFUNCTION_ADDRS = {0: (0x164,)} + RELAY_MALFUNCTION_ADDRS = {0: (0x164, 0x161)} FWD_BLACKLISTED_ADDRS = {2: [0x161, 0x164]} MAX_RATE_UP = 50 diff --git a/opendbc/safety/tests/test_toyota.py b/opendbc/safety/tests/test_toyota.py index a119615c852..3edbe1ebf47 100755 --- a/opendbc/safety/tests/test_toyota.py +++ b/opendbc/safety/tests/test_toyota.py @@ -21,7 +21,7 @@ class TestToyotaSafetyBase(common.PandaCarSafetyTest, common.LongitudinalAccelSafetyTest): TX_MSGS = TOYOTA_COMMON_TX_MSGS + TOYOTA_COMMON_LONG_TX_MSGS - RELAY_MALFUNCTION_ADDRS = {0: (0x2E4, 0x343)} + RELAY_MALFUNCTION_ADDRS = {0: (0x2E4, 0x191, 0x412, 0x343)} FWD_BLACKLISTED_ADDRS = {2: [0x2E4, 0x412, 0x191, 0x343]} EPS_SCALE = 73 @@ -267,7 +267,7 @@ class TestToyotaStockLongitudinalBase(TestToyotaSafetyBase): TX_MSGS = TOYOTA_COMMON_TX_MSGS # Base addresses minus ACC_CONTROL (0x343) - RELAY_MALFUNCTION_ADDRS = {0: (0x2E4,)} + RELAY_MALFUNCTION_ADDRS = {0: (0x2E4, 0x191, 0x412)} FWD_BLACKLISTED_ADDRS = {2: [0x2E4, 0x412, 0x191]} LONGITUDINAL = False @@ -312,8 +312,8 @@ def setUp(self): class TestToyotaSecOcSafety(TestToyotaStockLongitudinalBase): TX_MSGS = TOYOTA_SECOC_TX_MSGS - RELAY_MALFUNCTION_ADDRS = {0: (0x2E4,)} - FWD_BLACKLISTED_ADDRS = {2: [0x2E4, 0x412, 0x191, 0x131]} + RELAY_MALFUNCTION_ADDRS = {0: (0x2E4, 0x191, 0x412, 0x131)} + FWD_BLACKLISTED_ADDRS = {2: [0x2E4, 0x191, 0x412, 0x131]} def setUp(self): self.packer = CANPackerPanda("toyota_secoc_pt_generated") diff --git a/opendbc/safety/tests/test_volkswagen_mqb.py b/opendbc/safety/tests/test_volkswagen_mqb.py index 83e45f1fea5..92d659f4cec 100755 --- a/opendbc/safety/tests/test_volkswagen_mqb.py +++ b/opendbc/safety/tests/test_volkswagen_mqb.py @@ -24,7 +24,7 @@ class TestVolkswagenMqbSafetyBase(common.PandaCarSafetyTest, common.DriverTorqueSteeringSafetyTest): - RELAY_MALFUNCTION_ADDRS = {0: (MSG_HCA_01,)} + RELAY_MALFUNCTION_ADDRS = {0: (MSG_HCA_01, MSG_LDW_02), 2: (MSG_LH_EPS_03,)} MAX_RATE_UP = 4 MAX_RATE_DOWN = 10 @@ -150,6 +150,7 @@ def test_spam_cancel_safety_check(self): class TestVolkswagenMqbLongSafety(TestVolkswagenMqbSafetyBase): TX_MSGS = [[MSG_HCA_01, 0], [MSG_LDW_02, 0], [MSG_LH_EPS_03, 2], [MSG_ACC_02, 0], [MSG_ACC_06, 0], [MSG_ACC_07, 0]] FWD_BLACKLISTED_ADDRS = {0: [MSG_LH_EPS_03], 2: [MSG_HCA_01, MSG_LDW_02, MSG_ACC_02, MSG_ACC_06, MSG_ACC_07]} + RELAY_MALFUNCTION_ADDRS = {0: (MSG_HCA_01, MSG_LDW_02, MSG_ACC_02, MSG_ACC_06, MSG_ACC_07), 2: (MSG_LH_EPS_03,)} INACTIVE_ACCEL = 3.01 def setUp(self): diff --git a/opendbc/safety/tests/test_volkswagen_pq.py b/opendbc/safety/tests/test_volkswagen_pq.py index 8f6de057c1a..22b897d9a0e 100755 --- a/opendbc/safety/tests/test_volkswagen_pq.py +++ b/opendbc/safety/tests/test_volkswagen_pq.py @@ -22,7 +22,7 @@ class TestVolkswagenPqSafetyBase(common.PandaCarSafetyTest, common.DriverTorqueSteeringSafetyTest): cruise_engaged = False - RELAY_MALFUNCTION_ADDRS = {0: (MSG_HCA_1,)} + RELAY_MALFUNCTION_ADDRS = {0: (MSG_HCA_1, MSG_LDW_1)} MAX_RATE_UP = 6 MAX_RATE_DOWN = 10 @@ -133,6 +133,7 @@ def test_spam_cancel_safety_check(self): class TestVolkswagenPqLongSafety(TestVolkswagenPqSafetyBase, common.LongitudinalAccelSafetyTest): TX_MSGS = [[MSG_HCA_1, 0], [MSG_LDW_1, 0], [MSG_ACC_SYSTEM, 0], [MSG_ACC_GRA_ANZEIGE, 0]] FWD_BLACKLISTED_ADDRS = {2: [MSG_HCA_1, MSG_LDW_1, MSG_ACC_SYSTEM, MSG_ACC_GRA_ANZEIGE]} + RELAY_MALFUNCTION_ADDRS = {0: (MSG_HCA_1, MSG_LDW_1, MSG_ACC_SYSTEM, MSG_ACC_GRA_ANZEIGE)} INACTIVE_ACCEL = 3.01 def setUp(self): From 0902a062e91c16a353548c200432367774092e20 Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 24 Apr 2025 16:38:02 -0400 Subject: [PATCH 252/316] Revert "Squashed commit of the following:" This reverts commit 2b7275800588013b02b8330fa1e8a6e962c5dcb5. --- docs/CARS.md | 5 +- opendbc/car/body/interface.py | 2 +- opendbc/car/car.capnp | 2 +- opendbc/car/car_helpers.py | 4 +- opendbc/car/chrysler/interface.py | 2 +- opendbc/car/docs.py | 2 +- opendbc/car/docs_definitions.py | 4 +- opendbc/car/ford/fingerprints.py | 2 - opendbc/car/ford/interface.py | 6 +- opendbc/car/gm/interface.py | 8 +- opendbc/car/honda/carstate.py | 16 +-- opendbc/car/honda/fingerprints.py | 20 ---- opendbc/car/honda/hondacan.py | 16 +-- opendbc/car/honda/interface.py | 35 ++---- opendbc/car/honda/values.py | 29 +---- opendbc/car/hyundai/fingerprints.py | 2 - opendbc/car/hyundai/interface.py | 10 +- opendbc/car/hyundai/values.py | 2 +- opendbc/car/interfaces.py | 6 +- opendbc/car/mazda/interface.py | 2 +- opendbc/car/mock/interface.py | 2 +- opendbc/car/nissan/interface.py | 2 +- opendbc/car/rivian/interface.py | 6 +- opendbc/car/subaru/interface.py | 8 +- opendbc/car/subaru/values.py | 2 +- opendbc/car/tesla/interface.py | 6 +- opendbc/car/tesla/values.py | 8 +- opendbc/car/tests/routes.py | 4 +- opendbc/car/tests/test_car_interfaces.py | 4 +- opendbc/car/torque_data/override.toml | 3 +- opendbc/car/toyota/interface.py | 6 +- opendbc/car/volkswagen/interface.py | 6 +- .../dbc/generator/honda/_bosch_adas_2018.dbc | 11 +- .../dbc/generator/nissan/_nissan_common.dbc | 4 - opendbc/dbc/rivian_park_assist_can.dbc | 52 --------- opendbc/dbc/rivian_primary_actuator.dbc | 1 - opendbc/dbc/tesla_model3_party.dbc | 5 +- opendbc/safety/board/drivers/can_common.h | 1 - opendbc/safety/board/utils.h | 2 +- opendbc/safety/safety.h | 65 ++++++----- opendbc/safety/safety/safety_body.h | 6 +- opendbc/safety/safety/safety_chrysler.h | 31 +++-- opendbc/safety/safety/safety_ford.h | 63 ++++++++--- opendbc/safety/safety/safety_gm.h | 49 +++++--- opendbc/safety/safety/safety_honda.h | 47 ++++---- opendbc/safety/safety/safety_hyundai.h | 43 +++++-- opendbc/safety/safety/safety_hyundai_canfd.h | 106 +++++++++--------- opendbc/safety/safety/safety_mazda.h | 13 ++- opendbc/safety/safety/safety_nissan.h | 28 ++++- opendbc/safety/safety/safety_rivian.h | 43 ++++++- opendbc/safety/safety/safety_subaru.h | 66 ++++++----- .../safety/safety/safety_subaru_preglobal.h | 15 ++- opendbc/safety/safety/safety_tesla.h | 31 ++--- opendbc/safety/safety/safety_toyota.h | 50 +++++---- opendbc/safety/safety/safety_volkswagen_mqb.h | 37 +++++- opendbc/safety/safety/safety_volkswagen_pq.h | 30 ++++- opendbc/safety/safety_declarations.h | 35 +----- opendbc/safety/tests/misra/test_mutation.py | 2 +- opendbc/safety/tests/test_chrysler.py | 6 +- opendbc/safety/tests/test_gm.py | 6 +- opendbc/safety/tests/test_honda.py | 13 +-- opendbc/safety/tests/test_hyundai.py | 7 +- opendbc/safety/tests/test_hyundai_canfd.py | 18 +-- opendbc/safety/tests/test_mazda.py | 2 +- opendbc/safety/tests/test_nissan.py | 2 +- opendbc/safety/tests/test_rivian.py | 4 +- opendbc/safety/tests/test_subaru.py | 11 +- opendbc/safety/tests/test_subaru_preglobal.py | 2 +- opendbc/safety/tests/test_toyota.py | 8 +- opendbc/safety/tests/test_volkswagen_mqb.py | 3 +- opendbc/safety/tests/test_volkswagen_pq.py | 3 +- 71 files changed, 610 insertions(+), 543 deletions(-) delete mode 100644 opendbc/dbc/rivian_park_assist_can.dbc diff --git a/docs/CARS.md b/docs/CARS.md index 6e40e4f7fe0..3b4d6d3e2fc 100644 --- a/docs/CARS.md +++ b/docs/CARS.md @@ -1,6 +1,6 @@ -# Support Information for 353 Known Cars +# Support Information for 350 Known Cars |Make|Model|Package|Support Level| |---|---|---|:---:| @@ -73,8 +73,6 @@ |Honda|Civic 2022-24|All|[Upstream](#upstream)| |Honda|Civic Hatchback 2017-21|Honda Sensing|[Upstream](#upstream)| |Honda|Civic Hatchback 2022-24|All|[Upstream](#upstream)| -|Honda|Civic Hatchback Hybrid 2023 (Europe only)|All|[Upstream](#upstream)| -|Honda|Civic Hatchback Hybrid 2025|All|[Upstream](#upstream)| |Honda|Clarity 2018-21|All|[Community](#community)| |Honda|CR-V 2015-16|Touring Trim|[Upstream](#upstream)| |Honda|CR-V 2017-22|Honda Sensing|[Upstream](#upstream)| @@ -92,7 +90,6 @@ |Honda|Odyssey 2021-25|All|[Community](#community)| |Honda|Passport 2019-25|All|[Upstream](#upstream)| |Honda|Pilot 2016-22|Honda Sensing|[Upstream](#upstream)| -|Honda|Pilot 2023|All|[Dashcam mode](#dashcam)| |Honda|Pilot 2023-24|All|[Community](#community)| |Honda|Ridgeline 2017-25|Honda Sensing|[Upstream](#upstream)| |Hyundai|Azera 2022|All|[Upstream](#upstream)| diff --git a/opendbc/car/body/interface.py b/opendbc/car/body/interface.py index 7c988c899c8..007f679362f 100644 --- a/opendbc/car/body/interface.py +++ b/opendbc/car/body/interface.py @@ -11,7 +11,7 @@ class CarInterface(CarInterfaceBase): CarController = CarController @staticmethod - def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, alpha_long, docs) -> structs.CarParams: + def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experimental_long, docs) -> structs.CarParams: ret.notCar = True ret.brand = "body" ret.safetyConfigs = [get_safety_config(structs.CarParams.SafetyModel.body)] diff --git a/opendbc/car/car.capnp b/opendbc/car/car.capnp index 7967add76d1..5c5a7d68a3d 100644 --- a/opendbc/car/car.capnp +++ b/opendbc/car/car.capnp @@ -466,7 +466,7 @@ struct CarParams { enableDsu @5 :Bool; # driving support unit enableBsm @56 :Bool; # blind spot monitoring flags @64 :UInt32; # flags for car specific quirks - alphaLongitudinalAvailable @71 :Bool; + experimentalLongitudinalAvailable @71 :Bool; minEnableSpeed @7 :Float32; minSteerSpeed @8 :Float32; diff --git a/opendbc/car/car_helpers.py b/opendbc/car/car_helpers.py index c33a99489b6..64318bfbc67 100644 --- a/opendbc/car/car_helpers.py +++ b/opendbc/car/car_helpers.py @@ -148,7 +148,7 @@ def fingerprint(can_recv: CanRecvCallable, can_send: CanSendCallable, set_obd_mu return car_fingerprint, finger, vin, car_fw, source, exact_match -def get_car(can_recv: CanRecvCallable, can_send: CanSendCallable, set_obd_multiplexing: ObdCallback, alpha_long_allowed: bool, +def get_car(can_recv: CanRecvCallable, can_send: CanSendCallable, set_obd_multiplexing: ObdCallback, experimental_long_allowed: bool, num_pandas: int = 1, cached_params: CarParamsT | None = None): candidate, fingerprints, vin, car_fw, source, exact_match = fingerprint(can_recv, can_send, set_obd_multiplexing, num_pandas, cached_params) @@ -157,7 +157,7 @@ def get_car(can_recv: CanRecvCallable, can_send: CanSendCallable, set_obd_multip candidate = "MOCK" CarInterface = interfaces[candidate] - CP: CarParams = CarInterface.get_params(candidate, fingerprints, car_fw, alpha_long_allowed, docs=False) + CP: CarParams = CarInterface.get_params(candidate, fingerprints, car_fw, experimental_long_allowed, docs=False) CP.carVin = vin CP.carFw = car_fw CP.fingerprintSource = source diff --git a/opendbc/car/chrysler/interface.py b/opendbc/car/chrysler/interface.py index 03246bed256..065953a8873 100755 --- a/opendbc/car/chrysler/interface.py +++ b/opendbc/car/chrysler/interface.py @@ -13,7 +13,7 @@ class CarInterface(CarInterfaceBase): RadarInterface = RadarInterface @staticmethod - def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, alpha_long, docs) -> structs.CarParams: + def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experimental_long, docs) -> structs.CarParams: ret.brand = "chrysler" ret.dashcamOnly = candidate in RAM_HD diff --git a/opendbc/car/docs.py b/opendbc/car/docs.py index cdaa16a2dec..51f071b26a4 100755 --- a/opendbc/car/docs.py +++ b/opendbc/car/docs.py @@ -32,7 +32,7 @@ def get_params_for_docs(platform) -> CarParams: cp_platform = platform if platform in interfaces else MOCK.MOCK CP: CarParams = interfaces[cp_platform].get_params(cp_platform, fingerprint=gen_empty_fingerprint(), car_fw=[CarParams.CarFw(ecu=CarParams.Ecu.unknown)], - alpha_long=True, docs=True) + experimental_long=True, docs=True) return CP diff --git a/opendbc/car/docs_definitions.py b/opendbc/car/docs_definitions.py index f6eb71041a1..2909fd659e8 100644 --- a/opendbc/car/docs_definitions.py +++ b/opendbc/car/docs_definitions.py @@ -285,7 +285,7 @@ def init(self, CP: CarParams, all_footnotes=None): # longitudinal column op_long = "Stock" - if CP.alphaLongitudinalAvailable or CP.enableDsu: + if CP.experimentalLongitudinalAvailable or CP.enableDsu: op_long = "openpilot available" if CP.enableDsu: self.footnotes.append(CommonFootnote.EXP_LONG_DSU) @@ -383,7 +383,7 @@ def get_detail_sentence(self, CP): # experimental mode exp_link = "Experimental mode" - if CP.openpilotLongitudinalControl and not CP.alphaLongitudinalAvailable: + if CP.openpilotLongitudinalControl and not CP.experimentalLongitudinalAvailable: sentence_builder += f" Traffic light and stop sign handling is also available in {exp_link}." return sentence_builder.format(car_model=f"{self.make} {self.model}", alc=alc, acc=acc) diff --git a/opendbc/car/ford/fingerprints.py b/opendbc/car/ford/fingerprints.py index 567881d5578..1a916b8f141 100644 --- a/opendbc/car/ford/fingerprints.py +++ b/opendbc/car/ford/fingerprints.py @@ -80,7 +80,6 @@ b'ML3V-14D003-BC\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', ], (Ecu.abs, 0x760, None): [ - b'NL34-2D053-CA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', b'PL34-2D053-CA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', b'PL34-2D053-CC\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', b'PL3V-2D053-BB\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', @@ -90,7 +89,6 @@ ], (Ecu.fwdCamera, 0x706, None): [ b'ML3T-14H102-ABR\x00\x00\x00\x00\x00\x00\x00\x00\x00', - b'ML3T-14H102-ABT\x00\x00\x00\x00\x00\x00\x00\x00\x00', b'PJ6T-14H102-ABJ\x00\x00\x00\x00\x00\x00\x00\x00\x00', b'RJ6T-14H102-ACJ\x00\x00\x00\x00\x00\x00\x00\x00\x00', ], diff --git a/opendbc/car/ford/interface.py b/opendbc/car/ford/interface.py index ff5a0a6ee24..6f08c10acb0 100644 --- a/opendbc/car/ford/interface.py +++ b/opendbc/car/ford/interface.py @@ -26,7 +26,7 @@ def get_pid_accel_limits(CP, current_speed, cruise_speed): return CarControllerParams.ACCEL_MIN, np.interp(current_speed, ACCEL_MAX_BP, ACCEL_MAX_VALS) @staticmethod - def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, alpha_long, docs) -> structs.CarParams: + def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experimental_long, docs) -> structs.CarParams: ret.brand = "ford" ret.radarUnavailable = Bus.radar not in DBC[candidate] @@ -49,8 +49,8 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, alpha_lo cfgs.insert(0, get_safety_config(structs.CarParams.SafetyModel.noOutput)) ret.safetyConfigs = cfgs - ret.alphaLongitudinalAvailable = ret.radarUnavailable - if alpha_long or not ret.radarUnavailable: + ret.experimentalLongitudinalAvailable = ret.radarUnavailable + if experimental_long or not ret.radarUnavailable: ret.safetyConfigs[-1].safetyParam |= FordSafetyFlags.LONG_CONTROL.value ret.openpilotLongitudinalControl = True diff --git a/opendbc/car/gm/interface.py b/opendbc/car/gm/interface.py index a0b3a6bdb1e..2f8c0979c3b 100755 --- a/opendbc/car/gm/interface.py +++ b/opendbc/car/gm/interface.py @@ -85,7 +85,7 @@ def torque_from_lateral_accel(self) -> TorqueFromLateralAccelCallbackType: return self.torque_from_lateral_accel_linear @staticmethod - def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, alpha_long, docs) -> structs.CarParams: + def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experimental_long, docs) -> structs.CarParams: ret.brand = "gm" ret.safetyConfigs = [get_safety_config(structs.CarParams.SafetyModel.gm)] ret.autoResumeSng = False @@ -100,7 +100,7 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, alpha_lo ret.longitudinalTuning.kiBP = [5., 35.] if candidate in (CAMERA_ACC_CAR | SDGM_CAR): - ret.alphaLongitudinalAvailable = candidate not in SDGM_CAR + ret.experimentalLongitudinalAvailable = candidate not in SDGM_CAR ret.networkLocation = NetworkLocation.fwdCamera ret.radarUnavailable = True # no radar ret.pcmCruise = True @@ -114,13 +114,13 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, alpha_lo ret.vEgoStopping = 0.25 ret.vEgoStarting = 0.25 - if alpha_long: + if experimental_long: ret.pcmCruise = False ret.openpilotLongitudinalControl = True ret.safetyConfigs[0].safetyParam |= GMSafetyFlags.HW_CAM_LONG.value if candidate in ALT_ACCS: - ret.alphaLongitudinalAvailable = False + ret.experimentalLongitudinalAvailable = False ret.openpilotLongitudinalControl = False ret.minEnableSpeed = -1. # engage speed is decided by PCM diff --git a/opendbc/car/honda/carstate.py b/opendbc/car/honda/carstate.py index 7fb19b3b8f9..b70a9a394ba 100644 --- a/opendbc/car/honda/carstate.py +++ b/opendbc/car/honda/carstate.py @@ -6,7 +6,7 @@ from opendbc.car import Bus, create_button_events, structs from opendbc.car.common.conversions import Conversions as CV from opendbc.car.honda.hondacan import CanBus, get_cruise_speed_conversion -from opendbc.car.honda.values import CAR, DBC, STEER_THRESHOLD, HONDA_BOSCH, HONDA_BOSCH_CANFD, \ +from opendbc.car.honda.values import CAR, DBC, STEER_THRESHOLD, HONDA_BOSCH, \ HONDA_NIDEC_ALT_SCM_MESSAGES, HONDA_BOSCH_RADARLESS, \ HondaFlags, CruiseButtons, CruiseSettings, GearShifter from opendbc.car.interfaces import CarStateBase @@ -68,9 +68,13 @@ def get_can_messages(CP, gearbox_msg): else: messages.append(("CRUISE_PARAMS", 50)) - if CP.carFingerprint not in (CAR.HONDA_ACCORD, CAR.HONDA_CIVIC_BOSCH, CAR.HONDA_CIVIC_BOSCH_DIESEL, CAR.HONDA_CRV_HYBRID, CAR.HONDA_INSIGHT, - CAR.ACURA_RDX_3G, CAR.HONDA_E, CAR.HONDA_ODYSSEY_CHN, CAR.HONDA_FREED, CAR.HONDA_HRV, *HONDA_BOSCH_RADARLESS, - *HONDA_BOSCH_CANFD): + # TODO: clean this up + if CP.carFingerprint in (CAR.HONDA_ACCORD, CAR.HONDA_CIVIC_BOSCH, CAR.HONDA_CIVIC_BOSCH_DIESEL, CAR.HONDA_CRV_HYBRID, CAR.HONDA_INSIGHT, + CAR.ACURA_RDX_3G, CAR.HONDA_E, CAR.HONDA_CIVIC_2022, CAR.HONDA_HRV_3G): + pass + elif CP.carFingerprint in (CAR.HONDA_ODYSSEY_CHN, CAR.HONDA_FREED, CAR.HONDA_HRV): + pass + else: messages.append(("DOORS_STATUS", 3)) if CP.carFingerprint in HONDA_BOSCH_RADARLESS: @@ -88,8 +92,6 @@ def __init__(self, CP): self.gearbox_msg = "GEARBOX" if CP.carFingerprint == CAR.HONDA_ACCORD and CP.transmissionType == TransmissionType.cvt: self.gearbox_msg = "GEARBOX_15T" - elif CP.carFingerprint == CAR.HONDA_CIVIC_2022 and CP.transmissionType == TransmissionType.cvt: - self.gearbox_msg = "GEARBOX_ALT" elif CP.transmissionType == TransmissionType.manual: self.gearbox_msg = "GEARBOX_ALT_2" @@ -137,7 +139,7 @@ def update(self, can_parsers) -> structs.CarState: ret.standstill = cp.vl["ENGINE_DATA"]["XMISSION_SPEED"] < 1e-5 # TODO: find a common signal across all cars if self.CP.carFingerprint in (CAR.HONDA_ACCORD, CAR.HONDA_CIVIC_BOSCH, CAR.HONDA_CIVIC_BOSCH_DIESEL, CAR.HONDA_CRV_HYBRID, CAR.HONDA_INSIGHT, - CAR.ACURA_RDX_3G, CAR.HONDA_E, *HONDA_BOSCH_RADARLESS, *HONDA_BOSCH_CANFD): + CAR.ACURA_RDX_3G, CAR.HONDA_E, CAR.HONDA_CIVIC_2022, CAR.HONDA_HRV_3G): ret.doorOpen = bool(cp.vl["SCM_FEEDBACK"]["DRIVERS_DOOR_OPEN"]) elif self.CP.carFingerprint in (CAR.HONDA_ODYSSEY_CHN, CAR.HONDA_FREED, CAR.HONDA_HRV): ret.doorOpen = bool(cp.vl["SCM_BUTTONS"]["DRIVERS_DOOR_OPEN"]) diff --git a/opendbc/car/honda/fingerprints.py b/opendbc/car/honda/fingerprints.py index 307977615a3..83a085bea01 100644 --- a/opendbc/car/honda/fingerprints.py +++ b/opendbc/car/honda/fingerprints.py @@ -867,8 +867,6 @@ b'39990-T39-A130\x00\x00', b'39990-T43-J020\x00\x00', b'39990-T60-J030\x00\x00', - b'39990-T56-A040\x00\x00', - b'39990-T50-J030\x00\x00', ], (Ecu.gateway, 0x18daeff1, None): [ b'38897-T20-A020\x00\x00', @@ -879,8 +877,6 @@ b'38897-T22-A110\x00\x00', b'38897-T24-Z120\x00\x00', b'38897-T60-A110\x00\x00', - b'38897-T61-A320\x00\x00', - b'38897-T50-E310\x00\x00', ], (Ecu.srs, 0x18da53f1, None): [ b'77959-T20-A970\x00\x00', @@ -890,9 +886,6 @@ b'77959-T47-A940\x00\x00', b'77959-T47-A950\x00\x00', b'77959-T60-A920\x00\x00', - b'77959-T61-A920\x00\x00', - b'77959-T50-G930\x00\x00', - b'77959-T65-A920\x00\x00', ], (Ecu.fwdRadar, 0x18dab0f1, None): [ b'36161-T20-A060\x00\x00', @@ -905,9 +898,6 @@ b'8S102-T20-AA10\x00\x00', b'8S102-T47-AA10\x00\x00', b'8S102-T60-AA10\x00\x00', - b'8S102-T56-A060\x00\x00', - b'8S102-T50-EA10\x00\x00', - b'8S102-T64-A040\x00\x00', ], (Ecu.vsa, 0x18da28f1, None): [ b'57114-T20-AB40\x00\x00', @@ -915,8 +905,6 @@ b'57114-T38-AA20\x00\x00', b'57114-T43-JB30\x00\x00', b'57114-T60-AA20\x00\x00', - b'57114-T61-AJ30\x00\x00', - b'57114-T50-JC20\x00\x00', ], (Ecu.transmission, 0x18da1ef1, None): [ b'28101-65D-A020\x00\x00', @@ -926,12 +914,4 @@ b'28101-65J-N010\x00\x00', ], }, - CAR.HONDA_PILOT_4G: { - (Ecu.fwdCamera, 0x18dab5f1, None): [ - b'8S102-T90-A050\x00\x00', - ], - (Ecu.fwdRadar, 0x18dab0f1, None): [ - b'8S302-T90-A040\x00\x00', - ], - }, } diff --git a/opendbc/car/honda/hondacan.py b/opendbc/car/honda/hondacan.py index ec2c5d25ae0..878bdcb62bd 100644 --- a/opendbc/car/honda/hondacan.py +++ b/opendbc/car/honda/hondacan.py @@ -1,6 +1,6 @@ from opendbc.car import CanBusBase from opendbc.car.common.conversions import Conversions as CV -from opendbc.car.honda.values import HondaFlags, HONDA_BOSCH, HONDA_BOSCH_RADARLESS, HONDA_BOSCH_CANFD, CAR, CarControllerParams +from opendbc.car.honda.values import HondaFlags, HONDA_BOSCH, HONDA_BOSCH_RADARLESS, CAR, CarControllerParams # CAN bus layout with relay # 0 = ACC-CAN - radar side @@ -14,8 +14,7 @@ def __init__(self, CP=None, fingerprint=None) -> None: # use fingerprint if specified super().__init__(CP if fingerprint is None else None, fingerprint) - # powertrain bus is split instead of radar on radarless and CAN FD Bosch - if CP.carFingerprint in (HONDA_BOSCH - HONDA_BOSCH_RADARLESS - HONDA_BOSCH_CANFD): + if CP.carFingerprint in (HONDA_BOSCH - HONDA_BOSCH_RADARLESS): self._pt, self._radar = self.offset + 1, self.offset # normally steering commands are sent to radar, which forwards them to powertrain bus # when radar is disabled, steering commands are sent directly to powertrain bus @@ -47,7 +46,7 @@ def body(self) -> int: def get_cruise_speed_conversion(car_fingerprint: str, is_metric: bool) -> float: # on certain cars, CRUISE_SPEED changes to imperial with car's unit setting - return CV.MPH_TO_MS if car_fingerprint in (HONDA_BOSCH_RADARLESS | HONDA_BOSCH_CANFD) and not is_metric else CV.KPH_TO_MS + return CV.MPH_TO_MS if car_fingerprint in HONDA_BOSCH_RADARLESS and not is_metric else CV.KPH_TO_MS def create_brake_command(packer, CAN, apply_brake, pump_on, pcm_override, pcm_cancel_cmd, fcw, car_fingerprint, stock_brake): @@ -174,14 +173,11 @@ def create_ui_commands(packer, CAN, CP, enabled, pcm_speed, hud, is_metric, acc_ 'BEEP': 0, } - if CP.carFingerprint in (HONDA_BOSCH_RADARLESS | HONDA_BOSCH_CANFD): + if CP.carFingerprint in HONDA_BOSCH_RADARLESS: lkas_hud_values['LANE_LINES'] = 3 lkas_hud_values['DASHED_LANES'] = hud.lanes_visible - # car likely needs to see LKAS_PROBLEM fall within a specific time frame, so forward from camera - # TODO: needed for Bosch CAN FD? - if CP.carFingerprint in HONDA_BOSCH_RADARLESS: - lkas_hud_values['LKAS_PROBLEM'] = lkas_hud['LKAS_PROBLEM'] + lkas_hud_values['LKAS_PROBLEM'] = lkas_hud['LKAS_PROBLEM'] if not (CP.flags & HondaFlags.BOSCH_EXT_HUD): lkas_hud_values['SET_ME_X48'] = 0x48 @@ -210,6 +206,6 @@ def spam_buttons_command(packer, CAN, button_val, car_fingerprint): 'CRUISE_BUTTONS': button_val, 'CRUISE_SETTING': 0, } - # send buttons to camera on radarless (camera does ACC) cars + # send buttons to camera on radarless cars bus = CAN.camera if car_fingerprint in HONDA_BOSCH_RADARLESS else CAN.pt return packer.make_can_msg("SCM_BUTTONS", bus, values) diff --git a/opendbc/car/honda/interface.py b/opendbc/car/honda/interface.py index d92bcc24d52..e1943e03e1d 100755 --- a/opendbc/car/honda/interface.py +++ b/opendbc/car/honda/interface.py @@ -4,7 +4,7 @@ from opendbc.car.common.conversions import Conversions as CV from opendbc.car.disable_ecu import disable_ecu from opendbc.car.honda.hondacan import CanBus -from opendbc.car.honda.values import CarControllerParams, HondaFlags, CAR, HONDA_BOSCH, HONDA_BOSCH_CANFD, \ +from opendbc.car.honda.values import CarControllerParams, HondaFlags, CAR, HONDA_BOSCH, \ HONDA_NIDEC_ALT_SCM_MESSAGES, HONDA_BOSCH_RADARLESS, HondaSafetyFlags from opendbc.car.honda.carcontroller import CarController from opendbc.car.honda.carstate import CarState @@ -31,27 +31,19 @@ def get_pid_accel_limits(CP, current_speed, cruise_speed): return CarControllerParams.NIDEC_ACCEL_MIN, np.interp(current_speed, ACCEL_MAX_BP, ACCEL_MAX_VALS) @staticmethod - def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, alpha_long, docs) -> structs.CarParams: + def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experimental_long, docs) -> structs.CarParams: ret.brand = "honda" CAN = CanBus(ret, fingerprint) - # Recent test route is needed to undashcam these cars - ret.dashcamOnly = candidate in HONDA_BOSCH_CANFD - if candidate in HONDA_BOSCH: - cfgs = [get_safety_config(structs.CarParams.SafetyModel.hondaBosch)] - if candidate in HONDA_BOSCH_CANFD and CAN.pt >= 4: - cfgs.insert(0, get_safety_config(structs.CarParams.SafetyModel.noOutput)) - ret.safetyConfigs = cfgs - + ret.safetyConfigs = [get_safety_config(structs.CarParams.SafetyModel.hondaBosch)] ret.radarUnavailable = True # Disable the radar and let openpilot control longitudinal # WARNING: THIS DISABLES AEB! # If Bosch radarless, this blocks ACC messages from the camera - # TODO: get radar disable working on Bosch CANFD - ret.alphaLongitudinalAvailable = candidate not in HONDA_BOSCH_CANFD - ret.openpilotLongitudinalControl = alpha_long + ret.experimentalLongitudinalAvailable = True + ret.openpilotLongitudinalControl = experimental_long ret.pcmCruise = not ret.openpilotLongitudinalControl else: ret.safetyConfigs = [get_safety_config(structs.CarParams.SafetyModel.hondaNidec)] @@ -69,12 +61,9 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, alpha_lo # Accord ICE 1.5T CVT has different gearbox message if candidate == CAR.HONDA_ACCORD and 0x191 in fingerprint[CAN.pt]: ret.transmissionType = TransmissionType.cvt - # Civic Type R is missing 0x191 and 0x1A3 - elif candidate == CAR.HONDA_CIVIC_2022 and all(msg not in fingerprint[CAN.pt] for msg in (0x191, 0x1A3)): + # New Civics can have manual transmission + elif candidate == CAR.HONDA_CIVIC_2022 and 0x191 not in fingerprint[CAN.pt]: ret.transmissionType = TransmissionType.manual - # New Civics dont have 0x191, but do have 0x1A3 - elif candidate == CAR.HONDA_CIVIC_2022 and 0x1A3 in fingerprint[CAN.pt]: - ret.transmissionType = TransmissionType.cvt # Certain Hondas have an extra steering sensor at the bottom of the steering rack, # which improves controls quality as it removes the steering column torsion from feedback. @@ -181,7 +170,7 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, alpha_lo else: ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 4096], [0, 4096]] # TODO: determine if there is a dead zone at the top end - elif candidate in (CAR.HONDA_PILOT, CAR.HONDA_PILOT_4G): + elif candidate == CAR.HONDA_PILOT: ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 4096], [0, 4096]] # TODO: determine if there is a dead zone at the top end ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.38], [0.11]] @@ -206,17 +195,17 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, alpha_lo ret.flags |= HondaFlags.BOSCH_ALT_BRAKE.value if ret.flags & HondaFlags.BOSCH_ALT_BRAKE: - ret.safetyConfigs[-1].safetyParam |= HondaSafetyFlags.ALT_BRAKE.value + ret.safetyConfigs[0].safetyParam |= HondaSafetyFlags.ALT_BRAKE.value # These cars use alternate SCM messages (SCM_FEEDBACK AND SCM_BUTTON) if candidate in HONDA_NIDEC_ALT_SCM_MESSAGES: - ret.safetyConfigs[-1].safetyParam |= HondaSafetyFlags.NIDEC_ALT.value + ret.safetyConfigs[0].safetyParam |= HondaSafetyFlags.NIDEC_ALT.value if ret.openpilotLongitudinalControl and candidate in HONDA_BOSCH: - ret.safetyConfigs[-1].safetyParam |= HondaSafetyFlags.BOSCH_LONG.value + ret.safetyConfigs[0].safetyParam |= HondaSafetyFlags.BOSCH_LONG.value if candidate in HONDA_BOSCH_RADARLESS: - ret.safetyConfigs[-1].safetyParam |= HondaSafetyFlags.RADARLESS.value + ret.safetyConfigs[0].safetyParam |= HondaSafetyFlags.RADARLESS.value # min speed to enable ACC. if car can do stop and go, then set enabling speed # to a negative value, so it won't matter. Otherwise, add 0.5 mph margin to not diff --git a/opendbc/car/honda/values.py b/opendbc/car/honda/values.py index 592a4c76339..04ffb3f8ba1 100644 --- a/opendbc/car/honda/values.py +++ b/opendbc/car/honda/values.py @@ -3,7 +3,7 @@ from opendbc.car import Bus, CarSpecs, PlatformConfig, Platforms, structs, uds from opendbc.car.common.conversions import Conversions as CV -from opendbc.car.docs_definitions import CarFootnote, CarHarness, CarDocs, CarParts, Column, Device +from opendbc.car.docs_definitions import CarFootnote, CarHarness, CarDocs, CarParts, Column from opendbc.car.fw_query_definitions import FwQueryConfig, Request, StdQueries, p16 Ecu = structs.CarParams.Ecu @@ -68,7 +68,6 @@ class HondaFlags(IntFlag): NIDEC_ALT_PCM_ACCEL = 32 NIDEC_ALT_SCM_MESSAGES = 64 - BOSCH_CANFD = 128 # Car button codes class CruiseButtons: @@ -102,19 +101,9 @@ class HondaCarDocs(CarDocs): def init_make(self, CP: structs.CarParams): if CP.flags & HondaFlags.BOSCH: - if CP.flags & HondaFlags.BOSCH_CANFD: - harness = CarHarness.bosch_c - elif CP.flags & HondaFlags.BOSCH_RADARLESS: - harness = CarHarness.bosch_b - else: - harness = CarHarness.bosch_a + self.car_parts = CarParts.common([CarHarness.bosch_b]) if CP.flags & HondaFlags.BOSCH_RADARLESS else CarParts.common([CarHarness.bosch_a]) else: - harness = CarHarness.nidec - - if CP.carFingerprint in (CAR.HONDA_PILOT_4G,): - self.car_parts = CarParts([Device.threex_angled_mount, harness]) - else: - self.car_parts = CarParts.common([harness]) + self.car_parts = CarParts.common([CarHarness.nidec]) class Footnote(Enum): @@ -167,9 +156,6 @@ class CAR(Platforms): [ HondaCarDocs("Honda Civic 2022-24", "All", video_link="https://youtu.be/ytiOT5lcp6Q"), HondaCarDocs("Honda Civic Hatchback 2022-24", "All", video_link="https://youtu.be/ytiOT5lcp6Q"), - HondaCarDocs("Honda Civic Hatchback Hybrid 2023 (Europe only)", "All"), - # TODO: Confirm 2024 - HondaCarDocs("Honda Civic Hatchback Hybrid 2025", "All"), ], HONDA_CIVIC_BOSCH.specs, {Bus.pt: 'honda_civic_ex_2022_can_generated'}, @@ -210,12 +196,6 @@ class CAR(Platforms): CarSpecs(mass=3338.8 * CV.LB_TO_KG, wheelbase=2.5, centerToFrontRatio=0.5, steerRatio=16.71, tireStiffnessFactor=0.82), {Bus.pt: 'acura_rdx_2020_can_generated'}, ) - HONDA_PILOT_4G = HondaBoschPlatformConfig( - [HondaCarDocs("Honda Pilot 2023", "All")], - CarSpecs(mass=4278 * CV.LB_TO_KG, wheelbase=2.86, centerToFrontRatio=0.428, steerRatio=16.0, tireStiffnessFactor=0.444), # as spec - {Bus.pt: 'honda_pilot_2023_can_generated'}, - flags=HondaFlags.BOSCH_CANFD | HondaFlags.BOSCH_ALT_BRAKE, - ) # Nidec Cars ACURA_ILX = HondaNidecPlatformConfig( @@ -277,7 +257,7 @@ class CAR(Platforms): HondaCarDocs("Honda Pilot 2016-22", min_steer_speed=12. * CV.MPH_TO_MS), HondaCarDocs("Honda Passport 2019-25", "All", min_steer_speed=12. * CV.MPH_TO_MS), ], - HONDA_PILOT_4G.specs, + CarSpecs(mass=4278 * CV.LB_TO_KG, wheelbase=2.86, centerToFrontRatio=0.428, steerRatio=16.0, tireStiffnessFactor=0.444), # as spec radar_dbc_dict('acura_ilx_2016_can_generated'), flags=HondaFlags.NIDEC_ALT_SCM_MESSAGES, ) @@ -359,7 +339,6 @@ class CAR(Platforms): HONDA_NIDEC_ALT_SCM_MESSAGES = CAR.with_flags(HondaFlags.NIDEC_ALT_SCM_MESSAGES) HONDA_BOSCH = CAR.with_flags(HondaFlags.BOSCH) HONDA_BOSCH_RADARLESS = CAR.with_flags(HondaFlags.BOSCH_RADARLESS) -HONDA_BOSCH_CANFD = CAR.with_flags(HondaFlags.BOSCH_CANFD) DBC = CAR.create_dbc_map() diff --git a/opendbc/car/hyundai/fingerprints.py b/opendbc/car/hyundai/fingerprints.py index 4e4f8aadb65..40baad577d2 100644 --- a/opendbc/car/hyundai/fingerprints.py +++ b/opendbc/car/hyundai/fingerprints.py @@ -288,14 +288,12 @@ b'\xf1\x00TM ESC \x04 102!\x04\x05 58910-S2GA0', b'\xf1\x00TM ESC \x04 103"\x07\x08 58910-S2GA0', b'\xf1\x00TM ESC \x1e 102 \x08\x08 58910-S1DA0', - b'\xf1\x00TM ESC \x1b 102 \x08\x08 58910-S1DA0', b'\xf1\x00TM ESC 103!\x030 58910-S1MA0', ], (Ecu.eps, 0x7d4, None): [ b'\xf1\x00TM MDPS C 1.00 1.01 56310-S1AB0 4TSDC101', b'\xf1\x00TM MDPS C 1.00 1.01 56310-S1EB0 4TSDC101', b'\xf1\x00TM MDPS C 1.00 1.02 56370-S2AA0 0B19', - b'\xf1\x00TM MDPS R 1.00 1.05 57700-S1500 4TSDP105', ], (Ecu.fwdCamera, 0x7c4, None): [ b'\xf1\x00TM MFC AT EUR LHD 1.00 1.03 99211-S1500 210224', diff --git a/opendbc/car/hyundai/interface.py b/opendbc/car/hyundai/interface.py index 6b388c0a09a..867d8144c7e 100644 --- a/opendbc/car/hyundai/interface.py +++ b/opendbc/car/hyundai/interface.py @@ -23,7 +23,7 @@ class CarInterface(CarInterfaceBase): RadarInterface = RadarInterface @staticmethod - def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, alpha_long, docs) -> structs.CarParams: + def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experimental_long, docs) -> structs.CarParams: ret.brand = "hyundai" cam_can = CanBus(None, fingerprint).CAM @@ -32,10 +32,10 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, alpha_lo if ret.flags & HyundaiFlags.CANFD: # Shared configuration for CAN-FD cars - ret.alphaLongitudinalAvailable = candidate not in CANFD_UNSUPPORTED_LONGITUDINAL_CAR + ret.experimentalLongitudinalAvailable = candidate not in CANFD_UNSUPPORTED_LONGITUDINAL_CAR if lka_steering and Ecu.adas not in [fw.ecu for fw in car_fw]: # this needs to be figured out for cars without an ADAS ECU - ret.alphaLongitudinalAvailable = False + ret.experimentalLongitudinalAvailable = False ret.enableBsm = 0x1e5 in fingerprint[CAN.ECAN] @@ -81,7 +81,7 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, alpha_lo else: # Shared configuration for non CAN-FD cars - ret.alphaLongitudinalAvailable = candidate not in UNSUPPORTED_LONGITUDINAL_CAR + ret.experimentalLongitudinalAvailable = candidate not in UNSUPPORTED_LONGITUDINAL_CAR ret.enableBsm = 0x58b in fingerprint[0] # Send LFA message on cars with HDA @@ -125,7 +125,7 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, alpha_lo RADAR_START_ADDR = RADAR_START_ADDR_CANFD if ret.flags & HyundaiFlags.CANFD else RADAR_START_ADDR_CAN ret.radarUnavailable = RADAR_START_ADDR not in fingerprint[1] or Bus.radar not in DBC[ret.carFingerprint] - ret.openpilotLongitudinalControl = alpha_long and ret.alphaLongitudinalAvailable + ret.openpilotLongitudinalControl = experimental_long and ret.experimentalLongitudinalAvailable ret.pcmCruise = not ret.openpilotLongitudinalControl ret.startingState = True ret.vEgoStarting = 0.1 diff --git a/opendbc/car/hyundai/values.py b/opendbc/car/hyundai/values.py index 66b9bce9207..bf4d43ed556 100644 --- a/opendbc/car/hyundai/values.py +++ b/opendbc/car/hyundai/values.py @@ -258,7 +258,7 @@ class CAR(Platforms): HYUNDAI_KONA_2022 = HyundaiPlatformConfig( [HyundaiCarDocs("Hyundai Kona 2022", car_parts=CarParts.common([CarHarness.hyundai_o]))], CarSpecs(mass=1491, wheelbase=2.6, steerRatio=13.42, tireStiffnessFactor=0.385), - flags=HyundaiFlags.CAMERA_SCC | HyundaiFlags.ALT_LIMITS_2, + flags=HyundaiFlags.CAMERA_SCC, ) HYUNDAI_KONA_2ND_GEN = HyundaiCanFDPlatformConfig( [HyundaiCarDocs("Hyundai Kona 2024-25", car_parts=CarParts.common([CarHarness.hyundai_l]))], diff --git a/opendbc/car/interfaces.py b/opendbc/car/interfaces.py index f8daef75be8..84509490e5a 100644 --- a/opendbc/car/interfaces.py +++ b/opendbc/car/interfaces.py @@ -135,7 +135,7 @@ def get_non_essential_params(cls, candidate: str) -> structs.CarParams: @classmethod def get_params(cls, candidate: str, fingerprint: dict[int, dict[int, int]], car_fw: list[structs.CarParams.CarFw], - alpha_long: bool, docs: bool) -> structs.CarParams: + experimental_long: bool, docs: bool) -> structs.CarParams: ret = CarInterfaceBase.get_std_params(candidate) platform = PLATFORMS[candidate] @@ -148,7 +148,7 @@ def get_params(cls, candidate: str, fingerprint: dict[int, dict[int, int]], car_ ret.tireStiffnessFactor = platform.config.specs.tireStiffnessFactor ret.flags |= int(platform.config.flags) - ret = cls._get_params(ret, candidate, fingerprint, car_fw, alpha_long, docs) + ret = cls._get_params(ret, candidate, fingerprint, car_fw, experimental_long, docs) # Vehicle mass is published curb weight plus assumed payload such as a human driver; notCars have no assumed payload if not ret.notCar: @@ -163,7 +163,7 @@ def get_params(cls, candidate: str, fingerprint: dict[int, dict[int, int]], car_ @staticmethod @abstractmethod def _get_params(ret: structs.CarParams, candidate, fingerprint: dict[int, dict[int, int]], - car_fw: list[structs.CarParams.CarFw], alpha_long: bool, docs: bool) -> structs.CarParams: + car_fw: list[structs.CarParams.CarFw], experimental_long: bool, docs: bool) -> structs.CarParams: raise NotImplementedError @staticmethod diff --git a/opendbc/car/mazda/interface.py b/opendbc/car/mazda/interface.py index ff2869ccfbb..72fcd84475c 100755 --- a/opendbc/car/mazda/interface.py +++ b/opendbc/car/mazda/interface.py @@ -12,7 +12,7 @@ class CarInterface(CarInterfaceBase): CarController = CarController @staticmethod - def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, alpha_long, docs) -> structs.CarParams: + def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experimental_long, docs) -> structs.CarParams: ret.brand = "mazda" ret.safetyConfigs = [get_safety_config(structs.CarParams.SafetyModel.mazda)] ret.radarUnavailable = True diff --git a/opendbc/car/mock/interface.py b/opendbc/car/mock/interface.py index 0a58f6ed281..d825e54e1b5 100755 --- a/opendbc/car/mock/interface.py +++ b/opendbc/car/mock/interface.py @@ -11,7 +11,7 @@ class CarInterface(CarInterfaceBase): CarController = CarController @staticmethod - def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, alpha_long, docs) -> structs.CarParams: + def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experimental_long, docs) -> structs.CarParams: ret.brand = "mock" ret.mass = 1700. ret.wheelbase = 2.70 diff --git a/opendbc/car/nissan/interface.py b/opendbc/car/nissan/interface.py index 6216291673b..6f2eb021a42 100644 --- a/opendbc/car/nissan/interface.py +++ b/opendbc/car/nissan/interface.py @@ -10,7 +10,7 @@ class CarInterface(CarInterfaceBase): CarController = CarController @staticmethod - def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, alpha_long, docs) -> structs.CarParams: + def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experimental_long, docs) -> structs.CarParams: ret.brand = "nissan" ret.safetyConfigs = [get_safety_config(structs.CarParams.SafetyModel.nissan)] ret.autoResumeSng = False diff --git a/opendbc/car/rivian/interface.py b/opendbc/car/rivian/interface.py index 07b69ce0aef..509889b51bc 100644 --- a/opendbc/car/rivian/interface.py +++ b/opendbc/car/rivian/interface.py @@ -12,7 +12,7 @@ class CarInterface(CarInterfaceBase): RadarInterface = RadarInterface @staticmethod - def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, alpha_long, docs) -> structs.CarParams: + def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experimental_long, docs) -> structs.CarParams: ret.brand = "rivian" ret.safetyConfigs = [get_safety_config(structs.CarParams.SafetyModel.rivian)] @@ -25,8 +25,8 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, alpha_lo ret.radarUnavailable = True # TODO: pending finding/handling missing set speed and fixing up radar parser - ret.alphaLongitudinalAvailable = False - if alpha_long: + ret.experimentalLongitudinalAvailable = False + if experimental_long: ret.openpilotLongitudinalControl = True ret.safetyConfigs[0].safetyParam |= RivianSafetyFlags.LONG_CONTROL.value diff --git a/opendbc/car/subaru/interface.py b/opendbc/car/subaru/interface.py index 6d940fde7a3..4fe4f2dd984 100644 --- a/opendbc/car/subaru/interface.py +++ b/opendbc/car/subaru/interface.py @@ -11,7 +11,7 @@ class CarInterface(CarInterfaceBase): CarController = CarController @staticmethod - def _get_params(ret: structs.CarParams, candidate: CAR, fingerprint, car_fw, alpha_long, docs) -> structs.CarParams: + def _get_params(ret: structs.CarParams, candidate: CAR, fingerprint, car_fw, experimental_long, docs) -> structs.CarParams: ret.brand = "subaru" ret.radarUnavailable = True # for HYBRID CARS to be upstreamed, we need: @@ -86,9 +86,9 @@ def _get_params(ret: structs.CarParams, candidate: CAR, fingerprint, car_fw, alp else: raise ValueError(f"unknown car: {candidate}") - ret.alphaLongitudinalAvailable = not (ret.flags & (SubaruFlags.GLOBAL_GEN2 | SubaruFlags.PREGLOBAL | - SubaruFlags.LKAS_ANGLE | SubaruFlags.HYBRID)) - ret.openpilotLongitudinalControl = alpha_long and ret.alphaLongitudinalAvailable + ret.experimentalLongitudinalAvailable = not (ret.flags & (SubaruFlags.GLOBAL_GEN2 | SubaruFlags.PREGLOBAL | + SubaruFlags.LKAS_ANGLE | SubaruFlags.HYBRID)) + ret.openpilotLongitudinalControl = experimental_long and ret.experimentalLongitudinalAvailable if ret.flags & SubaruFlags.GLOBAL_GEN2 and ret.openpilotLongitudinalControl: ret.flags |= SubaruFlags.DISABLE_EYESIGHT.value diff --git a/opendbc/car/subaru/values.py b/opendbc/car/subaru/values.py index 066f9e8bc77..68171c5dd5b 100644 --- a/opendbc/car/subaru/values.py +++ b/opendbc/car/subaru/values.py @@ -103,7 +103,7 @@ class SubaruCarDocs(CarDocs): def init_make(self, CP: CarParams): self.car_parts.parts.extend([Tool.socket_8mm_deep, Tool.pry_tool]) - if CP.alphaLongitudinalAvailable: + if CP.experimentalLongitudinalAvailable: self.footnotes.append(Footnote.EXP_LONG) diff --git a/opendbc/car/tesla/interface.py b/opendbc/car/tesla/interface.py index ca4823281e9..1796bdba835 100644 --- a/opendbc/car/tesla/interface.py +++ b/opendbc/car/tesla/interface.py @@ -10,7 +10,7 @@ class CarInterface(CarInterfaceBase): CarController = CarController @staticmethod - def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, alpha_long, docs) -> structs.CarParams: + def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experimental_long, docs) -> structs.CarParams: ret.brand = "tesla" ret.safetyConfigs = [get_safety_config(structs.CarParams.SafetyModel.tesla)] @@ -22,8 +22,8 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, alpha_lo ret.steerControlType = structs.CarParams.SteerControlType.angle ret.radarUnavailable = True - ret.alphaLongitudinalAvailable = True - if alpha_long: + ret.experimentalLongitudinalAvailable = True + if experimental_long: ret.openpilotLongitudinalControl = True ret.safetyConfigs[0].safetyParam |= TeslaSafetyFlags.LONG_CONTROL.value diff --git a/opendbc/car/tesla/values.py b/opendbc/car/tesla/values.py index e094d152275..c771a9459ff 100644 --- a/opendbc/car/tesla/values.py +++ b/opendbc/car/tesla/values.py @@ -15,23 +15,19 @@ class Footnote(Enum): "See this page for more information.", Column.MODEL) - SETUP = CarFootnote( - "See more setup details for Tesla.", - Column.MAKE, setup_note=True) - @dataclass class TeslaCarDocsHW3(CarDocs): package: str = "All" car_parts: CarParts = field(default_factory=CarParts.common([CarHarness.tesla_a])) - footnotes: list[Enum] = field(default_factory=lambda: [Footnote.HW_TYPE, Footnote.SETUP]) + footnotes: list[Enum] = field(default_factory=lambda: [Footnote.HW_TYPE]) @dataclass class TeslaCarDocsHW4(CarDocs): package: str = "All" car_parts: CarParts = field(default_factory=CarParts.common([CarHarness.tesla_b])) - footnotes: list[Enum] = field(default_factory=lambda: [Footnote.HW_TYPE, Footnote.SETUP]) + footnotes: list[Enum] = field(default_factory=lambda: [Footnote.HW_TYPE]) @dataclass diff --git a/opendbc/car/tests/routes.py b/opendbc/car/tests/routes.py index 4b5c9c96751..f8522806073 100644 --- a/opendbc/car/tests/routes.py +++ b/opendbc/car/tests/routes.py @@ -106,9 +106,7 @@ class CarTestRoute(NamedTuple): CarTestRoute("54fd8451b3974762|2021-04-01--14-50-10", HONDA.HONDA_RIDGELINE), CarTestRoute("2d5808fae0b38ac6|2021-09-01--17-14-11", HONDA.HONDA_E), CarTestRoute("f44aa96ace22f34a|2021-12-22--06-22-31", HONDA.HONDA_CIVIC_2022), - CarTestRoute("1f032f5173c8ad99/00000006--573b3fcaf5", HONDA.HONDA_CIVIC_2022), # Civic Type R with manual transmission - CarTestRoute("b1c832ad56b6bc9d/00000010--debfcf5867", HONDA.HONDA_CIVIC_2022), # 2025 Civic Hatch Hybrid with new eCVT transmission - CarTestRoute("f9c43864cf057d05|2024-01-15--23-01-20", HONDA.HONDA_PILOT_4G), # TODO: Replace with a newer route + CarTestRoute("1f032f5173c8ad99/00000006--573b3fcaf5", HONDA.HONDA_CIVIC_2022), # Civic Type R with manual transmission CarTestRoute("87d7f06ade479c2e|2023-09-11--23-30-11", HYUNDAI.HYUNDAI_AZERA_6TH_GEN), CarTestRoute("66189dd8ec7b50e6|2023-09-20--07-02-12", HYUNDAI.HYUNDAI_AZERA_HEV_6TH_GEN), diff --git a/opendbc/car/tests/test_car_interfaces.py b/opendbc/car/tests/test_car_interfaces.py index f33deed6ed0..50f3b4df201 100644 --- a/opendbc/car/tests/test_car_interfaces.py +++ b/opendbc/car/tests/test_car_interfaces.py @@ -36,7 +36,7 @@ def get_fuzzy_car_interface_args(draw: DrawType) -> dict: params_strategy = st.fixed_dictionaries({ 'fingerprints': fingerprint_strategy, 'car_fw': car_fw_strategy, - 'alpha_long': st.booleans(), + 'experimental_long': st.booleans(), }) params: dict = draw(params_strategy) @@ -59,7 +59,7 @@ def test_car_interfaces(self, car_name, data): args = get_fuzzy_car_interface_args(data.draw) car_params = CarInterface.get_params(car_name, args['fingerprints'], args['car_fw'], - alpha_long=args['alpha_long'], docs=False) + experimental_long=args['experimental_long'], docs=False) car_interface = CarInterface(car_params) assert car_params assert car_interface diff --git a/opendbc/car/torque_data/override.toml b/opendbc/car/torque_data/override.toml index 266782e425b..df5be8ba41a 100644 --- a/opendbc/car/torque_data/override.toml +++ b/opendbc/car/torque_data/override.toml @@ -41,7 +41,7 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"] "CADILLAC_ESCALADE" = [1.899999976158142, 1.842270016670227, 0.1120000034570694] "CADILLAC_ESCALADE_ESV_2019" = [1.15, 1.3, 0.2] "CADILLAC_XT4" = [1.45, 1.6, 0.2] -"CHEVROLET_BOLT_EUV" = [1.0, 2.0, 0.175] +"CHEVROLET_BOLT_EUV" = [2.0, 2.0, 0.05] "CHEVROLET_SILVERADO" = [1.9, 1.9, 0.112] "CHEVROLET_TRAILBLAZER" = [1.33, 1.9, 0.16] "CHEVROLET_TRAVERSE" = [1.33, 1.33, 0.18] @@ -86,4 +86,3 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"] # Manually checked "HONDA_CIVIC_2022" = [2.5, 1.2, 0.15] "HONDA_HRV_3G" = [2.5, 1.2, 0.2] -"HONDA_PILOT_4G" = [1.0, 1.0, 0.2] diff --git a/opendbc/car/toyota/interface.py b/opendbc/car/toyota/interface.py index 21403aa90c9..1515ebd9d97 100644 --- a/opendbc/car/toyota/interface.py +++ b/opendbc/car/toyota/interface.py @@ -21,7 +21,7 @@ def get_pid_accel_limits(CP, current_speed, cruise_speed): return CarControllerParams(CP).ACCEL_MIN, CarControllerParams(CP).ACCEL_MAX @staticmethod - def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, alpha_long, docs) -> structs.CarParams: + def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experimental_long, docs) -> structs.CarParams: ret.brand = "toyota" ret.safetyConfigs = [get_safety_config(structs.CarParams.SafetyModel.toyota)] ret.safetyConfigs[0].safetyParam = EPS_SCALE[candidate] @@ -111,10 +111,10 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, alpha_lo # since we don't yet parse radar on TSS2/TSS-P radar-based ACC cars, gate longitudinal behind experimental toggle if candidate in (RADAR_ACC_CAR | NO_DSU_CAR): - ret.alphaLongitudinalAvailable = candidate in RADAR_ACC_CAR + ret.experimentalLongitudinalAvailable = candidate in RADAR_ACC_CAR # Disabling radar is only supported on TSS2 radar-ACC cars - if alpha_long and candidate in RADAR_ACC_CAR: + if experimental_long and candidate in RADAR_ACC_CAR: ret.flags |= ToyotaFlags.DISABLE_RADAR.value # openpilot longitudinal enabled by default: diff --git a/opendbc/car/volkswagen/interface.py b/opendbc/car/volkswagen/interface.py index 1a07ba1e1d8..70a67857c80 100644 --- a/opendbc/car/volkswagen/interface.py +++ b/opendbc/car/volkswagen/interface.py @@ -10,7 +10,7 @@ class CarInterface(CarInterfaceBase): CarController = CarController @staticmethod - def _get_params(ret: structs.CarParams, candidate: CAR, fingerprint, car_fw, alpha_long, docs) -> structs.CarParams: + def _get_params(ret: structs.CarParams, candidate: CAR, fingerprint, car_fw, experimental_long, docs) -> structs.CarParams: ret.brand = "volkswagen" ret.radarUnavailable = True @@ -73,8 +73,8 @@ def _get_params(ret: structs.CarParams, candidate: CAR, fingerprint, car_fw, alp # Global longitudinal tuning defaults, can be overridden per-vehicle - ret.alphaLongitudinalAvailable = ret.networkLocation == NetworkLocation.gateway or docs - if alpha_long: + ret.experimentalLongitudinalAvailable = ret.networkLocation == NetworkLocation.gateway or docs + if experimental_long: # Proof-of-concept, prep for E2E only. No radar points available. Panda ALLOW_DEBUG firmware required. ret.openpilotLongitudinalControl = True ret.safetyConfigs[0].safetyParam |= VolkswagenSafetyFlags.LONG_CONTROL.value diff --git a/opendbc/dbc/generator/honda/_bosch_adas_2018.dbc b/opendbc/dbc/generator/honda/_bosch_adas_2018.dbc index ec7c41ceece..dc8def55cb1 100644 --- a/opendbc/dbc/generator/honda/_bosch_adas_2018.dbc +++ b/opendbc/dbc/generator/honda/_bosch_adas_2018.dbc @@ -28,17 +28,16 @@ BO_ 829 LKAS_HUD: 5 ADAS SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY SG_ SET_ME_X41 : 6|7@0+ (1,0) [0|127] "" BDY SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY - SG_ CAMERA_OVERHEAT : 15|1@0+ (1,0) [0|1] "" BDY SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY - SG_ LANE_DEPARTURE_ALERT : 9|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY - SG_ LDW_ICON : 22|1@0+ (1,0) [0|1] "" BDY + SG_ BOH_2 : 23|2@0+ (1,0) [0|4] "" BDY SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY - SG_ BEEP : 18|3@0+ (1,0) [0|7] "" BDY + SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY @@ -51,7 +50,5 @@ CM_ SG_ 479 AEB_STATUS "set for the duration of AEB event"; CM_ SG_ 479 AEB_BRAKING "set when braking is commanded during AEB event"; CM_ SG_ 479 AEB_PREPARE "set 1s before AEB"; CM_ SG_ 829 BEEP "beeps are pleasant, chimes are for warnngs etc..."; -CM_ SG_ 829 CAM_TEMP_HIGH "Some Driver Assist Systems Cannot Operate: Camera Temperature Too High"; -CM_ SG_ 829 CAMERA_OVERHEAT "Lane Keeping Assist Cannot Operate: Camera Too Hot"; -VAL_ 829 BEEP 5 "solid_beep" 4 "double_beep" 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep"; +VAL_ 829 BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep"; diff --git a/opendbc/dbc/generator/nissan/_nissan_common.dbc b/opendbc/dbc/generator/nissan/_nissan_common.dbc index 46a65a7b7e1..13da6361b66 100644 --- a/opendbc/dbc/generator/nissan/_nissan_common.dbc +++ b/opendbc/dbc/generator/nissan/_nissan_common.dbc @@ -58,10 +58,6 @@ BO_ 689 PROPILOT_HUD: 8 XXX SG_ unknown55 : 55|8@0+ (1,0) [0|63] "" XXX SG_ unknown59 : 59|4@0+ (1,0) [0|15] "" XXX -BO_ 451 PROPILOT_BRAKE: 8 XXX - SG_ BRAKE_PRESSURE : 5|9@0+ (1,0) [0|511] "" XXX - SG_ BRAKE_ACTIVE : 47|1@0+ (1,0) [0|1] "" XXX - BO_ 783 CRUISE_STATE: 3 XXX SG_ CRUISE_ENABLED : 3|1@0+ (1,0) [0|1] "" XXX diff --git a/opendbc/dbc/rivian_park_assist_can.dbc b/opendbc/dbc/rivian_park_assist_can.dbc deleted file mode 100644 index 1d5955125b7..00000000000 --- a/opendbc/dbc/rivian_park_assist_can.dbc +++ /dev/null @@ -1,52 +0,0 @@ -VERSION "ParkAssistCAN" - - -NS_ : - NS_DESC_ - CM_ - BA_DEF_ - BA_ - VAL_ - CAT_DEF_ - CAT_ - FILTER - BA_DEF_DEF_ - EV_DATA_ - ENVVAR_DATA_ - SGTYPE_ - SGTYPE_VAL_ - BA_DEF_SGTYPE_ - BA_SGTYPE_ - SIG_TYPE_REF_ - VAL_TABLE_ - SIG_GROUP_ - SIG_VALTYPE_ - SIGTYPE_VALTYPE_ - BO_TX_BU_ - BA_DEF_REL_ - BA_REL_ - BA_DEF_DEF_REL_ - BU_SG_REL_ - BU_EV_REL_ - BU_BO_REL_ - SG_MUL_VAL_ - -BS_: - -BU_: ACM CGM EPAS_P ESP IBM OCS RCM SAS TestTool VDM Vector_XXX - -BO_ 794 WheelButtons: 7 XXX - SG_ LeftButton_ScrollClick : 19|2@0+ (1,0) [0|3] "" XXX - SG_ LeftButton_RightClick : 21|2@0+ (1,0) [0|3] "" XXX - SG_ LeftButton_LeftClick : 22|2@1+ (1,0) [0|3] "" XXX - SG_ LeftBUtton_Scroll : 31|8@0+ (1,0) [0|255] "" XXX - SG_ RightButton_ScrollClick : 35|2@0+ (1,0) [0|3] "" XXX - SG_ RightButton_RightClick : 37|2@0+ (1,0) [0|3] "" XXX - SG_ RightButton_LeftClick : 38|2@1+ (1,0) [0|3] "" XXX - SG_ RightButton_Scroll : 47|8@0+ (1,0) [0|255] "" XXX - -BO_ 848 BSM_BlindSpotIndicator: 4 XXX - SG_ BSM_BlindSpotIndicator_Checksum : 0|8@1+ (1,0) [0|255] "" XXX - SG_ BSM_BlindSpotIndicator_Counter : 11|4@0+ (1,0) [0|15] "" XXX - SG_ BSM_BlindSpotIndicator_Left : 28|1@0+ (1,0) [0|1] "" XXX - SG_ BSM_BlindSpotIndicator_Right : 30|1@0+ (1,0) [0|1] "" XXX \ No newline at end of file diff --git a/opendbc/dbc/rivian_primary_actuator.dbc b/opendbc/dbc/rivian_primary_actuator.dbc index af0489239d6..6422562d0d7 100644 --- a/opendbc/dbc/rivian_primary_actuator.dbc +++ b/opendbc/dbc/rivian_primary_actuator.dbc @@ -327,7 +327,6 @@ BO_ 565 IndicatorLights: 8 XXX SG_ DriverDoor : 28|2@0+ (1,0) [0|3] "" XXX SG_ RearPassengerDoor : 38|2@0+ (1,0) [0|3] "" XXX SG_ TurnLightLeft : 40|2@0+ (1,0) [0|3] "" XXX - SG_ IgnitionOn : 48|1@0+ (1,0) [0|1] "" XXX SG_ TurnLightRight : 54|2@0+ (1,0) [0|3] "" XXX BO_ 592 VDM_EcasStatus: 8 VDM diff --git a/opendbc/dbc/tesla_model3_party.dbc b/opendbc/dbc/tesla_model3_party.dbc index 86dc20a0f63..2f7b67a0c42 100644 --- a/opendbc/dbc/tesla_model3_party.dbc +++ b/opendbc/dbc/tesla_model3_party.dbc @@ -189,9 +189,7 @@ BO_ 599 DI_speed: 8 PARTY SG_ DI_speedCounter : 8|4@1+ (1,0) [0|15] "" park SG_ DI_speedChecksum : 0|8@1+ (1,0) [0|255] "" park -BO_ 605 DAS_road: 6 XXX - SG_ DAS_stopLineDist : 16|8@1+ (0.5,0) [0|127.5] "m" XXX - SG_ DAS_trafficLightColor : 26|3@0+ (1,0) [0|7] "" XXX +BO_ 605 XXX_longitudinalRelated: 6 XXX BO_ 1160 DAS_steeringControl: 4 PARTY SG_ DAS_steeringControlChecksum : 31|8@0+ (1,0) [0|255] "" aps @@ -349,7 +347,6 @@ VAL_ 280 DI_immobilizerState 2 "DI_IMM_STATE_AUTHENTICATING" 0 "DI_IMM_STATE_INI VAL_ 280 DI_gear 1 "DI_GEAR_P" 0 "DI_GEAR_INVALID" 7 "DI_GEAR_SNA" 2 "DI_GEAR_R" 3 "DI_GEAR_N" 4 "DI_GEAR_D" ; VAL_ 280 DI_brakePedalState 2 "INVALID" 0 "OFF" 1 "ON" ; VAL_ 280 DI_systemState 5 "DI_SYS_ENABLE" 1 "DI_SYS_IDLE" 2 "DI_SYS_STANDBY" 0 "DI_SYS_UNAVAILABLE" 3 "DI_SYS_FAULT" 4 "DI_SYS_ABORT" ; -VAL_ 605 DAS_trafficLightColor 0 "NONE" 1 "RED" 2 "GREEN" 3 "YELLOW" ; VAL_ 697 DAS_accelMax 511 "SNA" ; VAL_ 697 DAS_accelMin 511 "SNA" ; VAL_ 697 DAS_jerkMax 255 "SNA" ; diff --git a/opendbc/safety/board/drivers/can_common.h b/opendbc/safety/board/drivers/can_common.h index 306f0c07fa5..52a980cf1d4 100644 --- a/opendbc/safety/board/drivers/can_common.h +++ b/opendbc/safety/board/drivers/can_common.h @@ -1,4 +1,3 @@ -#pragma once #include "can_common_declarations.h" uint8_t calculate_checksum(const uint8_t *dat, uint32_t len) { diff --git a/opendbc/safety/board/utils.h b/opendbc/safety/board/utils.h index 20b24621411..f355ce8c2f2 100644 --- a/opendbc/safety/board/utils.h +++ b/opendbc/safety/board/utils.h @@ -42,6 +42,6 @@ // compute the time elapsed (in microseconds) from 2 counter samples // case where ts < ts_last is ok: overflow is properly re-casted into uint32_t -static inline uint32_t get_ts_elapsed(uint32_t ts, uint32_t ts_last) { +uint32_t get_ts_elapsed(uint32_t ts, uint32_t ts_last) { return ts - ts_last; } diff --git a/opendbc/safety/safety.h b/opendbc/safety/safety.h index 5b337616f7f..437e8da69d7 100644 --- a/opendbc/safety/safety.h +++ b/opendbc/safety/safety.h @@ -27,6 +27,36 @@ #include "safety/safety_hyundai_canfd.h" #endif +// from cereal.car.CarParams.SafetyModel +#define SAFETY_SILENT 0U +#define SAFETY_HONDA_NIDEC 1U +#define SAFETY_TOYOTA 2U +#define SAFETY_ELM327 3U +#define SAFETY_GM 4U +#define SAFETY_HONDA_BOSCH_GIRAFFE 5U +#define SAFETY_FORD 6U +#define SAFETY_HYUNDAI 8U +#define SAFETY_CHRYSLER 9U +#define SAFETY_TESLA 10U +#define SAFETY_SUBARU 11U +#define SAFETY_MAZDA 13U +#define SAFETY_NISSAN 14U +#define SAFETY_VOLKSWAGEN_MQB 15U +#define SAFETY_ALLOUTPUT 17U +#define SAFETY_GM_ASCM 18U +#define SAFETY_NOOUTPUT 19U +#define SAFETY_HONDA_BOSCH 20U +#define SAFETY_VOLKSWAGEN_PQ 21U +#define SAFETY_SUBARU_PREGLOBAL 22U +#define SAFETY_HYUNDAI_LEGACY 23U +#define SAFETY_HYUNDAI_COMMUNITY 24U +#define SAFETY_STELLANTIS 25U +#define SAFETY_FAW 26U +#define SAFETY_BODY 27U +#define SAFETY_HYUNDAI_CANFD 28U +#define SAFETY_RIVIAN 33U +#define SAFETY_VOLKSWAGEN_MEB 34U + uint32_t GET_BYTES(const CANPacket_t *msg, int start, int len) { uint32_t ret = 0U; for (int i = 0; i < len; i++) { @@ -84,9 +114,6 @@ uint16_t current_safety_param = 0; static const safety_hooks *current_hooks = &nooutput_hooks; safety_config current_safety_config; -static void generic_rx_checks(void); -static void stock_ecu_check(bool stock_ecu_detected); - static bool is_msg_valid(RxCheck addr_list[], int index) { bool valid = true; if (index != -1) { @@ -189,18 +216,15 @@ bool safety_rx_hook(const CANPacket_t *to_push) { current_hooks->rx(to_push); } - // Handles gas, brake, and regen paddle - generic_rx_checks(); - // the relay malfunction hook runs on all incoming rx messages. - // check all applicable tx msgs for liveness on sending bus. + // check all tx msgs for liveness on sending bus if specified. // used to detect a relay malfunction or control messages from disabled ECUs like the radar const int bus = GET_BUS(to_push); const int addr = GET_ADDR(to_push); for (int i = 0; i < current_safety_config.tx_msgs_len; i++) { const CanMsg *m = ¤t_safety_config.tx_msgs[i]; if (m->check_relay) { - stock_ecu_check((m->addr == addr) && (m->bus == bus)); + generic_rx_checks((m->addr == addr) && (m->bus == bus)); } } @@ -256,24 +280,11 @@ static int get_fwd_bus(int bus_num) { int safety_fwd_hook(int bus_num, int addr) { bool blocked = relay_malfunction || current_safety_config.disable_forwarding; - // Block messages that are being checked for relay malfunctions. Safety modes can opt out of this - // in the case of selective AEB forwarding - const int destination_bus = get_fwd_bus(bus_num); - if (!blocked) { - for (int i = 0; i < current_safety_config.tx_msgs_len; i++) { - const CanMsg *m = ¤t_safety_config.tx_msgs[i]; - if (m->check_relay && !m->disable_static_blocking && (m->addr == addr) && (m->bus == destination_bus)) { - blocked = true; - break; - } - } - } - if (!blocked && (current_hooks->fwd != NULL)) { blocked = current_hooks->fwd(bus_num, addr); } - return blocked ? -1 : destination_bus; + return blocked ? -1 : get_fwd_bus(bus_num); } bool get_longitudinal_allowed(void) { @@ -344,7 +355,10 @@ static void relay_malfunction_set(void) { fault_occurred(FAULT_RELAY_MALFUNCTION); } -static void generic_rx_checks(void) { +static void generic_rx_checks(bool stock_ecu_detected) { + // allow 1s of transition timeout after relay changes state before assessing malfunctioning + const uint32_t RELAY_TRNS_TIMEOUT = 1U; + // exit controls on rising edge of gas press if (gas_pressed && !gas_pressed_prev && !(alternative_experience & ALT_EXP_DISABLE_DISENGAGE_ON_GAS)) { controls_allowed = false; @@ -362,11 +376,6 @@ static void generic_rx_checks(void) { controls_allowed = false; } regen_braking_prev = regen_braking; -} - -static void stock_ecu_check(bool stock_ecu_detected) { - // allow 1s of transition timeout after relay changes state before assessing malfunctioning - const uint32_t RELAY_TRNS_TIMEOUT = 1U; // check if stock ECU is on bus broken by car harness if ((safety_mode_cnt > RELAY_TRNS_TIMEOUT) && stock_ecu_detected) { diff --git a/opendbc/safety/safety/safety_body.h b/opendbc/safety/safety/safety_body.h index 6536178aaf0..9960d57bea9 100644 --- a/opendbc/safety/safety/safety_body.h +++ b/opendbc/safety/safety/safety_body.h @@ -34,9 +34,9 @@ static safety_config body_init(uint16_t param) { {.msg = {{0x201, 0, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 100U}, { 0 }, { 0 }}}, }; - static const CanMsg BODY_TX_MSGS[] = {{0x250, 0, 8, .check_relay = false}, {0x250, 0, 6, .check_relay = false}, {0x251, 0, 5, .check_relay = false}, // body - {0x350, 0, 8, .check_relay = false}, {0x350, 0, 6, .check_relay = false}, {0x351, 0, 5, .check_relay = false}, // knee - {0x1, 0, 8, .check_relay = false}}; // CAN flasher + static const CanMsg BODY_TX_MSGS[] = {{0x250, 0, 8, false}, {0x250, 0, 6, false}, {0x251, 0, 5, false}, // body + {0x350, 0, 8, false}, {0x350, 0, 6, false}, {0x351, 0, 5, false}, // knee + {0x1, 0, 8, false}}; // CAN flasher UNUSED(param); safety_config ret = BUILD_SAFETY_CFG(body_rx_checks, BODY_TX_MSGS); diff --git a/opendbc/safety/safety/safety_chrysler.h b/opendbc/safety/safety/safety_chrysler.h index 628bf6ed0c9..67bda5624ba 100644 --- a/opendbc/safety/safety/safety_chrysler.h +++ b/opendbc/safety/safety/safety_chrysler.h @@ -161,6 +161,18 @@ static bool chrysler_tx_hook(const CANPacket_t *to_send) { return tx; } +static bool chrysler_fwd_hook(int bus_num, int addr) { + bool block_msg = false; + + // forward all messages from camera except LKAS messages + const bool is_lkas = ((addr == chrysler_addrs->LKAS_COMMAND) || (addr == chrysler_addrs->DAS_6)); + if ((bus_num == 2) && is_lkas){ + block_msg = true; + } + + return block_msg; +} + static safety_config chrysler_init(uint16_t param) { const uint32_t CHRYSLER_PARAM_RAM_DT = 1U; // set for Ram DT platform @@ -207,15 +219,15 @@ static safety_config chrysler_init(uint16_t param) { }; static const CanMsg CHRYSLER_TX_MSGS[] = { - {CHRYSLER_ADDRS.CRUISE_BUTTONS, 0, 3, .check_relay = false}, - {CHRYSLER_ADDRS.LKAS_COMMAND, 0, 6, .check_relay = true}, - {CHRYSLER_ADDRS.DAS_6, 0, 8, .check_relay = true}, + {CHRYSLER_ADDRS.CRUISE_BUTTONS, 0, 3, false}, + {CHRYSLER_ADDRS.LKAS_COMMAND, 0, 6, true}, + {CHRYSLER_ADDRS.DAS_6, 0, 8, false}, }; static const CanMsg CHRYSLER_RAM_DT_TX_MSGS[] = { - {CHRYSLER_RAM_DT_ADDRS.CRUISE_BUTTONS, 2, 3, .check_relay = false}, - {CHRYSLER_RAM_DT_ADDRS.LKAS_COMMAND, 0, 8, .check_relay = true}, - {CHRYSLER_RAM_DT_ADDRS.DAS_6, 0, 8, .check_relay = true}, + {CHRYSLER_RAM_DT_ADDRS.CRUISE_BUTTONS, 2, 3, false}, + {CHRYSLER_RAM_DT_ADDRS.LKAS_COMMAND, 0, 8, true}, + {CHRYSLER_RAM_DT_ADDRS.DAS_6, 0, 8, false}, }; #ifdef ALLOW_DEBUG @@ -240,9 +252,9 @@ static safety_config chrysler_init(uint16_t param) { }; static const CanMsg CHRYSLER_RAM_HD_TX_MSGS[] = { - {CHRYSLER_RAM_HD_ADDRS.CRUISE_BUTTONS, 2, 3, .check_relay = false}, - {CHRYSLER_RAM_HD_ADDRS.LKAS_COMMAND, 0, 8, .check_relay = true}, - {CHRYSLER_RAM_HD_ADDRS.DAS_6, 0, 8, .check_relay = true}, + {CHRYSLER_RAM_HD_ADDRS.CRUISE_BUTTONS, 2, 3, false}, + {CHRYSLER_RAM_HD_ADDRS.LKAS_COMMAND, 0, 8, true}, + {CHRYSLER_RAM_HD_ADDRS.DAS_6, 0, 8, false}, }; const uint32_t CHRYSLER_PARAM_RAM_HD = 2U; // set for Ram HD platform @@ -275,6 +287,7 @@ const safety_hooks chrysler_hooks = { .init = chrysler_init, .rx = chrysler_rx_hook, .tx = chrysler_tx_hook, + .fwd = chrysler_fwd_hook, .get_counter = chrysler_get_counter, .get_checksum = chrysler_get_checksum, .compute_checksum = chrysler_compute_checksum, diff --git a/opendbc/safety/safety/safety_ford.h b/opendbc/safety/safety/safety_ford.h index c45bc9a618f..f7943562740 100644 --- a/opendbc/safety/safety/safety_ford.h +++ b/opendbc/safety/safety/safety_ford.h @@ -87,6 +87,9 @@ static bool ford_get_quality_flag_valid(const CANPacket_t *to_push) { return valid; } +static bool ford_canfd = false; +static bool ford_longitudinal = false; + #define FORD_INACTIVE_CURVATURE 1000U #define FORD_INACTIVE_CURVATURE_RATE 4096U #define FORD_INACTIVE_PATH_OFFSET 512U @@ -96,6 +99,14 @@ static bool ford_get_quality_flag_valid(const CANPacket_t *to_push) { #define FORD_MAX_SPEED_DELTA 2.0 // m/s +static bool ford_lkas_msg_check(int addr) { + return (addr == FORD_ACCDATA_3) + || (addr == FORD_Lane_Assist_Data1) + || ((addr == FORD_LateralMotionControl) && !ford_canfd) + || ((addr == FORD_LateralMotionControl2) && ford_canfd) + || (addr == FORD_IPMA_Data); +} + // Curvature rate limits #define FORD_LIMITS(limit_lateral_acceleration) { \ .max_angle = 1000, /* 0.02 curvature */ \ @@ -300,6 +311,29 @@ static bool ford_tx_hook(const CANPacket_t *to_send) { return tx; } +static bool ford_fwd_hook(int bus_num, int addr) { + bool block_msg = false; + + switch (bus_num) { + case FORD_CAM_BUS: { + if (ford_lkas_msg_check(addr)) { + // Block stock LKAS and UI messages + block_msg = true; + } else if (ford_longitudinal && (addr == FORD_ACCDATA)) { + // Block stock ACC message + block_msg = true; + } else { + } + break; + } + default: { + break; + } + } + + return block_msg; +} + static safety_config ford_init(uint16_t param) { // warning: quality flags are not yet checked in openpilot's CAN parser, // this may be the cause of blocked messages @@ -316,39 +350,39 @@ static safety_config ford_init(uint16_t param) { {.msg = {{FORD_DesiredTorqBrk, 0, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 50U}, { 0 }, { 0 }}}, }; - #define FORD_COMMON_TX_MSGS \ - {FORD_Steering_Data_FD1, 0, 8, .check_relay = false}, \ - {FORD_Steering_Data_FD1, 2, 8, .check_relay = false}, \ - {FORD_ACCDATA_3, 0, 8, .check_relay = true}, \ - {FORD_Lane_Assist_Data1, 0, 8, .check_relay = true}, \ - {FORD_IPMA_Data, 0, 8, .check_relay = true}, \ + #define FORD_COMMON_TX_MSGS \ + {FORD_Steering_Data_FD1, 0, 8, false}, \ + {FORD_Steering_Data_FD1, 2, 8, false}, \ + {FORD_ACCDATA_3, 0, 8, true}, \ + {FORD_Lane_Assist_Data1, 0, 8, true}, \ + {FORD_IPMA_Data, 0, 8, true}, \ static const CanMsg FORD_CANFD_LONG_TX_MSGS[] = { FORD_COMMON_TX_MSGS - {FORD_ACCDATA, 0, 8, .check_relay = true}, - {FORD_LateralMotionControl2, 0, 8, .check_relay = true}, + {FORD_ACCDATA, 0, 8, true}, + {FORD_LateralMotionControl2, 0, 8, true}, }; static const CanMsg FORD_CANFD_STOCK_TX_MSGS[] = { FORD_COMMON_TX_MSGS - {FORD_LateralMotionControl2, 0, 8, .check_relay = true}, + {FORD_LateralMotionControl2, 0, 8, true}, }; static const CanMsg FORD_STOCK_TX_MSGS[] = { FORD_COMMON_TX_MSGS - {FORD_LateralMotionControl, 0, 8, .check_relay = true}, + {FORD_LateralMotionControl, 0, 8, true}, }; static const CanMsg FORD_LONG_TX_MSGS[] = { FORD_COMMON_TX_MSGS - {FORD_ACCDATA, 0, 8, .check_relay = true}, - {FORD_LateralMotionControl, 0, 8, .check_relay = true}, + {FORD_ACCDATA, 0, 8, true}, + {FORD_LateralMotionControl, 0, 8, true}, }; const uint16_t FORD_PARAM_CANFD = 2; - const bool ford_canfd = GET_FLAG(param, FORD_PARAM_CANFD); + ford_canfd = GET_FLAG(param, FORD_PARAM_CANFD); - bool ford_longitudinal = false; + ford_longitudinal = false; #ifdef ALLOW_DEBUG const uint16_t FORD_PARAM_LONGITUDINAL = 1; @@ -373,6 +407,7 @@ const safety_hooks ford_hooks = { .init = ford_init, .rx = ford_rx_hook, .tx = ford_tx_hook, + .fwd = ford_fwd_hook, .get_counter = ford_get_counter, .get_checksum = ford_get_checksum, .compute_checksum = ford_compute_checksum, diff --git a/opendbc/safety/safety/safety_gm.h b/opendbc/safety/safety/safety_gm.h index 4c4f19d1dc3..17e089959e5 100644 --- a/opendbc/safety/safety/safety_gm.h +++ b/opendbc/safety/safety/safety_gm.h @@ -27,6 +27,7 @@ typedef enum { GM_CAM } GmHardware; static GmHardware gm_hw = GM_ASCM; +static bool gm_cam_long = false; static bool gm_pcm_cruise = false; static void gm_rx_hook(const CANPacket_t *to_push) { @@ -159,6 +160,31 @@ static bool gm_tx_hook(const CANPacket_t *to_send) { return tx; } +static bool gm_fwd_hook(int bus_num, int addr) { + bool block_msg = false; + + if (gm_hw == GM_CAM) { + if (bus_num == 0) { + // block PSCMStatus; forwarded through openpilot to hide an alert from the camera + bool is_pscm_msg = (addr == 0x184); + if (is_pscm_msg) { + block_msg = true; + } + } + + if (bus_num == 2) { + // block lkas message and acc messages if gm_cam_long, forward all others + bool is_lkas_msg = (addr == 0x180); + bool is_acc_msg = (addr == 0x315) || (addr == 0x2CB) || (addr == 0x370); + block_msg = is_lkas_msg || (is_acc_msg && gm_cam_long); + } + } else { + block_msg = true; + } + + return block_msg; +} + static safety_config gm_init(uint16_t param) { const uint16_t GM_PARAM_HW_CAM = 1; const uint16_t GM_PARAM_EV = 4; @@ -173,9 +199,9 @@ static safety_config gm_init(uint16_t param) { .max_brake = 400, }; - static const CanMsg GM_ASCM_TX_MSGS[] = {{0x180, 0, 4, .check_relay = true}, {0x409, 0, 7, .check_relay = false}, {0x40A, 0, 7, .check_relay = false}, {0x2CB, 0, 8, .check_relay = true}, {0x370, 0, 6, .check_relay = false}, // pt bus - {0xA1, 1, 7, .check_relay = false}, {0x306, 1, 8, .check_relay = false}, {0x308, 1, 7, .check_relay = false}, {0x310, 1, 2, .check_relay = false}, // obs bus - {0x315, 2, 5, .check_relay = false}}; // ch bus + static const CanMsg GM_ASCM_TX_MSGS[] = {{0x180, 0, 4, true}, {0x409, 0, 7, false}, {0x40A, 0, 7, false}, {0x2CB, 0, 8, true}, {0x370, 0, 6, false}, // pt bus + {0xA1, 1, 7, false}, {0x306, 1, 8, false}, {0x308, 1, 7, false}, {0x310, 1, 2, false}, // obs bus + {0x315, 2, 5, false}}; // ch bus static const LongitudinalLimits GM_CAM_LONG_LIMITS = { @@ -185,9 +211,8 @@ static safety_config gm_init(uint16_t param) { .max_brake = 400, }; - // block PSCMStatus (0x184); forwarded through openpilot to hide an alert from the camera - static const CanMsg GM_CAM_LONG_TX_MSGS[] = {{0x180, 0, 4, .check_relay = true}, {0x315, 0, 5, .check_relay = true}, {0x2CB, 0, 8, .check_relay = true}, {0x370, 0, 6, .check_relay = true}, // pt bus - {0x184, 2, 8, .check_relay = true}}; // camera bus + static const CanMsg GM_CAM_LONG_TX_MSGS[] = {{0x180, 0, 4, true}, {0x315, 0, 5, false}, {0x2CB, 0, 8, true}, {0x370, 0, 6, false}, // pt bus + {0x184, 2, 8, false}}; // camera bus static RxCheck gm_rx_checks[] = { @@ -199,8 +224,8 @@ static safety_config gm_init(uint16_t param) { {.msg = {{0xBD, 0, 7, .ignore_checksum = true, .ignore_counter = true, .frequency = 40U}, { 0 }, { 0 }}}, }; - static const CanMsg GM_CAM_TX_MSGS[] = {{0x180, 0, 4, .check_relay = true}, // pt bus - {0x1E1, 2, 7, .check_relay = false}, {0x184, 2, 8, .check_relay = true}}; // camera bus + static const CanMsg GM_CAM_TX_MSGS[] = {{0x180, 0, 4, true}, // pt bus + {0x1E1, 2, 7, false}, {0x184, 2, 8, false}}; // camera bus gm_hw = GET_FLAG(param, GM_PARAM_HW_CAM) ? GM_CAM : GM_ASCM; @@ -211,8 +236,6 @@ static safety_config gm_init(uint16_t param) { } else { } - bool gm_cam_long = false; - #ifdef ALLOW_DEBUG const uint16_t GM_PARAM_HW_CAM_LONG = 2; gm_cam_long = GET_FLAG(param, GM_PARAM_HW_CAM_LONG); @@ -233,11 +256,6 @@ static safety_config gm_init(uint16_t param) { if (gm_ev) { SET_RX_CHECKS(gm_ev_rx_checks, ret); } - - // ASCM does not forward any messages - if (gm_hw == GM_ASCM) { - ret.disable_forwarding = true; - } return ret; } @@ -245,4 +263,5 @@ const safety_hooks gm_hooks = { .init = gm_init, .rx = gm_rx_hook, .tx = gm_tx_hook, + .fwd = gm_fwd_hook, }; diff --git a/opendbc/safety/safety/safety_honda.h b/opendbc/safety/safety/safety_honda.h index ffeaf89a4dc..6361ba31f9a 100644 --- a/opendbc/safety/safety/safety_honda.h +++ b/opendbc/safety/safety/safety_honda.h @@ -278,11 +278,7 @@ static bool honda_tx_hook(const CANPacket_t *to_send) { } static safety_config honda_nidec_init(uint16_t param) { - // 0x1FA is dynamically forwarded based on stock AEB - // 0xE4 is steering on all cars except CRV and RDX, 0x194 for CRV and RDX, - // 0x1FA is brake control, 0x30C is acc hud, 0x33D is lkas hud - static CanMsg HONDA_N_TX_MSGS[] = {{0xE4, 0, 5, .check_relay = true}, {0x194, 0, 4, .check_relay = true}, {0x1FA, 0, 8, .check_relay = false}, - {0x30C, 0, 8, .check_relay = true}, {0x33D, 0, 5, .check_relay = true}}; + static CanMsg HONDA_N_TX_MSGS[] = {{0xE4, 0, 5, true}, {0x194, 0, 4, true}, {0x1FA, 0, 8, false}, {0x30C, 0, 8, false}, {0x33D, 0, 5, false}}; const uint16_t HONDA_PARAM_NIDEC_ALT = 4; @@ -322,21 +318,10 @@ static safety_config honda_nidec_init(uint16_t param) { } static safety_config honda_bosch_init(uint16_t param) { - // HONDA_BOSCH_TX_MSGS is used by Bosch and Bosch CAN FD - static CanMsg HONDA_BOSCH_TX_MSGS[] = {{0xE4, 0, 5, .check_relay = true}, {0xE5, 0, 8, .check_relay = true}, - // Send buttons on powertrain bus: 0 for Bosch CAN FD, 1 for CAN - {0x296, 0, 4, .check_relay = false}, {0x296, 1, 4, .check_relay = false}, - {0x33D, 0, 5, .check_relay = true}, {0x33DA, 0, 5, .check_relay = true}, {0x33DB, 0, 8, .check_relay = true}}; // Bosch - - static CanMsg HONDA_BOSCH_LONG_TX_MSGS[] = {{0xE4, 1, 5, .check_relay = true}, {0x1DF, 1, 8, .check_relay = true}, {0x1EF, 1, 8, .check_relay = false}, - {0x1FA, 1, 8, .check_relay = false}, {0x30C, 1, 8, .check_relay = false}, {0x33D, 1, 5, .check_relay = true}, - {0x33DA, 1, 5, .check_relay = true}, {0x33DB, 1, 8, .check_relay = true}, {0x39F, 1, 8, .check_relay = false}, - {0x18DAB0F1, 1, 8, .check_relay = false}}; // Bosch w/ gas and brakes - - static CanMsg HONDA_RADARLESS_TX_MSGS[] = {{0xE4, 0, 5, .check_relay = true}, {0x296, 2, 4, .check_relay = false}, {0x33D, 0, 8, .check_relay = true}}; // Bosch radarless - - static CanMsg HONDA_RADARLESS_LONG_TX_MSGS[] = {{0xE4, 0, 5, .check_relay = true}, {0x33D, 0, 8, .check_relay = true}, {0x1C8, 0, 8, .check_relay = true}, - {0x30C, 0, 8, .check_relay = true}}; // Bosch radarless w/ gas and brakes + static CanMsg HONDA_BOSCH_TX_MSGS[] = {{0xE4, 0, 5, true}, {0xE5, 0, 8, false}, {0x296, 1, 4, false}, {0x33D, 0, 5, false}, {0x33DA, 0, 5, false}, {0x33DB, 0, 8, false}}; // Bosch + static CanMsg HONDA_BOSCH_LONG_TX_MSGS[] = {{0xE4, 1, 5, true}, {0x1DF, 1, 8, true}, {0x1EF, 1, 8, false}, {0x1FA, 1, 8, false}, {0x30C, 1, 8, false}, {0x33D, 1, 5, false}, {0x33DA, 1, 5, false}, {0x33DB, 1, 8, false}, {0x39F, 1, 8, false}, {0x18DAB0F1, 1, 8, false}}; // Bosch w/ gas and brakes + static CanMsg HONDA_RADARLESS_TX_MSGS[] = {{0xE4, 0, 5, true}, {0x296, 2, 4, false}, {0x33D, 0, 8, false}}; // Bosch radarless + static CanMsg HONDA_RADARLESS_LONG_TX_MSGS[] = {{0xE4, 0, 5, true}, {0x33D, 0, 8, false}, {0x1C8, 0, 8, false}, {0x30C, 0, 8, false}}; // Bosch radarless w/ gas and brakes const uint16_t HONDA_PARAM_ALT_BRAKE = 1; const uint16_t HONDA_PARAM_RADARLESS = 8; @@ -401,12 +386,29 @@ static safety_config honda_bosch_init(uint16_t param) { } static bool honda_nidec_fwd_hook(int bus_num, int addr) { + // fwd from car to camera. also fwd certain msgs from camera to car + // 0xE4 is steering on all cars except CRV and RDX, 0x194 for CRV and RDX, + // 0x1FA is brake control, 0x30C is acc hud, 0x33D is lkas hud bool block_msg = false; if (bus_num == 2) { - // forwarded if stock AEB is active + // block stock lkas messages and stock acc messages (if OP is doing ACC) + bool is_lkas_msg = (addr == 0xE4) || (addr == 0x194) || (addr == 0x33D); + bool is_acc_hud_msg = addr == 0x30C; bool is_brake_msg = addr == 0x1FA; - block_msg = is_brake_msg && !honda_fwd_brake; + block_msg = is_lkas_msg || is_acc_hud_msg || (is_brake_msg && !honda_fwd_brake); + } + + return block_msg; +} + +static bool honda_bosch_fwd_hook(int bus_num, int addr) { + bool block_msg = false; + + if (bus_num == 2) { + bool is_lkas_msg = (addr == 0xE4) || (addr == 0xE5) || (addr == 0x33D) || (addr == 0x33DA) || (addr == 0x33DB); + bool is_acc_msg = ((addr == 0x1C8) || (addr == 0x30C)) && honda_bosch_radarless && honda_bosch_long; + block_msg = is_lkas_msg || is_acc_msg; } return block_msg; @@ -426,6 +428,7 @@ const safety_hooks honda_bosch_hooks = { .init = honda_bosch_init, .rx = honda_rx_hook, .tx = honda_tx_hook, + .fwd = honda_bosch_fwd_hook, .get_counter = honda_get_counter, .get_checksum = honda_get_checksum, .compute_checksum = honda_compute_checksum, diff --git a/opendbc/safety/safety/safety_hyundai.h b/opendbc/safety/safety/safety_hyundai.h index a7a8423b6f0..3b6564882b5 100644 --- a/opendbc/safety/safety/safety_hyundai.h +++ b/opendbc/safety/safety/safety_hyundai.h @@ -26,17 +26,17 @@ const LongitudinalLimits HYUNDAI_LONG_LIMITS = { }; #define HYUNDAI_COMMON_TX_MSGS(scc_bus) \ - {0x340, 0, 8, .check_relay = true}, /* LKAS11 Bus 0 */ \ - {0x4F1, scc_bus, 4, .check_relay = false}, /* CLU11 Bus 0 (radar-SCC) or 2 (camera-SCC) */ \ - {0x485, 0, 4, .check_relay = true}, /* LFAHDA_MFC Bus 0 */ \ + {0x340, 0, 8, true}, /* LKAS11 Bus 0 */ \ + {0x4F1, scc_bus, 4, false}, /* CLU11 Bus 0 (radar-SCC) or 2 (camera-SCC) */ \ + {0x485, 0, 4, false}, /* LFAHDA_MFC Bus 0 */ \ #define HYUNDAI_LONG_COMMON_TX_MSGS(scc_bus) \ - HYUNDAI_COMMON_TX_MSGS(scc_bus) \ - {0x420, 0, 8, .check_relay = true}, /* SCC11 Bus 0 */ \ - {0x421, 0, 8, .check_relay = true}, /* SCC12 Bus 0 */ \ - {0x50A, 0, 8, .check_relay = true}, /* SCC13 Bus 0 */ \ - {0x389, 0, 8, .check_relay = true}, /* SCC14 Bus 0 */ \ - {0x4A2, 0, 2, .check_relay = false}, /* FRT_RADAR11 Bus 0 */ \ + HYUNDAI_COMMON_TX_MSGS(scc_bus) \ + {0x420, 0, 8, false}, /* SCC11 Bus 0 */ \ + {0x421, 0, 8, (scc_bus) == 0}, /* SCC12 Bus 0 */ \ + {0x50A, 0, 8, false}, /* SCC13 Bus 0 */ \ + {0x389, 0, 8, false}, /* SCC14 Bus 0 */ \ + {0x4A2, 0, 2, false}, /* FRT_RADAR11 Bus 0 */ \ #define HYUNDAI_COMMON_RX_CHECKS(legacy) \ {.msg = {{0x260, 0, 8, .max_counter = 3U, .frequency = 100U}, \ @@ -255,12 +255,29 @@ static bool hyundai_tx_hook(const CANPacket_t *to_send) { return tx; } +static bool hyundai_fwd_hook(int bus_num, int addr) { + bool block_msg = false; + + if (bus_num == 2) { + // Stock LKAS11 messages + bool is_lkas_11 = (addr == 0x340); + // LFA and HDA cluster icons + bool is_lfahda_mfc = (addr == 0x485); + // Stock SCC messages, blocking when doing openpilot longitudinal on camera SCC cars + bool is_scc_msg = (addr == 0x420) || (addr == 0x421) || (addr == 0x50A) || (addr == 0x389); + + block_msg = is_lkas_11 || is_lfahda_mfc || (is_scc_msg && hyundai_longitudinal && hyundai_camera_scc); + } + + return block_msg; +} + static safety_config hyundai_init(uint16_t param) { static const CanMsg HYUNDAI_LONG_TX_MSGS[] = { HYUNDAI_LONG_COMMON_TX_MSGS(0) - {0x38D, 0, 8, .check_relay = false}, // FCA11 Bus 0 - {0x483, 0, 8, .check_relay = false}, // FCA12 Bus 0 - {0x7D0, 0, 8, .check_relay = false}, // radar UDS TX addr Bus 0 (for radar disable) + {0x38D, 0, 8, false}, // FCA11 Bus 0 + {0x483, 0, 8, false}, // FCA12 Bus 0 + {0x7D0, 0, 8, false}, // radar UDS TX addr Bus 0 (for radar disable) }; static const CanMsg HYUNDAI_CAMERA_SCC_TX_MSGS[] = { @@ -344,6 +361,7 @@ const safety_hooks hyundai_hooks = { .init = hyundai_init, .rx = hyundai_rx_hook, .tx = hyundai_tx_hook, + .fwd = hyundai_fwd_hook, .get_counter = hyundai_get_counter, .get_checksum = hyundai_get_checksum, .compute_checksum = hyundai_compute_checksum, @@ -353,6 +371,7 @@ const safety_hooks hyundai_legacy_hooks = { .init = hyundai_legacy_init, .rx = hyundai_rx_hook, .tx = hyundai_tx_hook, + .fwd = hyundai_fwd_hook, .get_counter = hyundai_get_counter, .get_checksum = hyundai_get_checksum, .compute_checksum = hyundai_compute_checksum, diff --git a/opendbc/safety/safety/safety_hyundai_canfd.h b/opendbc/safety/safety/safety_hyundai_canfd.h index 99812026ffe..63e52a0c75c 100644 --- a/opendbc/safety/safety/safety_hyundai_canfd.h +++ b/opendbc/safety/safety/safety_hyundai_canfd.h @@ -4,24 +4,24 @@ #include "safety_hyundai_common.h" #define HYUNDAI_CANFD_CRUISE_BUTTON_TX_MSGS(bus) \ - {0x1CF, bus, 8, .check_relay = false}, /* CRUISE_BUTTON */ \ + {0x1CF, bus, 8, false}, /* CRUISE_BUTTON */ \ #define HYUNDAI_CANFD_LKA_STEERING_COMMON_TX_MSGS(a_can, e_can) \ - HYUNDAI_CANFD_CRUISE_BUTTON_TX_MSGS(e_can) \ - {0x50, a_can, 16, .check_relay = (a_can) == 0}, /* LKAS */ \ - {0x2A4, a_can, 24, .check_relay = (a_can) == 0}, /* CAM_0x2A4 */ \ + HYUNDAI_CANFD_CRUISE_BUTTON_TX_MSGS(e_can) \ + {0x50, a_can, 16, (a_can) == 0}, /* LKAS */ \ + {0x2A4, a_can, 24, false}, /* CAM_0x2A4 */ \ #define HYUNDAI_CANFD_LKA_STEERING_ALT_COMMON_TX_MSGS(a_can, e_can) \ HYUNDAI_CANFD_CRUISE_BUTTON_TX_MSGS(e_can) \ - {0x110, a_can, 32, .check_relay = (a_can) == 0}, /* LKAS_ALT */ \ - {0x362, a_can, 32, .check_relay = (a_can) == 0}, /* CAM_0x362 */ \ + {0x110, a_can, 32, (a_can) == 0}, /* LKAS_ALT */ \ + {0x362, a_can, 32, false}, /* CAM_0x362 */ \ #define HYUNDAI_CANFD_LFA_STEERING_COMMON_TX_MSGS(e_can) \ - {0x12A, e_can, 16, .check_relay = (e_can) == 0}, /* LFA */ \ - {0x1E0, e_can, 16, .check_relay = (e_can) == 0}, /* LFAHDA_CLUSTER */ \ + {0x12A, e_can, 16, (e_can) == 0}, /* LFA */ \ + {0x1E0, e_can, 16, false}, /* LFAHDA_CLUSTER */ \ -#define HYUNDAI_CANFD_SCC_CONTROL_COMMON_TX_MSGS(e_can, longitudinal) \ - {0x1A0, e_can, 32, .check_relay = (longitudinal)}, /* SCC_CONTROL */ \ +#define HYUNDAI_CANFD_SCC_CONTROL_COMMON_TX_MSGS(e_can, longitudinal) \ + {0x1A0, e_can, 32, (longitudinal)}, /* SCC_CONTROL */ \ // *** Addresses checked in rx hook *** // EV, ICE, HYBRID: ACCELERATOR (0x35), ACCELERATOR_BRAKE_ALT (0x100), ACCELERATOR_ALT (0x105) @@ -49,10 +49,6 @@ static bool hyundai_canfd_alt_buttons = false; static bool hyundai_canfd_lka_steering_alt = false; static bool hyundai_ccnc = false; -static bool get_hyundai_ccnc(void) { - return hyundai_ccnc; -} - static int hyundai_canfd_get_lka_addr(void) { return hyundai_canfd_lka_steering_alt ? 0x110 : 0x50; } @@ -223,6 +219,34 @@ static bool hyundai_canfd_tx_hook(const CANPacket_t *to_send) { return tx; } +static bool hyundai_canfd_fwd_hook(int bus_num, int addr) { + bool block_msg = false; + + if (bus_num == 0) { + block_msg = ((hyundai_ccnc) && (((addr) == 0xEA) || ((addr) == 0x7C4))); + } else if (bus_num == 2) { + // LKAS for cars with LKAS and LFA messages, LFA for cars with no LKAS messages + int lfa_block_addr = hyundai_canfd_lka_steering_alt ? 0x362 : 0x2a4; + bool is_lka_msg = ((addr == hyundai_canfd_get_lka_addr()) || (addr == lfa_block_addr)) && hyundai_canfd_lka_steering; + bool is_lfa_msg = ((addr == 0x12a) && !hyundai_canfd_lka_steering); + + // HUD icons + bool is_lfahda_msg = ((addr == 0x1e0) && !hyundai_canfd_lka_steering); + + // SCC_CONTROL and ADRV_0x160 for camera SCC cars, we send our own longitudinal commands and to show FCA light + bool is_scc_msg = (((addr == 0x1a0) || (!hyundai_ccnc && (addr == 0x160))) && hyundai_longitudinal && !hyundai_canfd_lka_steering); + + // CCNC messages + bool is_ccnc_msg = (addr == 0x161) || (addr == 0x162); + + block_msg = is_lka_msg || is_lfa_msg || is_lfahda_msg || is_scc_msg || is_ccnc_msg; + } else { + block_msg = false; + } + + return block_msg; +} + static safety_config hyundai_canfd_init(uint16_t param) { const int HYUNDAI_PARAM_CANFD_LKA_STEERING_ALT = 128; const int HYUNDAI_PARAM_CANFD_ALT_BUTTONS = 32; @@ -240,13 +264,13 @@ static safety_config hyundai_canfd_init(uint16_t param) { HYUNDAI_CANFD_LKA_STEERING_COMMON_TX_MSGS(0, 1) HYUNDAI_CANFD_LFA_STEERING_COMMON_TX_MSGS(1) HYUNDAI_CANFD_SCC_CONTROL_COMMON_TX_MSGS(1, true) - {0x51, 0, 32, .check_relay = false}, // ADRV_0x51 - {0x730, 1, 8, .check_relay = false}, // tester present for ADAS ECU disable - {0x160, 1, 16, .check_relay = false}, // ADRV_0x160 - {0x1EA, 1, 32, .check_relay = false}, // ADRV_0x1ea - {0x200, 1, 8, .check_relay = false}, // ADRV_0x200 - {0x345, 1, 8, .check_relay = false}, // ADRV_0x345 - {0x1DA, 1, 32, .check_relay = false}, // ADRV_0x1da + {0x51, 0, 32, false}, // ADRV_0x51 + {0x730, 1, 8, false}, // tester present for ADAS ECU disable + {0x160, 1, 16, false}, // ADRV_0x160 + {0x1EA, 1, 32, false}, // ADRV_0x1ea + {0x200, 1, 8, false}, // ADRV_0x200 + {0x345, 1, 8, false}, // ADRV_0x345 + {0x1DA, 1, 32, false}, // ADRV_0x1da }; static const CanMsg HYUNDAI_CANFD_LFA_STEERING_TX_MSGS[] = { @@ -255,30 +279,21 @@ static safety_config hyundai_canfd_init(uint16_t param) { HYUNDAI_CANFD_SCC_CONTROL_COMMON_TX_MSGS(0, false) }; - // ADRV_0x160 is checked for radar liveness static const CanMsg HYUNDAI_CANFD_LFA_STEERING_LONG_TX_MSGS[] = { HYUNDAI_CANFD_CRUISE_BUTTON_TX_MSGS(2) HYUNDAI_CANFD_LFA_STEERING_COMMON_TX_MSGS(0) HYUNDAI_CANFD_SCC_CONTROL_COMMON_TX_MSGS(0, true) - {0x160, 0, 16, .check_relay = true}, // ADRV_0x160 - {0x7D0, 0, 8, .check_relay = false}, // tester present for radar ECU disable + {0x160, 0, 16, false}, // ADRV_0x160 + {0x7D0, 0, 8, false}, // tester present for radar ECU disable }; - // ADRV_0x160 is checked for relay malfunction #define HYUNDAI_CANFD_LFA_STEERING_CAMERA_SCC_TX_MSGS(longitudinal) \ HYUNDAI_CANFD_CRUISE_BUTTON_TX_MSGS(2) \ HYUNDAI_CANFD_LFA_STEERING_COMMON_TX_MSGS(0) \ HYUNDAI_CANFD_SCC_CONTROL_COMMON_TX_MSGS(0, (longitudinal)) \ - {0x160, 0, 16, .check_relay = (longitudinal)}, /* ADRV_0x160 */ \ - -#define HYUNDAI_CANFD_LFA_STEERING_CAMERA_SCC_CCNC_TX_MSGS(longitudinal) \ - HYUNDAI_CANFD_CRUISE_BUTTON_TX_MSGS(2) \ - HYUNDAI_CANFD_LFA_STEERING_COMMON_TX_MSGS(0) \ - HYUNDAI_CANFD_SCC_CONTROL_COMMON_TX_MSGS(0, (longitudinal)) \ - {0x161, 0, 32, .check_relay = true}, /* CCNC_0x161 */ \ - {0x162, 0, 32, .check_relay = true}, /* CCNC_0x162 */ \ - {0x7C4, 2, 8, .check_relay = true}, /* 0x7C4 */ \ - {0xEA, 2, 24, .check_relay = true}, /* MDPS */ \ + {0x160, 0, 16, false}, /* ADRV_0x160 */ \ + {0x161, 0, 32, false}, /* CCNC_0x161 */ \ + {0x162, 0, 32, false}, /* CCNC_0x162 */ \ hyundai_common_init(param); @@ -310,10 +325,6 @@ static safety_config hyundai_canfd_init(uint16_t param) { HYUNDAI_CANFD_LFA_STEERING_CAMERA_SCC_TX_MSGS(true) }; - static CanMsg hyundai_canfd_lfa_steering_camera_scc_ccnc_tx_msgs[] = { - HYUNDAI_CANFD_LFA_STEERING_CAMERA_SCC_CCNC_TX_MSGS(true) - }; - if (hyundai_canfd_alt_buttons) { SET_RX_CHECKS(hyundai_canfd_alt_buttons_long_rx_checks, ret); } else { @@ -321,11 +332,7 @@ static safety_config hyundai_canfd_init(uint16_t param) { } if (hyundai_camera_scc) { - if (get_hyundai_ccnc()) { - SET_TX_MSGS(hyundai_canfd_lfa_steering_camera_scc_ccnc_tx_msgs, ret); // LCOV_EXCL_LINE - } else { - SET_TX_MSGS(hyundai_canfd_lfa_steering_camera_scc_tx_msgs, ret); - } + SET_TX_MSGS(hyundai_canfd_lfa_steering_camera_scc_tx_msgs, ret); } else { SET_TX_MSGS(HYUNDAI_CANFD_LFA_STEERING_LONG_TX_MSGS, ret); } @@ -386,15 +393,7 @@ static safety_config hyundai_canfd_init(uint16_t param) { HYUNDAI_CANFD_LFA_STEERING_CAMERA_SCC_TX_MSGS(false) }; - static CanMsg hyundai_canfd_lfa_steering_camera_scc_ccnc_tx_msgs[] = { - HYUNDAI_CANFD_LFA_STEERING_CAMERA_SCC_CCNC_TX_MSGS(false) - }; - - if (get_hyundai_ccnc()) { - SET_TX_MSGS(hyundai_canfd_lfa_steering_camera_scc_ccnc_tx_msgs, ret); // LCOV_EXCL_LINE - } else { - SET_TX_MSGS(hyundai_canfd_lfa_steering_camera_scc_tx_msgs, ret); - } + SET_TX_MSGS(hyundai_canfd_lfa_steering_camera_scc_tx_msgs, ret); if (hyundai_canfd_alt_buttons) { SET_RX_CHECKS(hyundai_canfd_alt_buttons_rx_checks, ret); @@ -411,6 +410,7 @@ const safety_hooks hyundai_canfd_hooks = { .init = hyundai_canfd_init, .rx = hyundai_canfd_rx_hook, .tx = hyundai_canfd_tx_hook, + .fwd = hyundai_canfd_fwd_hook, .get_counter = hyundai_canfd_get_counter, .get_checksum = hyundai_canfd_get_checksum, .compute_checksum = hyundai_common_canfd_compute_checksum, diff --git a/opendbc/safety/safety/safety_mazda.h b/opendbc/safety/safety/safety_mazda.h index 87088353597..2723cbb88fd 100644 --- a/opendbc/safety/safety/safety_mazda.h +++ b/opendbc/safety/safety/safety_mazda.h @@ -88,8 +88,18 @@ static bool mazda_tx_hook(const CANPacket_t *to_send) { return tx; } +static bool mazda_fwd_hook(int bus, int addr) { + bool block_msg = false; + + if (bus == MAZDA_CAM) { + block_msg = (addr == MAZDA_LKAS) || (addr == MAZDA_LKAS_HUD); + } + + return block_msg; +} + static safety_config mazda_init(uint16_t param) { - static const CanMsg MAZDA_TX_MSGS[] = {{MAZDA_LKAS, 0, 8, .check_relay = true}, {MAZDA_CRZ_BTNS, 0, 8, .check_relay = false}, {MAZDA_LKAS_HUD, 0, 8, .check_relay = true}}; + static const CanMsg MAZDA_TX_MSGS[] = {{MAZDA_LKAS, 0, 8, true}, {MAZDA_CRZ_BTNS, 0, 8, false}, {MAZDA_LKAS_HUD, 0, 8, false}}; static RxCheck mazda_rx_checks[] = { {.msg = {{MAZDA_CRZ_CTRL, 0, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 50U}, { 0 }, { 0 }}}, @@ -107,4 +117,5 @@ const safety_hooks mazda_hooks = { .init = mazda_init, .rx = mazda_rx_hook, .tx = mazda_tx_hook, + .fwd = mazda_fwd_hook, }; diff --git a/opendbc/safety/safety/safety_nissan.h b/opendbc/safety/safety/safety_nissan.h index dd2ad67720b..30b971f22c0 100644 --- a/opendbc/safety/safety/safety_nissan.h +++ b/opendbc/safety/safety/safety_nissan.h @@ -100,14 +100,29 @@ static bool nissan_tx_hook(const CANPacket_t *to_send) { } +static bool nissan_fwd_hook(int bus_num, int addr) { + bool block_msg = false; + + if (bus_num == 0) { + block_msg = (addr == 0x280); // CANCEL_MSG + } + + if (bus_num == 2) { + // 0x169 is LKAS, 0x2b1 LKAS_HUD, 0x4cc LKAS_HUD_INFO_MSG + block_msg = ((addr == 0x169) || (addr == 0x2b1) || (addr == 0x4cc)); + } + + return block_msg; +} + static safety_config nissan_init(uint16_t param) { static const CanMsg NISSAN_TX_MSGS[] = { - {0x169, 0, 8, .check_relay = true}, // LKAS - {0x2b1, 0, 8, .check_relay = true}, // PROPILOT_HUD - {0x4cc, 0, 8, .check_relay = true}, // PROPILOT_HUD_INFO_MSG - {0x20b, 2, 6, .check_relay = false}, // CRUISE_THROTTLE (X-Trail) - {0x20b, 1, 6, .check_relay = false}, // CRUISE_THROTTLE (Altima) - {0x280, 2, 8, .check_relay = true} // CANCEL_MSG (Leaf) + {0x169, 0, 8, true}, // LKAS + {0x2b1, 0, 8, false}, // PROPILOT_HUD + {0x4cc, 0, 8, false}, // PROPILOT_HUD_INFO_MSG + {0x20b, 2, 6, false}, // CRUISE_THROTTLE (X-Trail) + {0x20b, 1, 6, false}, // CRUISE_THROTTLE (Altima) + {0x280, 2, 8, false} // CANCEL_MSG (Leaf) }; // Signals duplicated below due to the fact that these messages can come in on either CAN bus, depending on car model. @@ -137,4 +152,5 @@ const safety_hooks nissan_hooks = { .init = nissan_init, .rx = nissan_rx_hook, .tx = nissan_tx_hook, + .fwd = nissan_fwd_hook, }; diff --git a/opendbc/safety/safety/safety_rivian.h b/opendbc/safety/safety/safety_rivian.h index 1f6d8b722b1..3a1259048cd 100644 --- a/opendbc/safety/safety/safety_rivian.h +++ b/opendbc/safety/safety/safety_rivian.h @@ -4,6 +4,8 @@ #define RIVIAN_MAX_SPEED_DELTA 2.0 // m/s +static bool rivian_longitudinal = false; + static uint8_t rivian_get_counter(const CANPacket_t *to_push) { int addr = GET_ADDR(to_push); @@ -169,13 +171,43 @@ static bool rivian_tx_hook(const CANPacket_t *to_send) { return tx; } +static bool rivian_fwd_hook(int bus, int addr) { + bool block_msg = false; + + if (bus == 0) { + // SCCM_WheelTouch: for hiding hold wheel alert + if (addr == 0x321) { + block_msg = true; + } + + // VDM_AdasSts: for canceling stock ACC + // cppcheck-suppress knownConditionTrueFalse + if ((addr == 0x162) && !rivian_longitudinal) { + block_msg = true; + } + } + + if (bus == 2) { + // ACM_lkaHbaCmd: lateral control message + if (addr == 0x120) { + block_msg = true; + } + + // ACM_longitudinalRequest: longitudinal control message + // cppcheck-suppress knownConditionTrueFalse + if (rivian_longitudinal && (addr == 0x160)) { + block_msg = true; + } + } + + return block_msg; +} + static safety_config rivian_init(uint16_t param) { - // SCCM_WheelTouch: for hiding hold wheel alert - // VDM_AdasSts: for canceling stock ACC // 0x120 = ACM_lkaHbaCmd, 0x321 = SCCM_WheelTouch, 0x162 = VDM_AdasSts - static const CanMsg RIVIAN_TX_MSGS[] = {{0x120, 0, 8, .check_relay = true}, {0x321, 2, 7, .check_relay = true}, {0x162, 2, 8, .check_relay = true}}; + static const CanMsg RIVIAN_TX_MSGS[] = {{0x120, 0, 8, true}, {0x321, 2, 7, false}, {0x162, 2, 8, false}}; // 0x160 = ACM_longitudinalRequest - static const CanMsg RIVIAN_LONG_TX_MSGS[] = {{0x120, 0, 8, .check_relay = true}, {0x321, 2, 7, .check_relay = true}, {0x160, 0, 5, .check_relay = true}}; + static const CanMsg RIVIAN_LONG_TX_MSGS[] = {{0x120, 0, 8, true}, {0x321, 2, 7, false}, {0x160, 0, 5, true}}; static RxCheck rivian_rx_checks[] = { {.msg = {{0x208, 0, 8, .frequency = 50U, .max_counter = 14U, .quality_flag = true}, { 0 }, { 0 }}}, // ESP_Status (speed) @@ -185,8 +217,6 @@ static safety_config rivian_init(uint16_t param) { {.msg = {{0x100, 2, 8, .frequency = 100U, .ignore_checksum = true, .ignore_counter = true}, { 0 }, { 0 }}}, // ACM_Status (cruise state) }; - bool rivian_longitudinal = false; - UNUSED(param); #ifdef ALLOW_DEBUG const int FLAG_RIVIAN_LONG_CONTROL = 1; @@ -204,6 +234,7 @@ const safety_hooks rivian_hooks = { .init = rivian_init, .rx = rivian_rx_hook, .tx = rivian_tx_hook, + .fwd = rivian_fwd_hook, .get_counter = rivian_get_counter, .get_checksum = rivian_get_checksum, .compute_checksum = rivian_compute_checksum, diff --git a/opendbc/safety/safety/safety_subaru.h b/opendbc/safety/safety/safety_subaru.h index 17da4067fc5..3b43d392a39 100644 --- a/opendbc/safety/safety/safety_subaru.h +++ b/opendbc/safety/safety/safety_subaru.h @@ -43,25 +43,22 @@ #define SUBARU_ALT_BUS 1 #define SUBARU_CAM_BUS 2 -#define SUBARU_BASE_TX_MSGS(alt_bus, lkas_msg) \ - {lkas_msg, SUBARU_MAIN_BUS, 8, .check_relay = true}, \ - {MSG_SUBARU_ES_DashStatus, SUBARU_MAIN_BUS, 8, .check_relay = true}, \ - {MSG_SUBARU_ES_LKAS_State, SUBARU_MAIN_BUS, 8, .check_relay = true}, \ - {MSG_SUBARU_ES_Infotainment, SUBARU_MAIN_BUS, 8, .check_relay = true}, \ - -#define SUBARU_COMMON_TX_MSGS(alt_bus) \ - {MSG_SUBARU_ES_Distance, alt_bus, 8, .check_relay = false}, \ - -#define SUBARU_COMMON_LONG_TX_MSGS(alt_bus) \ - {MSG_SUBARU_ES_Distance, alt_bus, 8, .check_relay = true}, \ - {MSG_SUBARU_ES_Brake, alt_bus, 8, .check_relay = true}, \ - {MSG_SUBARU_ES_Status, alt_bus, 8, .check_relay = true}, \ - -#define SUBARU_GEN2_LONG_ADDITIONAL_TX_MSGS() \ - {MSG_SUBARU_ES_UDS_Request, SUBARU_CAM_BUS, 8, .check_relay = false}, \ - {MSG_SUBARU_ES_HighBeamAssist, SUBARU_MAIN_BUS, 8, .check_relay = false}, \ - {MSG_SUBARU_ES_STATIC_1, SUBARU_MAIN_BUS, 8, .check_relay = false}, \ - {MSG_SUBARU_ES_STATIC_2, SUBARU_MAIN_BUS, 8, .check_relay = false}, \ +#define SUBARU_COMMON_TX_MSGS(alt_bus, lkas_msg) \ + {lkas_msg, SUBARU_MAIN_BUS, 8, true}, \ + {MSG_SUBARU_ES_Distance, alt_bus, 8, false}, \ + {MSG_SUBARU_ES_DashStatus, SUBARU_MAIN_BUS, 8, false}, \ + {MSG_SUBARU_ES_LKAS_State, SUBARU_MAIN_BUS, 8, false}, \ + {MSG_SUBARU_ES_Infotainment, SUBARU_MAIN_BUS, 8, false}, \ + +#define SUBARU_COMMON_LONG_TX_MSGS(alt_bus) \ + {MSG_SUBARU_ES_Brake, alt_bus, 8, false}, \ + {MSG_SUBARU_ES_Status, alt_bus, 8, false}, \ + +#define SUBARU_GEN2_LONG_ADDITIONAL_TX_MSGS() \ + {MSG_SUBARU_ES_UDS_Request, SUBARU_CAM_BUS, 8, false}, \ + {MSG_SUBARU_ES_HighBeamAssist, SUBARU_MAIN_BUS, 8, false}, \ + {MSG_SUBARU_ES_STATIC_1, SUBARU_MAIN_BUS, 8, false}, \ + {MSG_SUBARU_ES_STATIC_2, SUBARU_MAIN_BUS, 8, false}, \ #define SUBARU_COMMON_RX_CHECKS(alt_bus) \ {.msg = {{MSG_SUBARU_Throttle, SUBARU_MAIN_BUS, 8, .max_counter = 15U, .frequency = 100U}, { 0 }, { 0 }}}, \ @@ -207,24 +204,42 @@ static bool subaru_tx_hook(const CANPacket_t *to_send) { return tx; } +static bool subaru_fwd_hook(int bus_num, int addr) { + bool block_msg = false; + + if (bus_num == SUBARU_CAM_BUS) { + // Global platform + bool block_lkas = ((addr == MSG_SUBARU_ES_LKAS) || + (addr == MSG_SUBARU_ES_DashStatus) || + (addr == MSG_SUBARU_ES_LKAS_State) || + (addr == MSG_SUBARU_ES_Infotainment)); + + bool block_long = ((addr == MSG_SUBARU_ES_Brake) || + (addr == MSG_SUBARU_ES_Distance) || + (addr == MSG_SUBARU_ES_Status)); + + block_msg = block_lkas || (subaru_longitudinal && block_long); + } + + return block_msg; +} + static safety_config subaru_init(uint16_t param) { static const CanMsg SUBARU_TX_MSGS[] = { - SUBARU_BASE_TX_MSGS(SUBARU_MAIN_BUS, MSG_SUBARU_ES_LKAS) - SUBARU_COMMON_TX_MSGS(SUBARU_MAIN_BUS) + SUBARU_COMMON_TX_MSGS(SUBARU_MAIN_BUS, MSG_SUBARU_ES_LKAS) }; static const CanMsg SUBARU_LONG_TX_MSGS[] = { - SUBARU_BASE_TX_MSGS(SUBARU_MAIN_BUS, MSG_SUBARU_ES_LKAS) + SUBARU_COMMON_TX_MSGS(SUBARU_MAIN_BUS, MSG_SUBARU_ES_LKAS) SUBARU_COMMON_LONG_TX_MSGS(SUBARU_MAIN_BUS) }; static const CanMsg SUBARU_GEN2_TX_MSGS[] = { - SUBARU_BASE_TX_MSGS(SUBARU_ALT_BUS, MSG_SUBARU_ES_LKAS) - SUBARU_COMMON_TX_MSGS(SUBARU_ALT_BUS) + SUBARU_COMMON_TX_MSGS(SUBARU_ALT_BUS, MSG_SUBARU_ES_LKAS) }; static const CanMsg SUBARU_GEN2_LONG_TX_MSGS[] = { - SUBARU_BASE_TX_MSGS(SUBARU_ALT_BUS, MSG_SUBARU_ES_LKAS) + SUBARU_COMMON_TX_MSGS(SUBARU_ALT_BUS, MSG_SUBARU_ES_LKAS) SUBARU_COMMON_LONG_TX_MSGS(SUBARU_ALT_BUS) SUBARU_GEN2_LONG_ADDITIONAL_TX_MSGS() }; @@ -261,6 +276,7 @@ const safety_hooks subaru_hooks = { .init = subaru_init, .rx = subaru_rx_hook, .tx = subaru_tx_hook, + .fwd = subaru_fwd_hook, .get_counter = subaru_get_counter, .get_checksum = subaru_get_checksum, .compute_checksum = subaru_compute_checksum, diff --git a/opendbc/safety/safety/safety_subaru_preglobal.h b/opendbc/safety/safety/safety_subaru_preglobal.h index f477d8cfce1..b985c7b7f77 100644 --- a/opendbc/safety/safety/safety_subaru_preglobal.h +++ b/opendbc/safety/safety/safety_subaru_preglobal.h @@ -82,10 +82,20 @@ static bool subaru_preglobal_tx_hook(const CANPacket_t *to_send) { return tx; } +static bool subaru_preglobal_fwd_hook(int bus_num, int addr) { + bool block_msg = false; + + if (bus_num == SUBARU_PG_CAM_BUS) { + block_msg = ((addr == MSG_SUBARU_PG_ES_Distance) || (addr == MSG_SUBARU_PG_ES_LKAS)); + } + + return block_msg; +} + static safety_config subaru_preglobal_init(uint16_t param) { static const CanMsg SUBARU_PG_TX_MSGS[] = { - {MSG_SUBARU_PG_ES_Distance, SUBARU_PG_MAIN_BUS, 8, .check_relay = true}, - {MSG_SUBARU_PG_ES_LKAS, SUBARU_PG_MAIN_BUS, 8, .check_relay = true} + {MSG_SUBARU_PG_ES_Distance, SUBARU_PG_MAIN_BUS, 8, false}, + {MSG_SUBARU_PG_ES_LKAS, SUBARU_PG_MAIN_BUS, 8, true} }; // TODO: do checksum and counter checks after adding the signals to the outback dbc file @@ -107,4 +117,5 @@ const safety_hooks subaru_preglobal_hooks = { .init = subaru_preglobal_init, .rx = subaru_preglobal_rx_hook, .tx = subaru_preglobal_tx_hook, + .fwd = subaru_preglobal_fwd_hook, }; diff --git a/opendbc/safety/safety/safety_tesla.h b/opendbc/safety/safety/safety_tesla.h index 9083ad54bcd..26b7098adb1 100644 --- a/opendbc/safety/safety/safety_tesla.h +++ b/opendbc/safety/safety/safety_tesla.h @@ -146,6 +146,11 @@ static bool tesla_fwd_hook(int bus_num, int addr) { bool block_msg = false; if (bus_num == 2) { + // DAS_steeringControl, APS_eacMonitor + if ((addr == 0x488) || (addr == 0x27d)) { + block_msg = true; + } + // DAS_control if (tesla_longitudinal && (addr == 0x2b9) && !tesla_stock_aeb) { block_msg = true; @@ -158,15 +163,15 @@ static bool tesla_fwd_hook(int bus_num, int addr) { static safety_config tesla_init(uint16_t param) { static const CanMsg TESLA_M3_Y_TX_MSGS[] = { - {0x488, 0, 4, .check_relay = true}, // DAS_steeringControl - {0x2b9, 0, 8, .check_relay = false}, // DAS_control (for cancel) - {0x27D, 0, 3, .check_relay = true}, // APS_eacMonitor + {0x488, 0, 4, true}, // DAS_steeringControl + {0x2b9, 0, 8, false}, // DAS_control (for cancel) + {0x27D, 0, 3, true}, // APS_eacMonitor }; static const CanMsg TESLA_M3_Y_LONG_TX_MSGS[] = { - {0x488, 0, 4, .check_relay = true}, // DAS_steeringControl - {0x2b9, 0, 8, .check_relay = true, .disable_static_blocking = true}, // DAS_control - {0x27D, 0, 3, .check_relay = true}, // APS_eacMonitor + {0x488, 0, 4, true}, // DAS_steeringControl + {0x2b9, 0, 8, true}, // DAS_control + {0x27D, 0, 3, true}, // APS_eacMonitor }; UNUSED(param); @@ -178,13 +183,13 @@ static safety_config tesla_init(uint16_t param) { tesla_stock_aeb = false; static RxCheck tesla_model3_y_rx_checks[] = { - {.msg = {{0x2b9, 2, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 25U}, { 0 }, { 0 }}}, // DAS_control - {.msg = {{0x257, 0, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 50U}, { 0 }, { 0 }}}, // DI_speed (speed in kph) - {.msg = {{0x370, 0, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 100U}, { 0 }, { 0 }}}, // EPAS3S_internalSAS (steering angle) - {.msg = {{0x118, 0, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 100U}, { 0 }, { 0 }}}, // DI_systemStatus (gas pedal) - {.msg = {{0x39d, 0, 5, .ignore_checksum = true, .ignore_counter = true, .frequency = 25U}, { 0 }, { 0 }}}, // IBST_status (brakes) - {.msg = {{0x286, 0, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 10U}, { 0 }, { 0 }}}, // DI_state (acc state) - {.msg = {{0x311, 0, 7, .ignore_checksum = true, .ignore_counter = true, .frequency = 10U}, { 0 }, { 0 }}}, // UI_warning (blinkers, buckle switch & doors) + {.msg = {{0x2b9, 2, 8, .ignore_checksum = true, .ignore_counter = true,.frequency = 25U}, { 0 }, { 0 }}}, // DAS_control + {.msg = {{0x257, 0, 8, .ignore_checksum = true, .ignore_counter = true,.frequency = 50U}, { 0 }, { 0 }}}, // DI_speed (speed in kph) + {.msg = {{0x370, 0, 8, .ignore_checksum = true, .ignore_counter = true,.frequency = 100U}, { 0 }, { 0 }}}, // EPAS3S_internalSAS (steering angle) + {.msg = {{0x118, 0, 8, .ignore_checksum = true, .ignore_counter = true,.frequency = 100U}, { 0 }, { 0 }}}, // DI_systemStatus (gas pedal) + {.msg = {{0x39d, 0, 5, .ignore_checksum = true, .ignore_counter = true,.frequency = 25U}, { 0 }, { 0 }}}, // IBST_status (brakes) + {.msg = {{0x286, 0, 8, .ignore_checksum = true, .ignore_counter = true,.frequency = 10U}, { 0 }, { 0 }}}, // DI_state (acc state) + {.msg = {{0x311, 0, 7, .ignore_checksum = true, .ignore_counter = true,.frequency = 10U}, { 0 }, { 0 }}}, // UI_warning (blinkers, buckle switch & doors) }; safety_config ret; diff --git a/opendbc/safety/safety/safety_toyota.h b/opendbc/safety/safety/safety_toyota.h index d97d6178f10..d9210ec825b 100644 --- a/opendbc/safety/safety/safety_toyota.h +++ b/opendbc/safety/safety/safety_toyota.h @@ -4,32 +4,25 @@ // Stock longitudinal #define TOYOTA_BASE_TX_MSGS \ - {0x191, 0, 8, .check_relay = true}, {0x412, 0, 8, .check_relay = true}, {0x1D2, 0, 8, .check_relay = false}, /* LKAS + LTA + PCM cancel cmd */ \ + {0x191, 0, 8, false}, {0x412, 0, 8, false}, {0x1D2, 0, 8, false}, /* LKAS + LTA + PCM cancel cmd */ \ #define TOYOTA_COMMON_TX_MSGS \ TOYOTA_BASE_TX_MSGS \ - {0x2E4, 0, 5, .check_relay = true}, \ - {0x343, 0, 8, .check_relay = false}, /* ACC cancel cmd */ \ + {0x2E4, 0, 5, true}, \ + {0x343, 0, 8, false}, /* ACC cancel cmd */ \ #define TOYOTA_COMMON_SECOC_TX_MSGS \ TOYOTA_BASE_TX_MSGS \ - {0x2E4, 0, 8, .check_relay = true}, {0x131, 0, 8, .check_relay = true}, \ - {0x343, 0, 8, .check_relay = false}, /* ACC cancel cmd */ \ - -#define TOYOTA_COMMON_LONG_TX_MSGS \ - TOYOTA_COMMON_TX_MSGS \ - /* DSU bus 0 */ \ - {0x283, 0, 7, .check_relay = false}, {0x2E6, 0, 8, .check_relay = false}, {0x2E7, 0, 8, .check_relay = false}, {0x33E, 0, 7, .check_relay = false}, \ - {0x344, 0, 8, .check_relay = false}, {0x365, 0, 7, .check_relay = false}, {0x366, 0, 7, .check_relay = false}, {0x4CB, 0, 8, .check_relay = false}, \ - /* DSU bus 1 */ \ - {0x128, 1, 6, .check_relay = false}, {0x141, 1, 4, .check_relay = false}, {0x160, 1, 8, .check_relay = false}, {0x161, 1, 7, .check_relay = false}, \ - {0x470, 1, 4, .check_relay = false}, \ - /* PCS_HUD */ \ - {0x411, 0, 8, .check_relay = false}, \ - /* radar diagnostic address */ \ - {0x750, 0, 8, .check_relay = false}, \ - /* ACC */ \ - {0x343, 0, 8, .check_relay = true}, \ + {0x2E4, 0, 8, true}, {0x131, 0, 8, false}, \ + {0x343, 0, 8, false}, /* ACC cancel cmd */ \ + +#define TOYOTA_COMMON_LONG_TX_MSGS \ + TOYOTA_COMMON_TX_MSGS \ + {0x283, 0, 7, false}, {0x2E6, 0, 8, false}, {0x2E7, 0, 8, false}, {0x33E, 0, 7, false}, {0x344, 0, 8, false}, {0x365, 0, 7, false}, {0x366, 0, 7, false}, {0x4CB, 0, 8, false}, /* DSU bus 0 */ \ + {0x128, 1, 6, false}, {0x141, 1, 4, false}, {0x160, 1, 8, false}, {0x161, 1, 7, false}, {0x470, 1, 4, false}, /* DSU bus 1 */ \ + {0x411, 0, 8, false}, /* PCS_HUD */ \ + {0x750, 0, 8, false}, /* radar diagnostic address */ \ + {0x343, 0, 8, true}, /* ACC */ \ #define TOYOTA_COMMON_RX_CHECKS(lta) \ {.msg = {{ 0xaa, 0, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 83U}, { 0 }, { 0 }}}, \ @@ -405,10 +398,27 @@ static safety_config toyota_init(uint16_t param) { return ret; } +static bool toyota_fwd_hook(int bus_num, int addr) { + bool block_msg = false; + if (bus_num == 2) { + // block stock lkas messages and stock acc messages (if OP is doing ACC) + // in TSS2, 0x191 is LTA which we need to block to avoid controls collision + bool is_lkas_msg = ((addr == 0x2E4) || (addr == 0x412) || (addr == 0x191)); + // on SecOC cars 0x131 is also LTA + is_lkas_msg |= toyota_secoc && (addr == 0x131); + // in TSS2 the camera does ACC as well, so filter 0x343 + bool is_acc_msg = (addr == 0x343); + block_msg = is_lkas_msg || (is_acc_msg && !toyota_stock_longitudinal); + } + + return block_msg; +} + const safety_hooks toyota_hooks = { .init = toyota_init, .rx = toyota_rx_hook, .tx = toyota_tx_hook, + .fwd = toyota_fwd_hook, .get_checksum = toyota_get_checksum, .compute_checksum = toyota_compute_checksum, .get_quality_flag_valid = toyota_get_quality_flag_valid, diff --git a/opendbc/safety/safety/safety_volkswagen_mqb.h b/opendbc/safety/safety/safety_volkswagen_mqb.h index a87f9b3cfd2..ebbff4969fb 100644 --- a/opendbc/safety/safety/safety_volkswagen_mqb.h +++ b/opendbc/safety/safety/safety_volkswagen_mqb.h @@ -9,12 +9,11 @@ static bool volkswagen_mqb_brake_pressure_detected = false; static safety_config volkswagen_mqb_init(uint16_t param) { // Transmit of GRA_ACC_01 is allowed on bus 0 and 2 to keep compatibility with gateway and camera integration - // MSG_LH_EPS_03: openpilot needs to replace apparent driver steering input torque to pacify VW Emergency Assist - static const CanMsg VOLKSWAGEN_MQB_STOCK_TX_MSGS[] = {{MSG_HCA_01, 0, 8, .check_relay = true}, {MSG_GRA_ACC_01, 0, 8, .check_relay = false}, {MSG_GRA_ACC_01, 2, 8, .check_relay = false}, - {MSG_LDW_02, 0, 8, .check_relay = true}, {MSG_LH_EPS_03, 2, 8, .check_relay = true}}; + static const CanMsg VOLKSWAGEN_MQB_STOCK_TX_MSGS[] = {{MSG_HCA_01, 0, 8, true}, {MSG_GRA_ACC_01, 0, 8, false}, {MSG_GRA_ACC_01, 2, 8, false}, + {MSG_LDW_02, 0, 8, false}, {MSG_LH_EPS_03, 2, 8, false}}; - static const CanMsg VOLKSWAGEN_MQB_LONG_TX_MSGS[] = {{MSG_HCA_01, 0, 8, .check_relay = true}, {MSG_LDW_02, 0, 8, .check_relay = true}, {MSG_LH_EPS_03, 2, 8, .check_relay = true}, - {MSG_ACC_02, 0, 8, .check_relay = true}, {MSG_ACC_06, 0, 8, .check_relay = true}, {MSG_ACC_07, 0, 8, .check_relay = true}}; + static const CanMsg VOLKSWAGEN_MQB_LONG_TX_MSGS[] = {{MSG_HCA_01, 0, 8, true}, {MSG_LDW_02, 0, 8, false}, {MSG_LH_EPS_03, 2, 8, false}, + {MSG_ACC_02, 0, 8, false}, {MSG_ACC_06, 0, 8, false}, {MSG_ACC_07, 0, 8, false}}; static RxCheck volkswagen_mqb_rx_checks[] = { {.msg = {{MSG_ESP_19, 0, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 100U}, { 0 }, { 0 }}}, @@ -201,10 +200,38 @@ static bool volkswagen_mqb_tx_hook(const CANPacket_t *to_send) { return tx; } +static bool volkswagen_mqb_fwd_hook(int bus_num, int addr) { + bool block_msg = false; + + switch (bus_num) { + case 0: + if (addr == MSG_LH_EPS_03) { + // openpilot needs to replace apparent driver steering input torque to pacify VW Emergency Assist + block_msg = true; + } + break; + case 2: + if ((addr == MSG_HCA_01) || (addr == MSG_LDW_02)) { + // openpilot takes over LKAS steering control and related HUD messages from the camera + block_msg = true; + } else if (volkswagen_longitudinal && ((addr == MSG_ACC_02) || (addr == MSG_ACC_06) || (addr == MSG_ACC_07))) { + // openpilot takes over acceleration/braking control and related HUD messages from the stock ACC radar + block_msg = true; + } else { + } + break; + default: + break; + } + + return block_msg; +} + const safety_hooks volkswagen_mqb_hooks = { .init = volkswagen_mqb_init, .rx = volkswagen_mqb_rx_hook, .tx = volkswagen_mqb_tx_hook, + .fwd = volkswagen_mqb_fwd_hook, .get_counter = volkswagen_mqb_meb_get_counter, .get_checksum = volkswagen_mqb_meb_get_checksum, .compute_checksum = volkswagen_mqb_meb_compute_crc, diff --git a/opendbc/safety/safety/safety_volkswagen_pq.h b/opendbc/safety/safety/safety_volkswagen_pq.h index 193a1254422..c4cf014fa2f 100644 --- a/opendbc/safety/safety/safety_volkswagen_pq.h +++ b/opendbc/safety/safety/safety_volkswagen_pq.h @@ -52,11 +52,11 @@ static uint32_t volkswagen_pq_compute_checksum(const CANPacket_t *to_push) { static safety_config volkswagen_pq_init(uint16_t param) { // Transmit of GRA_Neu is allowed on bus 0 and 2 to keep compatibility with gateway and camera integration - static const CanMsg VOLKSWAGEN_PQ_STOCK_TX_MSGS[] = {{MSG_HCA_1, 0, 5, .check_relay = true}, {MSG_LDW_1, 0, 8, .check_relay = true}, - {MSG_GRA_NEU, 0, 4, .check_relay = false}, {MSG_GRA_NEU, 2, 4, .check_relay = false}}; + static const CanMsg VOLKSWAGEN_PQ_STOCK_TX_MSGS[] = {{MSG_HCA_1, 0, 5, true}, {MSG_LDW_1, 0, 8, false}, + {MSG_GRA_NEU, 0, 4, false}, {MSG_GRA_NEU, 2, 4, false}}; - static const CanMsg VOLKSWAGEN_PQ_LONG_TX_MSGS[] = {{MSG_HCA_1, 0, 5, .check_relay = true}, {MSG_LDW_1, 0, 8, .check_relay = true}, - {MSG_ACC_SYSTEM, 0, 8, .check_relay = true}, {MSG_ACC_GRA_ANZEIGE, 0, 8, .check_relay = true}}; + static const CanMsg VOLKSWAGEN_PQ_LONG_TX_MSGS[] = {{MSG_HCA_1, 0, 5, true}, {MSG_LDW_1, 0, 8, false}, + {MSG_ACC_SYSTEM, 0, 8, false}, {MSG_ACC_GRA_ANZEIGE, 0, 8, false}}; static RxCheck volkswagen_pq_rx_checks[] = { {.msg = {{MSG_LENKHILFE_3, 0, 6, .max_counter = 15U, .frequency = 100U}, { 0 }, { 0 }}}, @@ -217,10 +217,32 @@ static bool volkswagen_pq_tx_hook(const CANPacket_t *to_send) { return tx; } +static bool volkswagen_pq_fwd_hook(int bus_num, int addr) { + bool block_msg = false; + + switch (bus_num) { + case 2: + if ((addr == MSG_HCA_1) || (addr == MSG_LDW_1)) { + // openpilot takes over LKAS steering control and related HUD messages from the camera + block_msg = true; + } else if (volkswagen_longitudinal && ((addr == MSG_ACC_SYSTEM) || (addr == MSG_ACC_GRA_ANZEIGE))) { + // openpilot takes over acceleration/braking control and related HUD messages from the stock ACC radar + block_msg = true; + } else { + } + break; + default: + break; + } + + return block_msg; +} + const safety_hooks volkswagen_pq_hooks = { .init = volkswagen_pq_init, .rx = volkswagen_pq_rx_hook, .tx = volkswagen_pq_tx_hook, + .fwd = volkswagen_pq_fwd_hook, .get_counter = volkswagen_pq_get_counter, .get_checksum = volkswagen_pq_get_checksum, .compute_checksum = volkswagen_pq_compute_checksum, diff --git a/opendbc/safety/safety_declarations.h b/opendbc/safety/safety_declarations.h index 05a991bf5a5..03b6af2201f 100644 --- a/opendbc/safety/safety_declarations.h +++ b/opendbc/safety/safety_declarations.h @@ -3,36 +3,6 @@ #include #include -// from cereal.car.CarParams.SafetyModel -#define SAFETY_SILENT 0U -#define SAFETY_HONDA_NIDEC 1U -#define SAFETY_TOYOTA 2U -#define SAFETY_ELM327 3U -#define SAFETY_GM 4U -#define SAFETY_HONDA_BOSCH_GIRAFFE 5U -#define SAFETY_FORD 6U -#define SAFETY_HYUNDAI 8U -#define SAFETY_CHRYSLER 9U -#define SAFETY_TESLA 10U -#define SAFETY_SUBARU 11U -#define SAFETY_MAZDA 13U -#define SAFETY_NISSAN 14U -#define SAFETY_VOLKSWAGEN_MQB 15U -#define SAFETY_ALLOUTPUT 17U -#define SAFETY_GM_ASCM 18U -#define SAFETY_NOOUTPUT 19U -#define SAFETY_HONDA_BOSCH 20U -#define SAFETY_VOLKSWAGEN_PQ 21U -#define SAFETY_SUBARU_PREGLOBAL 22U -#define SAFETY_HYUNDAI_LEGACY 23U -#define SAFETY_HYUNDAI_COMMUNITY 24U -#define SAFETY_STELLANTIS 25U -#define SAFETY_FAW 26U -#define SAFETY_BODY 27U -#define SAFETY_HYUNDAI_CANFD 28U -#define SAFETY_RIVIAN 33U -#define SAFETY_VOLKSWAGEN_MEB 34U - #define GET_BIT(msg, b) ((bool)!!(((msg)->data[((b) / 8U)] >> ((b) % 8U)) & 0x1U)) #define GET_BYTE(msg, b) ((msg)->data[(b)]) #define GET_FLAG(value, mask) (((__typeof__(mask))(value) & (mask)) == (mask)) // cppcheck-suppress misra-c2012-1.2; allow __typeof__ @@ -83,8 +53,7 @@ typedef struct { int addr; int bus; int len; - bool check_relay; // if true, trigger relay malfunction if existence on destination bus and block forwarding to destination bus - bool disable_static_blocking; // if true, static blocking is disabled so safety mode can dynamically handle it (e.g. selective AEB pass-through) + bool check_relay; } CanMsg; typedef enum { @@ -215,6 +184,7 @@ typedef struct { bool safety_rx_hook(const CANPacket_t *to_push); bool safety_tx_hook(CANPacket_t *to_send); +uint32_t get_ts_elapsed(uint32_t ts, uint32_t ts_last); int to_signed(int d, int bits); void update_sample(struct sample_t *sample, int sample_new); bool get_longitudinal_allowed(void); @@ -223,6 +193,7 @@ void gen_crc_lookup_table_8(uint8_t poly, uint8_t crc_lut[]); #ifdef CANFD void gen_crc_lookup_table_16(uint16_t poly, uint16_t crc_lut[]); #endif +static void generic_rx_checks(bool stock_ecu_detected); bool steer_torque_cmd_checks(int desired_torque, int steer_req, const TorqueSteeringLimits limits); bool steer_angle_cmd_checks(int desired_angle, bool steer_control_enabled, const AngleSteeringLimits limits); bool longitudinal_accel_checks(int desired_accel, const LongitudinalLimits limits); diff --git a/opendbc/safety/tests/misra/test_mutation.py b/opendbc/safety/tests/misra/test_mutation.py index e93067e663b..1caf51a8641 100755 --- a/opendbc/safety/tests/misra/test_mutation.py +++ b/opendbc/safety/tests/misra/test_mutation.py @@ -19,7 +19,7 @@ # default (None, None, False), # general safety - ("opendbc/safety/safety/safety_toyota.h", "s/if (addr == 0x260) {/if (addr == 1 || addr == 2) {/g", True), + ("opendbc/safety/safety/safety_toyota.h", "s/is_lkas_msg =.*;/is_lkas_msg = addr == 1 || addr == 2;/g", True), ] patterns = [ diff --git a/opendbc/safety/tests/test_chrysler.py b/opendbc/safety/tests/test_chrysler.py index d8c9825664b..5510e13789e 100755 --- a/opendbc/safety/tests/test_chrysler.py +++ b/opendbc/safety/tests/test_chrysler.py @@ -10,7 +10,7 @@ class TestChryslerSafety(common.PandaCarSafetyTest, common.MotorTorqueSteeringSafetyTest): TX_MSGS = [[0x23B, 0], [0x292, 0], [0x2A6, 0]] - RELAY_MALFUNCTION_ADDRS = {0: (0x292, 0x2A6)} + RELAY_MALFUNCTION_ADDRS = {0: (0x292,)} FWD_BLACKLISTED_ADDRS = {2: [0x292, 0x2A6]} MAX_RATE_UP = 3 @@ -74,7 +74,7 @@ def test_buttons(self): class TestChryslerRamDTSafety(TestChryslerSafety): TX_MSGS = [[0xB1, 2], [0xA6, 0], [0xFA, 0]] - RELAY_MALFUNCTION_ADDRS = {0: (0xA6, 0xFA)} + RELAY_MALFUNCTION_ADDRS = {0: (0xA6,)} FWD_BLACKLISTED_ADDRS = {2: [0xA6, 0xFA]} MAX_RATE_UP = 6 @@ -97,7 +97,7 @@ def _speed_msg(self, speed): class TestChryslerRamHDSafety(TestChryslerSafety): TX_MSGS = [[0x275, 0], [0x276, 0], [0x23A, 2]] - RELAY_MALFUNCTION_ADDRS = {0: (0x276, 0x275)} + RELAY_MALFUNCTION_ADDRS = {0: (0x276,)} FWD_BLACKLISTED_ADDRS = {2: [0x275, 0x276]} MAX_TORQUE_LOOKUP = [0], [361] diff --git a/opendbc/safety/tests/test_gm.py b/opendbc/safety/tests/test_gm.py index 29a56d184d5..a92e1173989 100755 --- a/opendbc/safety/tests/test_gm.py +++ b/opendbc/safety/tests/test_gm.py @@ -18,7 +18,7 @@ class Buttons: class GmLongitudinalBase(common.PandaCarSafetyTest, common.LongitudinalGasBrakeSafetyTest): # pylint: disable=no-member,abstract-method - RELAY_MALFUNCTION_ADDRS = {0: (0x180, 0x2CB), 2: (0x184,)} # ASCMLKASteeringCmd, ASCMGasRegenCmd, PSCMStatus + RELAY_MALFUNCTION_ADDRS = {0: (0x180, 0x2CB)} # ASCMLKASteeringCmd, ASCMGasRegenCmd MAX_POSSIBLE_BRAKE = 2 ** 12 MAX_BRAKE = 400 @@ -75,7 +75,7 @@ def test_cancel_button(self): class TestGmSafetyBase(common.PandaCarSafetyTest, common.DriverTorqueSteeringSafetyTest): STANDSTILL_THRESHOLD = 10 * 0.0311 # Ensures ASCM is off on ASCM cars, and relay is not malfunctioning for camera-ACC cars - RELAY_MALFUNCTION_ADDRS = {0: (0x180,), 2: (0x184,)} # ASCMLKASteeringCmd, PSCMStatus + RELAY_MALFUNCTION_ADDRS = {0: (0x180,)} # ASCMLKASteeringCmd BUTTONS_BUS = 0 # rx or tx BRAKE_BUS = 0 # tx only @@ -148,7 +148,6 @@ class TestGmAscmSafety(GmLongitudinalBase, TestGmSafetyBase): [0xA1, 1], [0x306, 1], [0x308, 1], [0x310, 1], # obs bus [0x315, 2]] # ch bus FWD_BLACKLISTED_ADDRS: dict[int, list[int]] = {} - RELAY_MALFUNCTION_ADDRS = {0: (0x180, 0x2CB)} # ASCMLKASteeringCmd, ASCMGasRegenCmd FWD_BUS_LOOKUP: dict[int, int] = {} BRAKE_BUS = 2 @@ -210,7 +209,6 @@ class TestGmCameraLongitudinalSafety(GmLongitudinalBase, TestGmCameraSafetyBase) TX_MSGS = [[0x180, 0], [0x315, 0], [0x2CB, 0], [0x370, 0], # pt bus [0x184, 2]] # camera bus FWD_BLACKLISTED_ADDRS = {2: [0x180, 0x2CB, 0x370, 0x315], 0: [0x184]} # block LKAS, ACC messages and PSCMStatus - RELAY_MALFUNCTION_ADDRS = {0: (0x180, 0x2CB, 0x370, 0x315), 2: (0x184,)} BUTTONS_BUS = 0 # rx only MAX_GAS = 1346 diff --git a/opendbc/safety/tests/test_honda.py b/opendbc/safety/tests/test_honda.py index a9fc57dd284..265842efe4d 100755 --- a/opendbc/safety/tests/test_honda.py +++ b/opendbc/safety/tests/test_honda.py @@ -249,7 +249,6 @@ def test_steer_safety_check(self): class TestHondaNidecSafetyBase(HondaBase): TX_MSGS = HONDA_N_COMMON_TX_MSGS FWD_BLACKLISTED_ADDRS = {2: [0xE4, 0x194, 0x33D, 0x30C]} - RELAY_MALFUNCTION_ADDRS = {0: (0xE4, 0x194, 0x33D, 0x30C)} PT_BUS = 0 STEER_BUS = 0 @@ -375,7 +374,7 @@ class TestHondaBoschSafetyBase(HondaBase): TX_MSGS = [[0xE4, 0], [0xE5, 0], [0x296, 1], [0x33D, 0], [0x33DA, 0], [0x33DB, 0]] FWD_BLACKLISTED_ADDRS = {2: [0xE4, 0xE5, 0x33D, 0x33DA, 0x33DB]} - RELAY_MALFUNCTION_ADDRS = {0: (0xE4, 0xE5, 0x33D, 0x33DA, 0x33DB)} # STEERING_CONTROL, BOSCH_SUPPLEMENTAL_1 + RELAY_MALFUNCTION_ADDRS = {0: (0xE4,)} # STEERING_CONTROL def setUp(self): self.packer = CANPackerPanda("honda_accord_2018_can_generated") @@ -459,9 +458,9 @@ class TestHondaBoschLongSafety(HondaButtonEnableBase, TestHondaBoschSafetyBase): STEER_BUS = 1 TX_MSGS = [[0xE4, 1], [0x1DF, 1], [0x1EF, 1], [0x1FA, 1], [0x30C, 1], [0x33D, 1], [0x33DA, 1], [0x33DB, 1], [0x39F, 1], [0x18DAB0F1, 1]] - FWD_BLACKLISTED_ADDRS = {} + FWD_BLACKLISTED_ADDRS = {2: [0xE4, 0xE5, 0x33D, 0x33DA, 0x33DB]} # 0x1DF is to test that radar is disabled - RELAY_MALFUNCTION_ADDRS = {1: (0xE4, 0x1DF, 0x33D, 0x33DA, 0x33DB)} # STEERING_CONTROL, ACC_CONTROL + RELAY_MALFUNCTION_ADDRS = {1: (0xE4, 0x1DF)} # STEERING_CONTROL, ACC_CONTROL def setUp(self): super().setUp() @@ -511,8 +510,7 @@ class TestHondaBoschRadarlessSafetyBase(TestHondaBoschSafetyBase): BUTTONS_BUS = 2 # camera controls ACC, need to send buttons on bus 2 TX_MSGS = [[0xE4, 0], [0x296, 2], [0x33D, 0]] - FWD_BLACKLISTED_ADDRS = {2: [0xE4, 0x33D]} - RELAY_MALFUNCTION_ADDRS = {0: (0xE4, 0x33D)} # STEERING_CONTROL + FWD_BLACKLISTED_ADDRS = {2: [0xE4, 0xE5, 0x33D, 0x33DA, 0x33DB]} def setUp(self): self.packer = CANPackerPanda("honda_civic_ex_2022_can_generated") @@ -547,8 +545,7 @@ class TestHondaBoschRadarlessLongSafety(common.LongitudinalAccelSafetyTest, Hond Covers the Honda Bosch Radarless safety mode with longitudinal control """ TX_MSGS = [[0xE4, 0], [0x33D, 0], [0x1C8, 0], [0x30C, 0]] - FWD_BLACKLISTED_ADDRS = {2: [0xE4, 0x33D, 0x1C8, 0x30C]} - RELAY_MALFUNCTION_ADDRS = {0: (0xE4, 0x1C8, 0x30C, 0x33D)} + FWD_BLACKLISTED_ADDRS = {2: [0xE4, 0xE5, 0x33D, 0x33DA, 0x33DB, 0x1C8, 0x30C]} def setUp(self): super().setUp() diff --git a/opendbc/safety/tests/test_hyundai.py b/opendbc/safety/tests/test_hyundai.py index c0c972caeb6..80ec273a292 100755 --- a/opendbc/safety/tests/test_hyundai.py +++ b/opendbc/safety/tests/test_hyundai.py @@ -48,7 +48,7 @@ def checksum(msg): class TestHyundaiSafety(HyundaiButtonBase, common.PandaCarSafetyTest, common.DriverTorqueSteeringSafetyTest, common.SteerRequestCutSafetyTest): TX_MSGS = [[0x340, 0], [0x4F1, 0], [0x485, 0]] STANDSTILL_THRESHOLD = 12 # 0.375 kph - RELAY_MALFUNCTION_ADDRS = {0: (0x340, 0x485)} # LKAS11 + RELAY_MALFUNCTION_ADDRS = {0: (0x340,)} # LKAS11 FWD_BLACKLISTED_ADDRS = {2: [0x340, 0x485]} MAX_RATE_UP = 3 @@ -193,9 +193,7 @@ def _user_gas_msg(self, gas): class TestHyundaiLongitudinalSafety(HyundaiLongitudinalBase, TestHyundaiSafety): TX_MSGS = [[0x340, 0], [0x4F1, 0], [0x485, 0], [0x420, 0], [0x421, 0], [0x50A, 0], [0x389, 0], [0x4A2, 0], [0x38D, 0], [0x483, 0], [0x7D0, 0]] - FWD_BLACKLISTED_ADDRS = {2: [0x340, 0x485, 0x421, 0x420, 0x50A, 0x389]} - - RELAY_MALFUNCTION_ADDRS = {0: (0x340, 0x485, 0x421, 0x420, 0x50A, 0x389)} # LKAS11, LFAHDA_MFC, SCC12, SCC11, SCC13, SCC14 + RELAY_MALFUNCTION_ADDRS = {0: (0x340, 0x421)} # LKAS11, SCC12 DISABLED_ECU_UDS_MSG = (0x7D0, 0) DISABLED_ECU_ACTUATION_MSG = (0x421, 0) @@ -241,7 +239,6 @@ class TestHyundaiLongitudinalSafetyCameraSCC(HyundaiLongitudinalBase, TestHyunda TX_MSGS = [[0x340, 0], [0x4F1, 2], [0x485, 0], [0x420, 0], [0x421, 0], [0x50A, 0], [0x389, 0], [0x4A2, 0]] FWD_BLACKLISTED_ADDRS = {2: [0x340, 0x485, 0x420, 0x421, 0x50A, 0x389]} - RELAY_MALFUNCTION_ADDRS = {0: (0x340, 0x485, 0x421, 0x420, 0x50A, 0x389)} # LKAS11, LFAHDA_MFC, SCC12, SCC11, SCC13, SCC14 def setUp(self): self.packer = CANPackerPanda("hyundai_kia_generic") diff --git a/opendbc/safety/tests/test_hyundai_canfd.py b/opendbc/safety/tests/test_hyundai_canfd.py index 3fad83d3df1..8036da100e4 100755 --- a/opendbc/safety/tests/test_hyundai_canfd.py +++ b/opendbc/safety/tests/test_hyundai_canfd.py @@ -85,8 +85,8 @@ def _button_msg(self, buttons, main_button=0, bus=None): class TestHyundaiCanfdLFASteeringBase(TestHyundaiCanfdBase): TX_MSGS = [[0x12A, 0], [0x1A0, 1], [0x1CF, 0], [0x1E0, 0]] - RELAY_MALFUNCTION_ADDRS = {0: (0x12A, 0x1E0)} # LFA, LFAHDA_CLUSTER - FWD_BLACKLISTED_ADDRS = {2: [0x12A, 0x1E0]} + RELAY_MALFUNCTION_ADDRS = {0: (0x12A,)} # LFA + FWD_BLACKLISTED_ADDRS = {2: [0x12A, 0x1E0, 0x161, 0x162]} STEER_MSG = "LFA" BUTTONS_TX_BUS = 2 @@ -159,8 +159,8 @@ class TestHyundaiCanfdLFASteeringAltButtons(TestHyundaiCanfdLFASteeringAltButton class TestHyundaiCanfdLKASteeringEV(TestHyundaiCanfdBase): TX_MSGS = [[0x50, 0], [0x1CF, 1], [0x2A4, 0]] - RELAY_MALFUNCTION_ADDRS = {0: (0x50, 0x2a4)} # LKAS, CAM_0x2A4 - FWD_BLACKLISTED_ADDRS = {2: [0x50, 0x2a4]} + RELAY_MALFUNCTION_ADDRS = {0: (0x50,)} # LKAS + FWD_BLACKLISTED_ADDRS = {2: [0x50, 0x2a4, 0x161, 0x162]} PT_BUS = 1 SCC_BUS = 1 @@ -178,8 +178,8 @@ def setUp(self): class TestHyundaiCanfdLKASteeringAltEV(TestHyundaiCanfdBase): TX_MSGS = [[0x110, 0], [0x1CF, 1], [0x362, 0]] - RELAY_MALFUNCTION_ADDRS = {0: (0x110, 0x362)} # LKAS_ALT, CAM_0x362 - FWD_BLACKLISTED_ADDRS = {2: [0x110, 0x362]} + RELAY_MALFUNCTION_ADDRS = {0: (0x110,)} # LKAS_ALT + FWD_BLACKLISTED_ADDRS = {2: [0x110, 0x362, 0x161, 0x162]} PT_BUS = 1 SCC_BUS = 1 @@ -199,7 +199,7 @@ class TestHyundaiCanfdLKASteeringLongEV(HyundaiLongitudinalBase, TestHyundaiCanf TX_MSGS = [[0x50, 0], [0x1CF, 1], [0x2A4, 0], [0x51, 0], [0x730, 1], [0x12a, 1], [0x160, 1], [0x1e0, 1], [0x1a0, 1], [0x1ea, 1], [0x200, 1], [0x345, 1], [0x1da, 1]] - RELAY_MALFUNCTION_ADDRS = {0: (0x50, 0x2a4), 1: (0x1a0,)} # LKAS, CAM_0x2A4, SCC_CONTROL + RELAY_MALFUNCTION_ADDRS = {0: (0x50,), 1: (0x1a0,)} # LKAS, SCC_CONTROL DISABLED_ECU_UDS_MSG = (0x730, 1) DISABLED_ECU_ACTUATION_MSG = (0x1a0, 1) @@ -226,9 +226,9 @@ def _accel_msg(self, accel, aeb_req=False, aeb_decel=0): # Tests longitudinal for ICE, hybrid, EV cars with LFA steering class TestHyundaiCanfdLFASteeringLongBase(HyundaiLongitudinalBase, TestHyundaiCanfdLFASteeringBase): - FWD_BLACKLISTED_ADDRS = {2: [0x12a, 0x1e0, 0x1a0, 0x160]} + FWD_BLACKLISTED_ADDRS = {2: [0x12a, 0x1e0, 0x1a0, 0x160, 0x161, 0x162]} - RELAY_MALFUNCTION_ADDRS = {0: (0x12A, 0x1E0, 0x1a0, 0x160)} # LFA, LFAHDA_CLUSTER, SCC_CONTROL, ADRV_0x160 + RELAY_MALFUNCTION_ADDRS = {0: (0x12A, 0x1a0)} # LFA, SCC_CONTROL DISABLED_ECU_UDS_MSG = (0x7D0, 0) DISABLED_ECU_ACTUATION_MSG = (0x1a0, 0) diff --git a/opendbc/safety/tests/test_mazda.py b/opendbc/safety/tests/test_mazda.py index a39b25b4aa7..67a22d492d4 100755 --- a/opendbc/safety/tests/test_mazda.py +++ b/opendbc/safety/tests/test_mazda.py @@ -11,7 +11,7 @@ class TestMazdaSafety(common.PandaCarSafetyTest, common.DriverTorqueSteeringSafe TX_MSGS = [[0x243, 0], [0x09d, 0], [0x440, 0]] STANDSTILL_THRESHOLD = .1 - RELAY_MALFUNCTION_ADDRS = {0: (0x243, 0x440)} + RELAY_MALFUNCTION_ADDRS = {0: (0x243,)} FWD_BLACKLISTED_ADDRS = {2: [0x243, 0x440]} MAX_RATE_UP = 10 diff --git a/opendbc/safety/tests/test_nissan.py b/opendbc/safety/tests/test_nissan.py index 588bc9612c1..22f556f4dc1 100755 --- a/opendbc/safety/tests/test_nissan.py +++ b/opendbc/safety/tests/test_nissan.py @@ -12,7 +12,7 @@ class TestNissanSafety(common.PandaCarSafetyTest, common.AngleSteeringSafetyTest TX_MSGS = [[0x169, 0], [0x2b1, 0], [0x4cc, 0], [0x20b, 2], [0x280, 2]] GAS_PRESSED_THRESHOLD = 3 - RELAY_MALFUNCTION_ADDRS = {0: (0x169, 0x2b1, 0x4cc), 2: (0x280,)} + RELAY_MALFUNCTION_ADDRS = {0: (0x169,)} FWD_BLACKLISTED_ADDRS = {0: [0x280], 2: [0x169, 0x2b1, 0x4cc]} EPS_BUS = 0 diff --git a/opendbc/safety/tests/test_rivian.py b/opendbc/safety/tests/test_rivian.py index 8867c94a78d..e3f888564e3 100755 --- a/opendbc/safety/tests/test_rivian.py +++ b/opendbc/safety/tests/test_rivian.py @@ -27,7 +27,7 @@ class TestRivianSafetyBase(common.PandaCarSafetyTest, common.DriverTorqueSteerin common.VehicleSpeedSafetyTest): TX_MSGS = [[0x120, 0], [0x321, 2], [0x162, 2]] - RELAY_MALFUNCTION_ADDRS = {0: (0x120,), 2: (0x321, 0x162)} + RELAY_MALFUNCTION_ADDRS = {0: (0x120,)} FWD_BLACKLISTED_ADDRS = {0: [0x321, 0x162], 2: [0x120]} MAX_TORQUE_LOOKUP = [9, 17], [350, 250] @@ -149,7 +149,7 @@ def test_adas_status(self): class TestRivianLongitudinalSafety(TestRivianSafetyBase): TX_MSGS = [[0x120, 0], [0x321, 2], [0x160, 0]] - RELAY_MALFUNCTION_ADDRS = {0: (0x120, 0x160), 2: (0x321,)} + RELAY_MALFUNCTION_ADDRS = {0: (0x120, 0x160)} FWD_BLACKLISTED_ADDRS = {0: [0x321], 2: [0x120, 0x160]} def setUp(self): diff --git a/opendbc/safety/tests/test_subaru.py b/opendbc/safety/tests/test_subaru.py index f31a8df5c9a..4936eae13a4 100755 --- a/opendbc/safety/tests/test_subaru.py +++ b/opendbc/safety/tests/test_subaru.py @@ -56,8 +56,7 @@ def fwd_blacklisted_addr(lkas_msg=SubaruMsg.ES_LKAS): class TestSubaruSafetyBase(common.PandaCarSafetyTest): FLAGS = 0 - RELAY_MALFUNCTION_ADDRS = {SUBARU_MAIN_BUS: (SubaruMsg.ES_LKAS, SubaruMsg.ES_DashStatus, SubaruMsg.ES_LKAS_State, - SubaruMsg.ES_Infotainment)} + RELAY_MALFUNCTION_ADDRS = {SUBARU_MAIN_BUS: (SubaruMsg.ES_LKAS,)} FWD_BLACKLISTED_ADDRS = fwd_blacklisted_addr() MAX_RT_DELTA = 940 @@ -189,19 +188,11 @@ class TestSubaruGen2TorqueStockLongitudinalSafety(TestSubaruStockLongitudinalSaf class TestSubaruGen1LongitudinalSafety(TestSubaruLongitudinalSafetyBase, TestSubaruTorqueSafetyBase): FLAGS = SubaruSafetyFlags.LONG TX_MSGS = lkas_tx_msgs(SUBARU_MAIN_BUS) + long_tx_msgs(SUBARU_MAIN_BUS) - RELAY_MALFUNCTION_ADDRS = {SUBARU_MAIN_BUS: (SubaruMsg.ES_LKAS, SubaruMsg.ES_DashStatus, SubaruMsg.ES_LKAS_State, - SubaruMsg.ES_Infotainment, SubaruMsg.ES_Brake, SubaruMsg.ES_Status, - SubaruMsg.ES_Distance)} class TestSubaruGen2LongitudinalSafety(TestSubaruLongitudinalSafetyBase, TestSubaruGen2TorqueSafetyBase): FLAGS = SubaruSafetyFlags.LONG | SubaruSafetyFlags.GEN2 TX_MSGS = lkas_tx_msgs(SUBARU_ALT_BUS) + long_tx_msgs(SUBARU_ALT_BUS) + gen2_long_additional_tx_msgs() - FWD_BLACKLISTED_ADDRS = {2: [SubaruMsg.ES_LKAS, SubaruMsg.ES_DashStatus, SubaruMsg.ES_LKAS_State, - SubaruMsg.ES_Infotainment]} - RELAY_MALFUNCTION_ADDRS = {SUBARU_MAIN_BUS: (SubaruMsg.ES_LKAS, SubaruMsg.ES_DashStatus, SubaruMsg.ES_LKAS_State, - SubaruMsg.ES_Infotainment), - SUBARU_ALT_BUS: (SubaruMsg.ES_Brake, SubaruMsg.ES_Status, SubaruMsg.ES_Distance)} def _rdbi_msg(self, did: int): return b'\x03\x22' + did.to_bytes(2) + b'\x00\x00\x00\x00' diff --git a/opendbc/safety/tests/test_subaru_preglobal.py b/opendbc/safety/tests/test_subaru_preglobal.py index 44aef0812e4..af2c6cec238 100755 --- a/opendbc/safety/tests/test_subaru_preglobal.py +++ b/opendbc/safety/tests/test_subaru_preglobal.py @@ -12,7 +12,7 @@ class TestSubaruPreglobalSafety(common.PandaCarSafetyTest, common.DriverTorqueSt FLAGS = 0 DBC = "subaru_outback_2015_generated" TX_MSGS = [[0x161, 0], [0x164, 0]] - RELAY_MALFUNCTION_ADDRS = {0: (0x164, 0x161)} + RELAY_MALFUNCTION_ADDRS = {0: (0x164,)} FWD_BLACKLISTED_ADDRS = {2: [0x161, 0x164]} MAX_RATE_UP = 50 diff --git a/opendbc/safety/tests/test_toyota.py b/opendbc/safety/tests/test_toyota.py index 3edbe1ebf47..a119615c852 100755 --- a/opendbc/safety/tests/test_toyota.py +++ b/opendbc/safety/tests/test_toyota.py @@ -21,7 +21,7 @@ class TestToyotaSafetyBase(common.PandaCarSafetyTest, common.LongitudinalAccelSafetyTest): TX_MSGS = TOYOTA_COMMON_TX_MSGS + TOYOTA_COMMON_LONG_TX_MSGS - RELAY_MALFUNCTION_ADDRS = {0: (0x2E4, 0x191, 0x412, 0x343)} + RELAY_MALFUNCTION_ADDRS = {0: (0x2E4, 0x343)} FWD_BLACKLISTED_ADDRS = {2: [0x2E4, 0x412, 0x191, 0x343]} EPS_SCALE = 73 @@ -267,7 +267,7 @@ class TestToyotaStockLongitudinalBase(TestToyotaSafetyBase): TX_MSGS = TOYOTA_COMMON_TX_MSGS # Base addresses minus ACC_CONTROL (0x343) - RELAY_MALFUNCTION_ADDRS = {0: (0x2E4, 0x191, 0x412)} + RELAY_MALFUNCTION_ADDRS = {0: (0x2E4,)} FWD_BLACKLISTED_ADDRS = {2: [0x2E4, 0x412, 0x191]} LONGITUDINAL = False @@ -312,8 +312,8 @@ def setUp(self): class TestToyotaSecOcSafety(TestToyotaStockLongitudinalBase): TX_MSGS = TOYOTA_SECOC_TX_MSGS - RELAY_MALFUNCTION_ADDRS = {0: (0x2E4, 0x191, 0x412, 0x131)} - FWD_BLACKLISTED_ADDRS = {2: [0x2E4, 0x191, 0x412, 0x131]} + RELAY_MALFUNCTION_ADDRS = {0: (0x2E4,)} + FWD_BLACKLISTED_ADDRS = {2: [0x2E4, 0x412, 0x191, 0x131]} def setUp(self): self.packer = CANPackerPanda("toyota_secoc_pt_generated") diff --git a/opendbc/safety/tests/test_volkswagen_mqb.py b/opendbc/safety/tests/test_volkswagen_mqb.py index 92d659f4cec..83e45f1fea5 100755 --- a/opendbc/safety/tests/test_volkswagen_mqb.py +++ b/opendbc/safety/tests/test_volkswagen_mqb.py @@ -24,7 +24,7 @@ class TestVolkswagenMqbSafetyBase(common.PandaCarSafetyTest, common.DriverTorqueSteeringSafetyTest): - RELAY_MALFUNCTION_ADDRS = {0: (MSG_HCA_01, MSG_LDW_02), 2: (MSG_LH_EPS_03,)} + RELAY_MALFUNCTION_ADDRS = {0: (MSG_HCA_01,)} MAX_RATE_UP = 4 MAX_RATE_DOWN = 10 @@ -150,7 +150,6 @@ def test_spam_cancel_safety_check(self): class TestVolkswagenMqbLongSafety(TestVolkswagenMqbSafetyBase): TX_MSGS = [[MSG_HCA_01, 0], [MSG_LDW_02, 0], [MSG_LH_EPS_03, 2], [MSG_ACC_02, 0], [MSG_ACC_06, 0], [MSG_ACC_07, 0]] FWD_BLACKLISTED_ADDRS = {0: [MSG_LH_EPS_03], 2: [MSG_HCA_01, MSG_LDW_02, MSG_ACC_02, MSG_ACC_06, MSG_ACC_07]} - RELAY_MALFUNCTION_ADDRS = {0: (MSG_HCA_01, MSG_LDW_02, MSG_ACC_02, MSG_ACC_06, MSG_ACC_07), 2: (MSG_LH_EPS_03,)} INACTIVE_ACCEL = 3.01 def setUp(self): diff --git a/opendbc/safety/tests/test_volkswagen_pq.py b/opendbc/safety/tests/test_volkswagen_pq.py index 22b897d9a0e..8f6de057c1a 100755 --- a/opendbc/safety/tests/test_volkswagen_pq.py +++ b/opendbc/safety/tests/test_volkswagen_pq.py @@ -22,7 +22,7 @@ class TestVolkswagenPqSafetyBase(common.PandaCarSafetyTest, common.DriverTorqueSteeringSafetyTest): cruise_engaged = False - RELAY_MALFUNCTION_ADDRS = {0: (MSG_HCA_1, MSG_LDW_1)} + RELAY_MALFUNCTION_ADDRS = {0: (MSG_HCA_1,)} MAX_RATE_UP = 6 MAX_RATE_DOWN = 10 @@ -133,7 +133,6 @@ def test_spam_cancel_safety_check(self): class TestVolkswagenPqLongSafety(TestVolkswagenPqSafetyBase, common.LongitudinalAccelSafetyTest): TX_MSGS = [[MSG_HCA_1, 0], [MSG_LDW_1, 0], [MSG_ACC_SYSTEM, 0], [MSG_ACC_GRA_ANZEIGE, 0]] FWD_BLACKLISTED_ADDRS = {2: [MSG_HCA_1, MSG_LDW_1, MSG_ACC_SYSTEM, MSG_ACC_GRA_ANZEIGE]} - RELAY_MALFUNCTION_ADDRS = {0: (MSG_HCA_1, MSG_LDW_1, MSG_ACC_SYSTEM, MSG_ACC_GRA_ANZEIGE)} INACTIVE_ACCEL = 3.01 def setUp(self): From 2bae62a2f98b76367df4aba2c7dfcabfe8f97e9e Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 26 Apr 2025 15:42:11 -0400 Subject: [PATCH 253/316] add HYUNDAI_TUCSON_HEV_2025 route --- opendbc/car/tests/routes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/tests/routes.py b/opendbc/car/tests/routes.py index 4b5c9c96751..4a148918319 100644 --- a/opendbc/car/tests/routes.py +++ b/opendbc/car/tests/routes.py @@ -141,7 +141,7 @@ class CarTestRoute(NamedTuple): CarTestRoute("fb3fd42f0baaa2f8|2022-03-30--15-25-05", HYUNDAI.HYUNDAI_TUCSON), CarTestRoute("db68bbe12250812c|2022-12-05--00-54-12", HYUNDAI.HYUNDAI_TUCSON_4TH_GEN), # 2023 CarTestRoute("36e10531feea61a4|2022-07-25--13-37-42", HYUNDAI.HYUNDAI_TUCSON_4TH_GEN), # hybrid - CarTestRoute("todo", HYUNDAI.HYUNDAI_TUCSON_HEV_2025), + CarTestRoute("22f9090014364a87/00000002--4cc739c0b2", HYUNDAI.HYUNDAI_TUCSON_HEV_2025), CarTestRoute("5875672fc1d4bf57|2020-07-23--21-33-28", HYUNDAI.KIA_SORENTO), CarTestRoute("1d0d000db3370fd0|2023-01-04--22-28-42", HYUNDAI.KIA_SORENTO_4TH_GEN, segment=5), CarTestRoute("60380edf6d76cb45/00000004--e450afc26c", HYUNDAI.KIA_SORENTO_2024), From 50a2c190e13ae87389133fc2ed006550666e12f7 Mon Sep 17 00:00:00 2001 From: royjr Date: Fri, 9 May 2025 01:38:13 -0400 Subject: [PATCH 254/316] not needed --- opendbc/car/hyundai/hyundaicanfd.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index ed62867b0ac..9bedfd9b052 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -185,7 +185,11 @@ def create_ccnc(packer, CAN, openpilotLongitudinalControl, enabled, hud, latacti def create_acc_control(packer, CAN, enabled, accel_last, accel, stopping, gas_override, set_speed, hud_control, cruise_info=None): jerk = 5 jn = jerk / 50 - a_raw, a_val = (0, 0) if not enabled or gas_override else (accel, np.clip(accel, accel_last - jn, accel_last + jn)) + if not enabled or gas_override: + a_val, a_raw = 0, 0 + else: + a_raw = accel + a_val = np.clip(accel, accel_last - jn, accel_last + jn) values = { "ACCMode": 0 if not enabled else (2 if gas_override else 1), @@ -196,6 +200,7 @@ def create_acc_control(packer, CAN, enabled, accel_last, accel, stopping, gas_ov "VSetDis": set_speed, "JerkLowerLimit": jerk if enabled else 1, "JerkUpperLimit": 3.0, + "ObjValid": 0, "OBJ_STATUS": 2, "SET_ME_2": 0x4, From 02845f079ec8faebf48d4895ee4f0bc180a66ccd Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 22 May 2025 18:32:29 -0400 Subject: [PATCH 255/316] remove unused latactive --- opendbc/car/hyundai/carcontroller.py | 2 +- opendbc/car/hyundai/hyundaicanfd.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/opendbc/car/hyundai/carcontroller.py b/opendbc/car/hyundai/carcontroller.py index 9b50d5dbe81..36a22fed333 100644 --- a/opendbc/car/hyundai/carcontroller.py +++ b/opendbc/car/hyundai/carcontroller.py @@ -176,7 +176,7 @@ def create_canfd_msgs(self, apply_steer_req, apply_torque, set_speed_in_units, a # LFA and HDA icons if self.frame % 5 == 0 and (not lka_steering or lka_steering_long): if self.CP.flags & HyundaiFlags.CCNC: - can_sends.extend(hyundaicanfd.create_ccnc(self.packer, self.CAN, self.CP.openpilotLongitudinalControl, CC.enabled, CC.hudControl, CC.latActive, + can_sends.extend(hyundaicanfd.create_ccnc(self.packer, self.CAN, self.CP.openpilotLongitudinalControl, CC.enabled, CC.hudControl, CC.leftBlinker, CC.rightBlinker, CS.msg_161, CS.msg_162, CS.is_metric, CS.out)) else: can_sends.append(hyundaicanfd.create_lfahda_cluster(self.packer, self.CAN, CC.enabled)) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 9bedfd9b052..354b15e5e67 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -124,7 +124,7 @@ def create_lfahda_cluster(packer, CAN, enabled): } return packer.make_can_msg("LFAHDA_CLUSTER", CAN.ECAN, values) -def create_ccnc(packer, CAN, openpilotLongitudinalControl, enabled, hud, latactive, leftBlinker, rightBlinker, msg_161, msg_162, is_metric, out): +def create_ccnc(packer, CAN, openpilotLongitudinalControl, enabled, hud, leftBlinker, rightBlinker, msg_161, msg_162, is_metric, out): for f in {"FAULT_LSS", "FAULT_HDA", "FAULT_DAS", "FAULT_LFA", "FAULT_DAW"}: msg_162[f] = 0 From 669b8b3418a3a80b8b37805cbbcc7d67af14c5db Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 22 May 2025 19:48:22 -0400 Subject: [PATCH 256/316] more accurate LANE_CHANGE_SPEED_MIN --- opendbc/car/hyundai/hyundaicanfd.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 354b15e5e67..4cee6eeb2ad 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -140,15 +140,17 @@ def create_ccnc(packer, CAN, openpilotLongitudinalControl, enabled, hud, leftBli if msg_161["SOUNDS_4"] == 2 and msg_161["LFA_ICON"] in (3, 0,): # LFA BEEPS msg_161["SOUNDS_4"] = 0 + LANE_CHANGE_SPEED_MIN = 8.9408 # 20 * 0.44704 + msg_161.update({ "DAW_ICON": 0, "LKA_ICON": 0, "LFA_ICON": 2 if enabled else 0, "CENTERLINE": 1 if enabled else 0, - "LANELINE_LEFT": ( - 1 if not hud.leftLaneVisible else 4 if hud.leftLaneDepart else 0 if not enabled else 2 if out.leftBlindspot or out.vEgo < 8.94 else 6), - "LANELINE_RIGHT": ( - 1 if not hud.rightLaneVisible else 4 if hud.rightLaneDepart else 0 if not enabled else 2 if out.rightBlindspot or out.vEgo < 8.94 else 6), + "LANELINE_LEFT": (1 if not hud.leftLaneVisible else 4 if hud.leftLaneDepart else 0 if not enabled else + 2 if out.leftBlindspot or out.vEgo < LANE_CHANGE_SPEED_MIN else 6), + "LANELINE_RIGHT": (1 if not hud.rightLaneVisible else 4 if hud.rightLaneDepart else 0 if not enabled else + 2 if out.rightBlindspot or out.vEgo < LANE_CHANGE_SPEED_MIN else 6), "LCA_LEFT_ARROW": 2 if leftBlinker else 0, "LCA_RIGHT_ARROW": 2 if rightBlinker else 0, "LANE_LEFT": 1 if leftBlinker else 0, From 8fea35c26becc2a2df65da7fed359ff8549cf6b3 Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 22 May 2025 22:45:47 -0400 Subject: [PATCH 257/316] fix metric --- opendbc/car/hyundai/carstate.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index ad9ee80c667..fa7b037f5c7 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -221,6 +221,7 @@ def update_canfd(self, can_parsers) -> structs.CarState: self.is_metric = cp.vl["CRUISE_BUTTONS_ALT"]["DISTANCE_UNIT"] != 1 speed_factor = CV.KPH_TO_MS if self.is_metric else CV.MPH_TO_MS + speed_offset = 0.1 if self.is_metric else 0.2 if self.CP.flags & (HyundaiFlags.EV | HyundaiFlags.HYBRID): offset = 255. if self.CP.flags & HyundaiFlags.EV else 1023. @@ -244,7 +245,7 @@ def update_canfd(self, can_parsers) -> structs.CarState: cp.vl["WHEEL_SPEEDS"]["WHL_SpdRLVal"], cp.vl["WHEEL_SPEEDS"]["WHL_SpdRRVal"], ) - ret.vEgoRaw = cp.vl["CRUISE_BUTTONS_ALT"]["CLUSTER_SPEED_MPH"] * speed_factor + 0.2 + ret.vEgoRaw = cp.vl["CRUISE_BUTTONS_ALT"]["CLUSTER_SPEED_MPH"] * speed_factor + speed_offset ret.vEgo, ret.aEgo = self.update_speed_kf(ret.vEgoRaw) ret.standstill = ret.wheelSpeeds.fl <= STANDSTILL_THRESHOLD and ret.wheelSpeeds.fr <= STANDSTILL_THRESHOLD and \ ret.wheelSpeeds.rl <= STANDSTILL_THRESHOLD and ret.wheelSpeeds.rr <= STANDSTILL_THRESHOLD @@ -254,7 +255,7 @@ def update_canfd(self, can_parsers) -> structs.CarState: self.cluster_speed = cp.vl["CRUISE_BUTTONS_ALT"]["CLUSTER_SPEED_MPH"] self.cluster_speed_counter = 0 - ret.vEgoCluster = self.cluster_speed * speed_factor + 0.2 + ret.vEgoCluster = self.cluster_speed * speed_factor + speed_offset ret.steeringRateDeg = cp.vl["STEERING_SENSORS"]["STEERING_RATE"] ret.steeringAngleDeg = cp.vl["STEERING_SENSORS"]["STEERING_ANGLE"] From c2df2cea7f77ad03f4da48776441da691f0364c4 Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 22 May 2025 23:02:58 -0400 Subject: [PATCH 258/316] disable isla sound on op long --- opendbc/car/hyundai/hyundaicanfd.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 4cee6eeb2ad..587662def01 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -167,6 +167,9 @@ def create_ccnc(packer, CAN, openpilotLongitudinalControl, enabled, hud, leftBli if msg_161["ALERTS_5"] == 4: # SMART_CRUISE_CONTROL_CONDITIONS_NOT_MET msg_161["ALERTS_5"] = 0 + if msg_161["SOUNDS_3"] == 5: # DISABLE ISLA SOUND + msg_161["SOUNDS_3"] = 0 + msg_161.update({ "SETSPEED": 3 if enabled else 1, "SETSPEED_HUD": 2 if enabled else 1, From 6cb0bb40b8c85cc829816956f0276dcbe5758c41 Mon Sep 17 00:00:00 2001 From: royjr Date: Mon, 2 Jun 2025 01:15:29 -0400 Subject: [PATCH 259/316] sync --- opendbc/car/hyundai/carcontroller.py | 2 +- opendbc/car/hyundai/carstate.py | 12 +-- opendbc/car/hyundai/hyundaicanfd.py | 73 +++++++++++++++---- .../dbc/generator/hyundai/hyundai_canfd.dbc | 38 +++++----- 4 files changed, 81 insertions(+), 44 deletions(-) diff --git a/opendbc/car/hyundai/carcontroller.py b/opendbc/car/hyundai/carcontroller.py index 36a22fed333..7a31a9137d8 100644 --- a/opendbc/car/hyundai/carcontroller.py +++ b/opendbc/car/hyundai/carcontroller.py @@ -177,7 +177,7 @@ def create_canfd_msgs(self, apply_steer_req, apply_torque, set_speed_in_units, a if self.frame % 5 == 0 and (not lka_steering or lka_steering_long): if self.CP.flags & HyundaiFlags.CCNC: can_sends.extend(hyundaicanfd.create_ccnc(self.packer, self.CAN, self.CP.openpilotLongitudinalControl, CC.enabled, CC.hudControl, - CC.leftBlinker, CC.rightBlinker, CS.msg_161, CS.msg_162, CS.is_metric, CS.out)) + CC.leftBlinker, CC.rightBlinker, CS.msg_161, CS.msg_162, CS.msg_1b5, CS.is_metric, CS.out)) else: can_sends.append(hyundaicanfd.create_lfahda_cluster(self.packer, self.CAN, CC.enabled)) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index 064f5d05565..06d0b38fd4c 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -59,6 +59,7 @@ def __init__(self, CP): self.cruise_info = {} self.msg_161 = {} self.msg_162 = {} + self.msg_1b5 = {} # On some cars, CLU15->CF_Clu_VehicleSpeed can oscillate faster than the dash updates. Sample at 5 Hz self.cluster_speed = 0 @@ -220,7 +221,6 @@ def update_canfd(self, can_parsers) -> structs.CarState: self.is_metric = cp.vl["CRUISE_BUTTONS_ALT"]["DISTANCE_UNIT"] != 1 speed_factor = CV.KPH_TO_MS if self.is_metric else CV.MPH_TO_MS - speed_offset = 0.1 if self.is_metric else 0.2 if self.CP.flags & (HyundaiFlags.EV | HyundaiFlags.HYBRID): offset = 255. if self.CP.flags & HyundaiFlags.EV else 1023. @@ -244,18 +244,11 @@ def update_canfd(self, can_parsers) -> structs.CarState: cp.vl["WHEEL_SPEEDS"]["WHL_SpdRLVal"], cp.vl["WHEEL_SPEEDS"]["WHL_SpdRRVal"], ) - ret.vEgoRaw = cp.vl["CRUISE_BUTTONS_ALT"]["CLUSTER_SPEED_MPH"] * speed_factor + speed_offset + ret.vEgoRaw = (ret.wheelSpeeds.fl + ret.wheelSpeeds.fr + ret.wheelSpeeds.rl + ret.wheelSpeeds.rr) / 4. ret.vEgo, ret.aEgo = self.update_speed_kf(ret.vEgoRaw) ret.standstill = ret.wheelSpeeds.fl <= STANDSTILL_THRESHOLD and ret.wheelSpeeds.fr <= STANDSTILL_THRESHOLD and \ ret.wheelSpeeds.rl <= STANDSTILL_THRESHOLD and ret.wheelSpeeds.rr <= STANDSTILL_THRESHOLD - self.cluster_speed_counter += 1 - if self.cluster_speed_counter > CLUSTER_SAMPLE_RATE: - self.cluster_speed = cp.vl["CRUISE_BUTTONS_ALT"]["CLUSTER_SPEED_MPH"] - self.cluster_speed_counter = 0 - - ret.vEgoCluster = self.cluster_speed * speed_factor + speed_offset - ret.steeringRateDeg = cp.vl["STEERING_SENSORS"]["STEERING_RATE"] ret.steeringAngleDeg = cp.vl["STEERING_SENSORS"]["STEERING_ANGLE"] ret.steeringTorque = cp.vl["MDPS"]["STEERING_COL_TORQUE"] @@ -365,6 +358,7 @@ def get_can_parsers_canfd(self, CP): cam_messages += [ ("CCNC_0x161", 20), ("CCNC_0x162", 20), + ("CCNC_0x1B5", 20), ] return { diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 587662def01..6ef0757cac5 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -124,7 +124,19 @@ def create_lfahda_cluster(packer, CAN, enabled): } return packer.make_can_msg("LFAHDA_CLUSTER", CAN.ECAN, values) -def create_ccnc(packer, CAN, openpilotLongitudinalControl, enabled, hud, leftBlinker, rightBlinker, msg_161, msg_162, is_metric, out): +def meters_to_ui_units(meters: float, nominal_m: float = 1.7, center_ui: int = 15, scale_per_m: float = 15/1.7) -> int: + value = abs(int(round(center_ui + (meters - nominal_m) * scale_per_m))) + return value + +def normalize_lane_lines(left_ui: float, right_ui: float, total_ui: int = 30) -> tuple[int, int]: + total_input = left_ui + right_ui + if total_input == 0: + return total_ui // 2, total_ui // 2 + left_scaled = round((left_ui / total_input) * total_ui) + right_scaled = total_ui - left_scaled + return left_scaled, right_scaled + +def create_ccnc(packer, CAN, openpilotLongitudinalControl, enabled, hud, leftBlinker, rightBlinker, msg_161, msg_162, msg_1b5, is_metric, out): for f in {"FAULT_LSS", "FAULT_HDA", "FAULT_DAS", "FAULT_LFA", "FAULT_DAW"}: msg_162[f] = 0 @@ -147,16 +159,45 @@ def create_ccnc(packer, CAN, openpilotLongitudinalControl, enabled, hud, leftBli "LKA_ICON": 0, "LFA_ICON": 2 if enabled else 0, "CENTERLINE": 1 if enabled else 0, - "LANELINE_LEFT": (1 if not hud.leftLaneVisible else 4 if hud.leftLaneDepart else 0 if not enabled else - 2 if out.leftBlindspot or out.vEgo < LANE_CHANGE_SPEED_MIN else 6), - "LANELINE_RIGHT": (1 if not hud.rightLaneVisible else 4 if hud.rightLaneDepart else 0 if not enabled else - 2 if out.rightBlindspot or out.vEgo < LANE_CHANGE_SPEED_MIN else 6), + "LANELINE_LEFT": (0 if not enabled else 1 if not hud.leftLaneVisible else 4 if hud.leftLaneDepart else 6 if leftBlinker or rightBlinker else 2), + "LANELINE_RIGHT": (0 if not enabled else 1 if not hud.rightLaneVisible else 4 if hud.rightLaneDepart else 6 if leftBlinker or rightBlinker else 2), + "LCA_LEFT_ICON": (0 if not enabled or out.vEgo < LANE_CHANGE_SPEED_MIN else 1 if out.leftBlindspot else 2 if leftBlinker or rightBlinker else 4), + "LCA_RIGHT_ICON": (0 if not enabled or out.vEgo < LANE_CHANGE_SPEED_MIN else 1 if out.rightBlindspot else 2 if leftBlinker or rightBlinker else 4), "LCA_LEFT_ARROW": 2 if leftBlinker else 0, "LCA_RIGHT_ARROW": 2 if rightBlinker else 0, - "LANE_LEFT": 1 if leftBlinker else 0, - "LANE_RIGHT": 1 if rightBlinker else 0, }) + if enabled and (leftBlinker or rightBlinker): + leftlanequal = msg_1b5["LEFT_QUAL"] + rightlanequal = msg_1b5["RIGHT_QUAL"] + leftlaneraw = msg_1b5["LEFT_POSITION"] + rightlaneraw = msg_1b5["RIGHT_POSITION"] + leftlane = meters_to_ui_units(leftlaneraw) + rightlane = meters_to_ui_units(rightlaneraw) + + if leftlanequal not in (2, 3): + leftlane = 0 + if rightlanequal not in (2, 3): + rightlane = 0 + + if leftlaneraw == -2.0248375: + leftlane = 30 - rightlane + if rightlaneraw == 2.0248375: + rightlane = 30 - leftlane + + if leftlaneraw == rightlaneraw == 0: + leftlane = 15 + rightlane = 15 + elif leftlaneraw == 0: + leftlane = 30 - rightlane + elif rightlaneraw == 0: + rightlane = 30 - leftlane + + leftlane, rightlane = normalize_lane_lines(leftlane, rightlane) + + msg_161["LANELINE_LEFT_POSITION"] = leftlane + msg_161["LANELINE_RIGHT_POSITION"] = rightlane + if hud.leftLaneDepart or hud.rightLaneDepart: msg_162["VIBRATE"] = 1 @@ -170,20 +211,26 @@ def create_ccnc(packer, CAN, openpilotLongitudinalControl, enabled, hud, leftBli if msg_161["SOUNDS_3"] == 5: # DISABLE ISLA SOUND msg_161["SOUNDS_3"] = 0 + main_cruise_enabled = out.cruiseState.available + msg_161.update({ "SETSPEED": 3 if enabled else 1, - "SETSPEED_HUD": 2 if enabled else 1, - "SETSPEED_SPEED": 25 if (s := round(out.vCruiseCluster * (1 if is_metric else CV.KPH_TO_MPH))) > 100 else s, + "SETSPEED_HUD": 0 if not main_cruise_enabled else 2 if enabled else 1, + "SETSPEED_SPEED": ( + 255 if not main_cruise_enabled else + (40 if is_metric else 25) if (s := round(out.vCruiseCluster * (1 if is_metric else CV.KPH_TO_MPH))) > (145 if is_metric else 90) else s + ), "DISTANCE": hud.leadDistanceBars, - "DISTANCE_SPACING": 1 if enabled else 0, - "DISTANCE_LEAD": 2 if enabled and hud.leadVisible else 1 if enabled else 0, - "DISTANCE_CAR": 2 if enabled else 1, + "DISTANCE_SPACING": 0 if not main_cruise_enabled else 1 if enabled else 3, + "DISTANCE_LEAD": 0 if not main_cruise_enabled else 2 if enabled and hud.leadVisible else 1 if hud.leadVisible else 0, + "DISTANCE_CAR": 0 if not main_cruise_enabled else 2 if enabled else 1, "SLA_ICON": 0, "NAV_ICON": 0, "TARGET": 0, }) - msg_162["LEAD"] = 0 + msg_162["LEAD"] = 0 if not main_cruise_enabled else 2 if enabled else 1 + msg_162["LEAD_DISTANCE"] = msg_1b5["LEAD_DISTANCE"] return [packer.make_can_msg(msg, CAN.ECAN, data) for msg, data in [("CCNC_0x161", msg_161), ("CCNC_0x162", msg_162)]] diff --git a/opendbc/dbc/generator/hyundai/hyundai_canfd.dbc b/opendbc/dbc/generator/hyundai/hyundai_canfd.dbc index 3fb31f036af..3b994bdad18 100644 --- a/opendbc/dbc/generator/hyundai/hyundai_canfd.dbc +++ b/opendbc/dbc/generator/hyundai/hyundai_canfd.dbc @@ -344,27 +344,23 @@ BO_ 426 CRUISE_BUTTONS_ALT: 16 XXX SG_ BYTE15 : 120|8@1+ (1,0) [0|255] "" XXX BO_ 437 CCNC_0x1B5: 32 CCNC - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ LEFT : 24|2@1+ (1,0) [0|3] "" XXX - SG_ LEFT_LDW : 27|1@0+ (1,0) [0|1] "" XXX - SG_ LEFT_1 : 29|9@1+ (1,0) [0|511] "" XXX - SG_ LEFT_2 : 38|5@1+ (1,0) [0|31] "" XXX - SG_ LEFT_3 : 43|10@1- (1,0) [0|1023] "" XXX - SG_ LEFT_4 : 64|16@1- (1,0) [0|65535] "" XXX - SG_ LEFT_5 : 80|16@1- (1,0) [0|65535] "" XXX - SG_ RIGHT : 96|2@1+ (1,0) [0|3] "" XXX - SG_ RIGHT_LDW : 99|1@0+ (1,0) [0|1] "" XXX - SG_ RIGHT_1 : 101|9@1+ (1,0) [0|511] "" XXX - SG_ RIGHT_2 : 110|5@1+ (1,0) [0|31] "" XXX - SG_ RIGHT_3 : 115|10@1- (1,0) [0|1023] "" XXX - SG_ RIGHT_4 : 128|16@1- (1,0) [0|65535] "" XXX - SG_ RIGHT_5 : 144|16@1- (1,0) [0|65535] "" XXX - SG_ LEAD : 192|2@1+ (1,0) [0|3] "" XXX - SG_ LEAD_1 : 194|6@1+ (1,0) [0|63] "" XXX - SG_ LEAD_2 : 200|11@1- (1,0) [0|4095] "" XXX - SG_ LEAD_3 : 211|1@0+ (1,0) [0|1] "" XXX - SG_ LEAD_DISTANCE : 213|11@1+ (0.1,0) [0|204.7] "m" XXX + SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX + SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX + SG_ LEFT_QUAL : 24|3@1+ (1,0) [0|7] "" XXX + SG_ LEFT_LDW : 27|2@1+ (1,0) [0|3] "" XXX + SG_ LEFT_POSITION : 29|14@1- (0.0039625,0) [-32.4608|32.4568375] "m" XXX + SG_ LEFT_HEADING : 43|10@1- (0.000976563,0) [-0.500000256|0.499023693] "rad" XXX + SG_ LEFT_CURVATURE : 64|16@1- (1E-006,0) [-0.032768|0.032767] "1/m" XXX + SG_ LEFT_CURVATURE_DERIVATIVE : 80|16@1- (4E-009,0) [-0.000131072|0.000131068] "1/m2" XXX + SG_ RIGHT_QUAL : 96|3@1+ (1,0) [0|7] "" XXX + SG_ RIGHT_LDW : 99|2@1+ (1,0) [0|3] "" XXX + SG_ RIGHT_POSITION : 101|14@1- (0.0039625,0) [-32.4608|32.4568375] "m" XXX + SG_ RIGHT_HEADING : 115|10@1- (0.000976563,0) [-0.500000256|0.499023693] "rad" XXX + SG_ RIGHT_CURVATURE : 128|16@1- (1E-006,0) [-0.032768|0.032767] "1/m" XXX + SG_ RIGHT_CURVATURE_DERIVATIVE : 144|16@1- (4E-009,0) [-0.000131072|0.000131068] "1/m2" XXX + SG_ LEAD : 192|7@1+ (1,0) [0|127] "" XXX + SG_ LEAD_SPEED : 200|12@1+ (0.05,-100) [-100|104.75] "m/s" XXX + SG_ LEAD_DISTANCE : 212|12@1+ (0.05,0) [0|204.75] "m" XXX BO_ 442 BLINDSPOTS_REAR_CORNERS: 24 XXX SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX From 4befb80f0b71d05a8d2719aebd7497a6648b496a Mon Sep 17 00:00:00 2001 From: royjr Date: Mon, 2 Jun 2025 01:18:36 -0400 Subject: [PATCH 260/316] for now --- opendbc/car/hyundai/hyundaicanfd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 6ef0757cac5..a745786c1ae 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -230,7 +230,7 @@ def create_ccnc(packer, CAN, openpilotLongitudinalControl, enabled, hud, leftBli }) msg_162["LEAD"] = 0 if not main_cruise_enabled else 2 if enabled else 1 - msg_162["LEAD_DISTANCE"] = msg_1b5["LEAD_DISTANCE"] + # msg_162["LEAD_DISTANCE"] = msg_1b5["LEAD_DISTANCE"] return [packer.make_can_msg(msg, CAN.ECAN, data) for msg, data in [("CCNC_0x161", msg_161), ("CCNC_0x162", msg_162)]] From 7d27926bb6ba281be10643bbc7804d41ee6a614a Mon Sep 17 00:00:00 2001 From: royjr Date: Mon, 2 Jun 2025 01:21:29 -0400 Subject: [PATCH 261/316] fix 1b5 --- opendbc/car/hyundai/carstate.py | 2 +- opendbc/car/hyundai/hyundaicanfd.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index 06d0b38fd4c..77ed530fc4c 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -258,7 +258,7 @@ def update_canfd(self, can_parsers) -> structs.CarState: alt = "" if self.CP.flags & HyundaiFlags.CCNC and not self.CP.flags & HyundaiFlags.CANFD_LKA_STEERING: - self.msg_161, self.msg_162 = map(copy.copy, (cp_cam.vl["CCNC_0x161"], cp_cam.vl["CCNC_0x162"])) + self.msg_161, self.msg_162, self.msg_1b5 = map(copy.copy, (cp_cam.vl["CCNC_0x161"], cp_cam.vl["CCNC_0x162"], , cp_cam.vl["CCNC_0x1B5"])) self.cruise_info = copy.copy((cp_cam if self.CP.flags & HyundaiFlags.CANFD_CAMERA_SCC else cp).vl["SCC_CONTROL"]) alt = "_ALT" ret.leftBlinker, ret.rightBlinker = self.update_blinker_from_lamp(50, cp.vl["BLINKERS"][f"LEFT_LAMP{alt}"], diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index a745786c1ae..6ef0757cac5 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -230,7 +230,7 @@ def create_ccnc(packer, CAN, openpilotLongitudinalControl, enabled, hud, leftBli }) msg_162["LEAD"] = 0 if not main_cruise_enabled else 2 if enabled else 1 - # msg_162["LEAD_DISTANCE"] = msg_1b5["LEAD_DISTANCE"] + msg_162["LEAD_DISTANCE"] = msg_1b5["LEAD_DISTANCE"] return [packer.make_can_msg(msg, CAN.ECAN, data) for msg, data in [("CCNC_0x161", msg_161), ("CCNC_0x162", msg_162)]] From 2f30d43b13318d8ea81e1830c084ac20938a7e4b Mon Sep 17 00:00:00 2001 From: royjr Date: Mon, 2 Jun 2025 01:22:58 -0400 Subject: [PATCH 262/316] really --- opendbc/car/hyundai/carstate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index 77ed530fc4c..9f98a567fd5 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -258,7 +258,7 @@ def update_canfd(self, can_parsers) -> structs.CarState: alt = "" if self.CP.flags & HyundaiFlags.CCNC and not self.CP.flags & HyundaiFlags.CANFD_LKA_STEERING: - self.msg_161, self.msg_162, self.msg_1b5 = map(copy.copy, (cp_cam.vl["CCNC_0x161"], cp_cam.vl["CCNC_0x162"], , cp_cam.vl["CCNC_0x1B5"])) + self.msg_161, self.msg_162, self.msg_1b5 = map(copy.copy, (cp_cam.vl["CCNC_0x161"], cp_cam.vl["CCNC_0x162"], cp_cam.vl["CCNC_0x1B5"])) self.cruise_info = copy.copy((cp_cam if self.CP.flags & HyundaiFlags.CANFD_CAMERA_SCC else cp).vl["SCC_CONTROL"]) alt = "_ALT" ret.leftBlinker, ret.rightBlinker = self.update_blinker_from_lamp(50, cp.vl["BLINKERS"][f"LEFT_LAMP{alt}"], From 416a1039e9cd19ffb130e543c9a3ec156e7a63a4 Mon Sep 17 00:00:00 2001 From: royjr Date: Mon, 2 Jun 2025 01:32:43 -0400 Subject: [PATCH 263/316] Update hyundai_canfd.dbc --- opendbc/dbc/generator/hyundai/hyundai_canfd.dbc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/opendbc/dbc/generator/hyundai/hyundai_canfd.dbc b/opendbc/dbc/generator/hyundai/hyundai_canfd.dbc index 3b994bdad18..da1e94c45ed 100644 --- a/opendbc/dbc/generator/hyundai/hyundai_canfd.dbc +++ b/opendbc/dbc/generator/hyundai/hyundai_canfd.dbc @@ -159,7 +159,8 @@ BO_ 353 CCNC_0x161: 32 CCNC SG_ LANELINE_LEFT_POSITION : 84|6@1+ (1,0) [0|15] "" XXX SG_ LANELINE_RIGHT : 90|4@1+ (1,0) [0|15] "" XXX SG_ LANELINE_RIGHT_POSITION : 94|6@1+ (1,0) [0|3] "" XXX - SG_ LANELINE_CURVATURE : 100|5@1- (1,15) [0|31] "" XXX + SG_ LANELINE_CURVATURE : 100|4@1+ (1,0) [0|31] "" XXX + SG_ LANELINE_CURVATURE_DIRECTION : 104|1@0+ (1,0) [0|1] "" XXX SG_ LANE_HIGHLIGHT : 105|4@1+ (1,0) [0|15] "" XXX SG_ LANE_HIGHLIGHT_DISTANCE : 109|11@1+ (0.1,0) [0|204.7] "m" XXX SG_ LANE_LEFT : 120|3@1+ (1,0) [0|7] "" XXX From 1a60e00dd75275d628569e7e0ce4cb63b7c079d6 Mon Sep 17 00:00:00 2001 From: royjr Date: Mon, 2 Jun 2025 22:22:48 -0400 Subject: [PATCH 264/316] correct car packages --- opendbc/car/hyundai/values.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/opendbc/car/hyundai/values.py b/opendbc/car/hyundai/values.py index 070c03acc87..c17a411bff7 100644 --- a/opendbc/car/hyundai/values.py +++ b/opendbc/car/hyundai/values.py @@ -320,7 +320,7 @@ class CAR(Platforms): flags=HyundaiFlags.MANDO_RADAR | HyundaiFlags.CHECKSUM_CRC8, ) HYUNDAI_SONATA_2024 = HyundaiCanFDPlatformConfig( - [HyundaiCarDocs("Hyundai Sonata 2024-25", "All", car_parts=CarParts.common([CarHarness.hyundai_a]))], + [HyundaiCarDocs("Hyundai Sonata 2024-25", car_parts=CarParts.common([CarHarness.hyundai_a]))], CarSpecs(mass=1556, wheelbase=2.84, steerRatio=12.81), flags=HyundaiFlags.CCNC, ) @@ -360,7 +360,7 @@ class CAR(Platforms): flags=HyundaiFlags.MANDO_RADAR | HyundaiFlags.CHECKSUM_CRC8 | HyundaiFlags.HYBRID, ) HYUNDAI_SONATA_HEV_2024 = HyundaiCanFDPlatformConfig( - [HyundaiCarDocs("Hyundai Sonata Hybrid 2024-25", "All", car_parts=CarParts.common([CarHarness.hyundai_a]))], + [HyundaiCarDocs("Hyundai Sonata Hybrid 2024-25", car_parts=CarParts.common([CarHarness.hyundai_a]))], CarSpecs(mass=1616, wheelbase=2.84, steerRatio=13.27), flags=HyundaiFlags.CCNC, ) @@ -417,7 +417,7 @@ class CAR(Platforms): flags=HyundaiFlags.CHECKSUM_CRC8, ) KIA_K5_2025 = HyundaiCanFDPlatformConfig( - [HyundaiCarDocs("Kia K5 2025", "Highway Driving Assist", car_parts=CarParts.common([CarHarness.hyundai_m]))], + [HyundaiCarDocs("Kia K5 2025", car_parts=CarParts.common([CarHarness.hyundai_m]))], CarSpecs(mass=3230 * CV.LB_TO_KG, wheelbase=2.85, steerRatio=13.27), flags=HyundaiFlags.CCNC, ) From 2155d8b455f3bc65020202b0d16bf10c8f50b3a9 Mon Sep 17 00:00:00 2001 From: royjr Date: Mon, 2 Jun 2025 23:03:15 -0400 Subject: [PATCH 265/316] better lane pos --- opendbc/car/hyundai/hyundaicanfd.py | 41 +++++++++++------------------ 1 file changed, 15 insertions(+), 26 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 6ef0757cac5..80cef82df7a 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -124,18 +124,6 @@ def create_lfahda_cluster(packer, CAN, enabled): } return packer.make_can_msg("LFAHDA_CLUSTER", CAN.ECAN, values) -def meters_to_ui_units(meters: float, nominal_m: float = 1.7, center_ui: int = 15, scale_per_m: float = 15/1.7) -> int: - value = abs(int(round(center_ui + (meters - nominal_m) * scale_per_m))) - return value - -def normalize_lane_lines(left_ui: float, right_ui: float, total_ui: int = 30) -> tuple[int, int]: - total_input = left_ui + right_ui - if total_input == 0: - return total_ui // 2, total_ui // 2 - left_scaled = round((left_ui / total_input) * total_ui) - right_scaled = total_ui - left_scaled - return left_scaled, right_scaled - def create_ccnc(packer, CAN, openpilotLongitudinalControl, enabled, hud, leftBlinker, rightBlinker, msg_161, msg_162, msg_1b5, is_metric, out): for f in {"FAULT_LSS", "FAULT_HDA", "FAULT_DAS", "FAULT_LFA", "FAULT_DAW"}: msg_162[f] = 0 @@ -167,18 +155,15 @@ def create_ccnc(packer, CAN, openpilotLongitudinalControl, enabled, hud, leftBli "LCA_RIGHT_ARROW": 2 if rightBlinker else 0, }) - if enabled and (leftBlinker or rightBlinker): - leftlanequal = msg_1b5["LEFT_QUAL"] - rightlanequal = msg_1b5["RIGHT_QUAL"] - leftlaneraw = msg_1b5["LEFT_POSITION"] - rightlaneraw = msg_1b5["RIGHT_POSITION"] - leftlane = meters_to_ui_units(leftlaneraw) - rightlane = meters_to_ui_units(rightlaneraw) + if lfa_icon and (leftBlinker or rightBlinker): + leftlaneraw, rightlaneraw = msg_1b5["LEFT_POSITION"], msg_1b5["RIGHT_POSITION"] + + scale_per_m = 15 / 1.7 + leftlane = abs(int(round(15 + (leftlaneraw - 1.7) * scale_per_m))) + rightlane = abs(int(round(15 + (rightlaneraw - 1.7) * scale_per_m))) - if leftlanequal not in (2, 3): - leftlane = 0 - if rightlanequal not in (2, 3): - rightlane = 0 + if msg_1b5["LEFT_QUAL"] not in (2, 3): leftlane = 0 + if msg_1b5["RIGHT_QUAL"] not in (2, 3): rightlane = 0 if leftlaneraw == -2.0248375: leftlane = 30 - rightlane @@ -186,14 +171,18 @@ def create_ccnc(packer, CAN, openpilotLongitudinalControl, enabled, hud, leftBli rightlane = 30 - leftlane if leftlaneraw == rightlaneraw == 0: - leftlane = 15 - rightlane = 15 + leftlane = rightlane = 15 elif leftlaneraw == 0: leftlane = 30 - rightlane elif rightlaneraw == 0: rightlane = 30 - leftlane - leftlane, rightlane = normalize_lane_lines(leftlane, rightlane) + total = leftlane + rightlane + if total == 0: + leftlane = rightlane = 15 + else: + leftlane = round((leftlane / total) * 30) + rightlane = 30 - leftlane msg_161["LANELINE_LEFT_POSITION"] = leftlane msg_161["LANELINE_RIGHT_POSITION"] = rightlane From 10072edbf5fe96ff2b38731173c0649412812ad1 Mon Sep 17 00:00:00 2001 From: royjr Date: Mon, 2 Jun 2025 23:06:01 -0400 Subject: [PATCH 266/316] fr --- opendbc/car/hyundai/hyundaicanfd.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 80cef82df7a..a124e149ea2 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -162,8 +162,10 @@ def create_ccnc(packer, CAN, openpilotLongitudinalControl, enabled, hud, leftBli leftlane = abs(int(round(15 + (leftlaneraw - 1.7) * scale_per_m))) rightlane = abs(int(round(15 + (rightlaneraw - 1.7) * scale_per_m))) - if msg_1b5["LEFT_QUAL"] not in (2, 3): leftlane = 0 - if msg_1b5["RIGHT_QUAL"] not in (2, 3): rightlane = 0 + if msg_1b5["LEFT_QUAL"] not in (2, 3): + leftlane = 0 + if msg_1b5["RIGHT_QUAL"] not in (2, 3): + rightlane = 0 if leftlaneraw == -2.0248375: leftlane = 30 - rightlane From 64ae32dc5cb73a3017ac65b7aec21d2d9963480c Mon Sep 17 00:00:00 2001 From: royjr Date: Mon, 2 Jun 2025 23:13:52 -0400 Subject: [PATCH 267/316] fr fr --- opendbc/car/hyundai/hyundaicanfd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index a124e149ea2..7deadde2722 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -155,7 +155,7 @@ def create_ccnc(packer, CAN, openpilotLongitudinalControl, enabled, hud, leftBli "LCA_RIGHT_ARROW": 2 if rightBlinker else 0, }) - if lfa_icon and (leftBlinker or rightBlinker): + if enabled and (leftBlinker or rightBlinker): leftlaneraw, rightlaneraw = msg_1b5["LEFT_POSITION"], msg_1b5["RIGHT_POSITION"] scale_per_m = 15 / 1.7 From de3e235234a059f5e8395926ded79b0cbae9cbe2 Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 3 Jun 2025 02:03:55 -0400 Subject: [PATCH 268/316] hide scc2 alerts --- opendbc/car/hyundai/hyundaicanfd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 7deadde2722..85e57cecdad 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -125,7 +125,7 @@ def create_lfahda_cluster(packer, CAN, enabled): return packer.make_can_msg("LFAHDA_CLUSTER", CAN.ECAN, values) def create_ccnc(packer, CAN, openpilotLongitudinalControl, enabled, hud, leftBlinker, rightBlinker, msg_161, msg_162, msg_1b5, is_metric, out): - for f in {"FAULT_LSS", "FAULT_HDA", "FAULT_DAS", "FAULT_LFA", "FAULT_DAW"}: + for f in {"FAULT_LSS", "FAULT_HDA", "FAULT_DAS", "FAULT_LFA", "FAULT_DAW", "FAULT_ESS"}: msg_162[f] = 0 if msg_161["ALERTS_2"] == 5: # CONSIDER_TAKING_A_BREAK From bea9154aa4c4c0a17fc3d17dc2ac402a59ac0944 Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 3 Jun 2025 02:04:35 -0400 Subject: [PATCH 269/316] group by similar --- opendbc/car/hyundai/hyundaicanfd.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 85e57cecdad..b7165192733 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -127,16 +127,12 @@ def create_lfahda_cluster(packer, CAN, enabled): def create_ccnc(packer, CAN, openpilotLongitudinalControl, enabled, hud, leftBlinker, rightBlinker, msg_161, msg_162, msg_1b5, is_metric, out): for f in {"FAULT_LSS", "FAULT_HDA", "FAULT_DAS", "FAULT_LFA", "FAULT_DAW", "FAULT_ESS"}: msg_162[f] = 0 - if msg_161["ALERTS_2"] == 5: # CONSIDER_TAKING_A_BREAK msg_161.update({"ALERTS_2": 0, "SOUNDS_2": 0}) - if msg_161["ALERTS_3"] == 17: # DRIVE_CAREFULLY msg_161["ALERTS_3"] = 0 - if msg_161["ALERTS_5"] in (2, 5): # WATCH_FOR_SURROUNDING_VEHICLES, USE_SWITCH_OR_PEDAL_TO_ACCELERATE msg_161["ALERTS_5"] = 0 - if msg_161["SOUNDS_4"] == 2 and msg_161["LFA_ICON"] in (3, 0,): # LFA BEEPS msg_161["SOUNDS_4"] = 0 @@ -195,10 +191,8 @@ def create_ccnc(packer, CAN, openpilotLongitudinalControl, enabled, hud, leftBli if openpilotLongitudinalControl: if msg_161["ALERTS_3"] in (1, 2, 3, 4, 7, 8, 9, 10): # HIDE ISLA, DISTANCE MESSAGES msg_161["ALERTS_3"] = 0 - if msg_161["ALERTS_5"] == 4: # SMART_CRUISE_CONTROL_CONDITIONS_NOT_MET msg_161["ALERTS_5"] = 0 - if msg_161["SOUNDS_3"] == 5: # DISABLE ISLA SOUND msg_161["SOUNDS_3"] = 0 From ea60528add94c8b3e27cab1898626ea8ca39c225 Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 3 Jun 2025 02:05:20 -0400 Subject: [PATCH 270/316] remove comments --- opendbc/car/hyundai/hyundaicanfd.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index b7165192733..d637f3b4ef0 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -127,16 +127,16 @@ def create_lfahda_cluster(packer, CAN, enabled): def create_ccnc(packer, CAN, openpilotLongitudinalControl, enabled, hud, leftBlinker, rightBlinker, msg_161, msg_162, msg_1b5, is_metric, out): for f in {"FAULT_LSS", "FAULT_HDA", "FAULT_DAS", "FAULT_LFA", "FAULT_DAW", "FAULT_ESS"}: msg_162[f] = 0 - if msg_161["ALERTS_2"] == 5: # CONSIDER_TAKING_A_BREAK + if msg_161["ALERTS_2"] == 5: msg_161.update({"ALERTS_2": 0, "SOUNDS_2": 0}) - if msg_161["ALERTS_3"] == 17: # DRIVE_CAREFULLY + if msg_161["ALERTS_3"] == 17: msg_161["ALERTS_3"] = 0 - if msg_161["ALERTS_5"] in (2, 5): # WATCH_FOR_SURROUNDING_VEHICLES, USE_SWITCH_OR_PEDAL_TO_ACCELERATE + if msg_161["ALERTS_5"] in (2, 5): msg_161["ALERTS_5"] = 0 - if msg_161["SOUNDS_4"] == 2 and msg_161["LFA_ICON"] in (3, 0,): # LFA BEEPS + if msg_161["SOUNDS_4"] == 2 and msg_161["LFA_ICON"] in (3, 0,): msg_161["SOUNDS_4"] = 0 - LANE_CHANGE_SPEED_MIN = 8.9408 # 20 * 0.44704 + LANE_CHANGE_SPEED_MIN = 8.9408 msg_161.update({ "DAW_ICON": 0, @@ -189,11 +189,11 @@ def create_ccnc(packer, CAN, openpilotLongitudinalControl, enabled, hud, leftBli msg_162["VIBRATE"] = 1 if openpilotLongitudinalControl: - if msg_161["ALERTS_3"] in (1, 2, 3, 4, 7, 8, 9, 10): # HIDE ISLA, DISTANCE MESSAGES + if msg_161["ALERTS_3"] in (1, 2, 3, 4, 7, 8, 9, 10): msg_161["ALERTS_3"] = 0 - if msg_161["ALERTS_5"] == 4: # SMART_CRUISE_CONTROL_CONDITIONS_NOT_MET + if msg_161["ALERTS_5"] == 4: msg_161["ALERTS_5"] = 0 - if msg_161["SOUNDS_3"] == 5: # DISABLE ISLA SOUND + if msg_161["SOUNDS_3"] == 5: msg_161["SOUNDS_3"] = 0 main_cruise_enabled = out.cruiseState.available @@ -246,7 +246,6 @@ def create_acc_control(packer, CAN, enabled, accel_last, accel, stopping, gas_ov "DISTANCE_SETTING": hud_control.leadDistanceBars, } - # fixes auto regen stuck on max for hybrids, should probably apply to all cars values.update({"ACC_ObjDist": 1} if cruise_info is None else {s: cruise_info[s] for s in ["ACC_ObjDist", "ACC_ObjRelSpd"]}) return packer.make_can_msg("SCC_CONTROL", CAN.ECAN, values) From 75ddabf4fb70bbb5f5f3d3b4cd90cc6f110bcc58 Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 7 Jun 2025 20:25:59 -0400 Subject: [PATCH 271/316] HYUNDAI_KONA_HEV_2ND_GEN --- opendbc/car/hyundai/fingerprints.py | 8 ++++++++ opendbc/car/hyundai/values.py | 5 +++++ opendbc/car/tests/routes.py | 1 + opendbc/car/torque_data/override.toml | 1 + 4 files changed, 15 insertions(+) diff --git a/opendbc/car/hyundai/fingerprints.py b/opendbc/car/hyundai/fingerprints.py index fc2c8334eae..47e1afa6d4e 100644 --- a/opendbc/car/hyundai/fingerprints.py +++ b/opendbc/car/hyundai/fingerprints.py @@ -977,6 +977,14 @@ b'\xf1\x00OSH LKAS AT KOR LHD 1.00 1.01 95740-CM000 l31', ], }, + CAR.HYUNDAI_KONA_HEV_2ND_GEN: { + (Ecu.fwdCamera, 0x7c4, None): [ + b'\xf1\x00SX2HMFC AT EUR RHD 1.00 1.04 99211-BE000 231010', + ], + (Ecu.fwdRadar, 0x7d0, None): [ + b'\xf1\x00SX2_ RDR ----- 1.00 1.02 99110-BE500 ', + ], + }, CAR.HYUNDAI_SONATA_HYBRID: { (Ecu.fwdRadar, 0x7d0, None): [ b'\xf1\x00DNhe SCC F-CUP 1.00 1.02 99110-L5000 ', diff --git a/opendbc/car/hyundai/values.py b/opendbc/car/hyundai/values.py index c17a411bff7..b16f6c58a91 100644 --- a/opendbc/car/hyundai/values.py +++ b/opendbc/car/hyundai/values.py @@ -265,6 +265,11 @@ class CAR(Platforms): CarSpecs(mass=1590, wheelbase=2.66, steerRatio=13.6, tireStiffnessFactor=0.385), flags=HyundaiFlags.CCNC, ) + HYUNDAI_KONA_HEV_2ND_GEN = HyundaiCanFDPlatformConfig( + [HyundaiCarDocs("Hyundai Kona Hybrid 2024", car_parts=CarParts.common([CarHarness.hyundai_l]))], + CarSpecs(mass=1590, wheelbase=2.66, steerRatio=13.6, tireStiffnessFactor=0.385), + flags=HyundaiFlags.CCNC, + ) HYUNDAI_KONA_EV = HyundaiPlatformConfig( [HyundaiCarDocs("Hyundai Kona Electric 2018-21", car_parts=CarParts.common([CarHarness.hyundai_g]))], CarSpecs(mass=1685, wheelbase=2.6, steerRatio=13.42, tireStiffnessFactor=0.385), diff --git a/opendbc/car/tests/routes.py b/opendbc/car/tests/routes.py index d7a277ecbdd..5bef6bf7218 100644 --- a/opendbc/car/tests/routes.py +++ b/opendbc/car/tests/routes.py @@ -161,6 +161,7 @@ class CarTestRoute(NamedTuple): CarTestRoute("22d955b2cd499c22|2020-08-10--19-58-21", HYUNDAI.HYUNDAI_KONA), CarTestRoute("0099bdb24d82951b/00000005--c38d940b04", HYUNDAI.HYUNDAI_KONA_2022), CarTestRoute("8f4a9150d36961c8/00000001--960c4735d5", HYUNDAI.HYUNDAI_KONA_2ND_GEN), + CarTestRoute("todo", HYUNDAI.HYUNDAI_KONA_HEV_2ND_GEN), CarTestRoute("efc48acf44b1e64d|2021-05-28--21-05-04", HYUNDAI.HYUNDAI_KONA_EV), CarTestRoute("f90d3cd06caeb6fa|2023-09-06--17-15-47", HYUNDAI.HYUNDAI_KONA_EV), # openpilot longitudinal enabled CarTestRoute("ff973b941a69366f|2022-07-28--22-01-19", HYUNDAI.HYUNDAI_KONA_EV_2022, segment=11), diff --git a/opendbc/car/torque_data/override.toml b/opendbc/car/torque_data/override.toml index 26c9433d422..a66b71d579f 100644 --- a/opendbc/car/torque_data/override.toml +++ b/opendbc/car/torque_data/override.toml @@ -78,6 +78,7 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"] "RIVIAN_R1_GEN1" = [2.8, 2.5, 0.07] "HYUNDAI_NEXO_1ST_GEN" = [2.5, 2.5, 0.1] "HYUNDAI_KONA_2ND_GEN" = [2.5, 2.5, 0.1] +"HYUNDAI_KONA_HEV_2ND_GEN" = [2.5, 2.5, 0.1] "KIA_SORENTO_2024" = [2.5, 2.5, 0.1] "KIA_K5_2025" = [2.5, 2.5, 0.1] From 9d16e30d370f8a68134ec511af4ac395a5959db2 Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 7 Jun 2025 21:03:13 -0400 Subject: [PATCH 272/316] KIA_K4_2025 --- opendbc/car/hyundai/fingerprints.py | 8 ++++++++ opendbc/car/hyundai/values.py | 5 +++++ opendbc/car/tests/routes.py | 1 + opendbc/car/torque_data/override.toml | 1 + 4 files changed, 15 insertions(+) diff --git a/opendbc/car/hyundai/fingerprints.py b/opendbc/car/hyundai/fingerprints.py index 47e1afa6d4e..97fbf738216 100644 --- a/opendbc/car/hyundai/fingerprints.py +++ b/opendbc/car/hyundai/fingerprints.py @@ -603,6 +603,14 @@ b'\xf1\x00BD__ SCC H-CUP 1.00 1.02 99110-M6000 ', ], }, + CAR.KIA_K4_2025: { + (Ecu.fwdCamera, 0x7c4, None): [ + b'\xf1\x00CL4 MFC AT USA LHD 1.00 1.02 99210-GG000 240708', + ], + (Ecu.fwdRadar, 0x7d0, None): [ + b'\xf1\x00CL4_ RDR ----- 1.00 1.01 99110-GG000 ', + ], + }, CAR.KIA_K5_2021: { (Ecu.fwdRadar, 0x7d0, None): [ b'\xf1\x00DL3_ SCC F-CUP 1.00 1.03 99110-L2100 ', diff --git a/opendbc/car/hyundai/values.py b/opendbc/car/hyundai/values.py index b16f6c58a91..52b45fc7c52 100644 --- a/opendbc/car/hyundai/values.py +++ b/opendbc/car/hyundai/values.py @@ -416,6 +416,11 @@ class CAR(Platforms): ], CarSpecs(mass=2878 * CV.LB_TO_KG, wheelbase=2.8, steerRatio=13.75, tireStiffnessFactor=0.5) ) + KIA_K4_2025 = HyundaiCanFDPlatformConfig( + [HyundaiCarDocs("Kia K4 2025", car_parts=CarParts.common([CarHarness.hyundai_a]))], + CarSpecs(mass=2987 * CV.LB_TO_KG, wheelbase=2.72, steerRatio=13.4), + # flags=HyundaiFlags.CCNC, + ) KIA_K5_2021 = HyundaiPlatformConfig( [HyundaiCarDocs("Kia K5 2021-24", car_parts=CarParts.common([CarHarness.hyundai_a]))], CarSpecs(mass=3381 * CV.LB_TO_KG, wheelbase=2.85, steerRatio=13.27, tireStiffnessFactor=0.5), # 2021 Kia K5 Steering Ratio (all trims) diff --git a/opendbc/car/tests/routes.py b/opendbc/car/tests/routes.py index 5bef6bf7218..b8afabd3cb4 100644 --- a/opendbc/car/tests/routes.py +++ b/opendbc/car/tests/routes.py @@ -175,6 +175,7 @@ class CarTestRoute(NamedTuple): CarTestRoute("d545129f3ca90f28|2022-10-19--09-22-54", HYUNDAI.KIA_EV6), # LKA steering CarTestRoute("68d6a96e703c00c9|2022-09-10--16-09-39", HYUNDAI.KIA_EV6), # LFA steering CarTestRoute("9b25e8c1484a1b67|2023-04-13--10-41-45", HYUNDAI.KIA_EV6), + CarTestRoute("todo", HYUNDAI.KIA_K4_2025), CarTestRoute("007d5e4ad9f86d13|2021-09-30--15-09-23", HYUNDAI.KIA_K5_2021), CarTestRoute("c4a804b067623789/0000007c--163f831540", HYUNDAI.KIA_K5_2025), CarTestRoute("c58dfc9fc16590e0|2023-01-14--13-51-48", HYUNDAI.KIA_K5_HEV_2020), diff --git a/opendbc/car/torque_data/override.toml b/opendbc/car/torque_data/override.toml index a66b71d579f..87ffa128f48 100644 --- a/opendbc/car/torque_data/override.toml +++ b/opendbc/car/torque_data/override.toml @@ -81,6 +81,7 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"] "HYUNDAI_KONA_HEV_2ND_GEN" = [2.5, 2.5, 0.1] "KIA_SORENTO_2024" = [2.5, 2.5, 0.1] "KIA_K5_2025" = [2.5, 2.5, 0.1] +"KIA_K4_2025" = [2.5, 2.5, 0.1] # Dashcam or fallback configured as ideal car "MOCK" = [10.0, 10, 0.0] From 05f20538ed701dc3878059eda7f7d5806cbf9cc0 Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 7 Jun 2025 21:54:05 -0400 Subject: [PATCH 273/316] k4 is ccnc --- opendbc/car/hyundai/values.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/values.py b/opendbc/car/hyundai/values.py index 52b45fc7c52..1a4819853ee 100644 --- a/opendbc/car/hyundai/values.py +++ b/opendbc/car/hyundai/values.py @@ -419,7 +419,7 @@ class CAR(Platforms): KIA_K4_2025 = HyundaiCanFDPlatformConfig( [HyundaiCarDocs("Kia K4 2025", car_parts=CarParts.common([CarHarness.hyundai_a]))], CarSpecs(mass=2987 * CV.LB_TO_KG, wheelbase=2.72, steerRatio=13.4), - # flags=HyundaiFlags.CCNC, + flags=HyundaiFlags.CCNC, ) KIA_K5_2021 = HyundaiPlatformConfig( [HyundaiCarDocs("Kia K5 2021-24", car_parts=CarParts.common([CarHarness.hyundai_a]))], From ccb7a17c02c0c829f90d1131d272f9a30bea1ec0 Mon Sep 17 00:00:00 2001 From: royjr Date: Sun, 8 Jun 2025 16:20:33 -0400 Subject: [PATCH 274/316] KIA_K4_2025 route --- opendbc/car/tests/routes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/tests/routes.py b/opendbc/car/tests/routes.py index b8afabd3cb4..a5d78b713cc 100644 --- a/opendbc/car/tests/routes.py +++ b/opendbc/car/tests/routes.py @@ -175,7 +175,7 @@ class CarTestRoute(NamedTuple): CarTestRoute("d545129f3ca90f28|2022-10-19--09-22-54", HYUNDAI.KIA_EV6), # LKA steering CarTestRoute("68d6a96e703c00c9|2022-09-10--16-09-39", HYUNDAI.KIA_EV6), # LFA steering CarTestRoute("9b25e8c1484a1b67|2023-04-13--10-41-45", HYUNDAI.KIA_EV6), - CarTestRoute("todo", HYUNDAI.KIA_K4_2025), + CarTestRoute("baf39eeaba1217ca/00000002--b36e3fa031", HYUNDAI.KIA_K4_2025), CarTestRoute("007d5e4ad9f86d13|2021-09-30--15-09-23", HYUNDAI.KIA_K5_2021), CarTestRoute("c4a804b067623789/0000007c--163f831540", HYUNDAI.KIA_K5_2025), CarTestRoute("c58dfc9fc16590e0|2023-01-14--13-51-48", HYUNDAI.KIA_K5_HEV_2020), From 6cffa3ec74c8b65afea00d8266c757950d4f7566 Mon Sep 17 00:00:00 2001 From: royjr Date: Sun, 8 Jun 2025 16:21:02 -0400 Subject: [PATCH 275/316] HYUNDAI_KONA_HEV_2ND_GEN route --- opendbc/car/tests/routes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/tests/routes.py b/opendbc/car/tests/routes.py index a5d78b713cc..19844360edd 100644 --- a/opendbc/car/tests/routes.py +++ b/opendbc/car/tests/routes.py @@ -161,7 +161,7 @@ class CarTestRoute(NamedTuple): CarTestRoute("22d955b2cd499c22|2020-08-10--19-58-21", HYUNDAI.HYUNDAI_KONA), CarTestRoute("0099bdb24d82951b/00000005--c38d940b04", HYUNDAI.HYUNDAI_KONA_2022), CarTestRoute("8f4a9150d36961c8/00000001--960c4735d5", HYUNDAI.HYUNDAI_KONA_2ND_GEN), - CarTestRoute("todo", HYUNDAI.HYUNDAI_KONA_HEV_2ND_GEN), + CarTestRoute("97ca61196eb73e0d/00000000--621d16d74f", HYUNDAI.HYUNDAI_KONA_HEV_2ND_GEN), CarTestRoute("efc48acf44b1e64d|2021-05-28--21-05-04", HYUNDAI.HYUNDAI_KONA_EV), CarTestRoute("f90d3cd06caeb6fa|2023-09-06--17-15-47", HYUNDAI.HYUNDAI_KONA_EV), # openpilot longitudinal enabled CarTestRoute("ff973b941a69366f|2022-07-28--22-01-19", HYUNDAI.HYUNDAI_KONA_EV_2022, segment=11), From 5cd2f57f0fc121aa72ba95911c12389f0016ab45 Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 28 Jun 2025 11:20:25 -0400 Subject: [PATCH 276/316] Add Hyundai Santa Cruz 2025 support Introduces initial support for the 2025 Hyundai Santa Cruz, including platform configuration, fingerprints, test route placeholder, and torque data override. Updates relevant test and configuration files to recognize the new model. --- opendbc/car/hyundai/fingerprints.py | 8 ++++++++ opendbc/car/hyundai/tests/test_hyundai.py | 1 + opendbc/car/hyundai/values.py | 5 +++++ opendbc/car/tests/routes.py | 1 + opendbc/car/torque_data/override.toml | 1 + 5 files changed, 16 insertions(+) diff --git a/opendbc/car/hyundai/fingerprints.py b/opendbc/car/hyundai/fingerprints.py index 97fbf738216..2ff9a578597 100644 --- a/opendbc/car/hyundai/fingerprints.py +++ b/opendbc/car/hyundai/fingerprints.py @@ -1143,6 +1143,14 @@ b'\xf1\x00NX4__ 1.01 1.00 99110-K5000 ', ], }, + CAR.HYUNDAI_SANTA_CRUZ_2025: { + (Ecu.fwdCamera, 0x7c4, None): [ + b'\xf1\x00NX4 FR_CMR AT USA LHD 1.00 1.00 99211-N7030 C55', + ], + (Ecu.fwdRadar, 0x7d0, None): [ + b'\xf1\x00NX4__ 1.00 1.00 99110K5500 ', + ], + }, CAR.KIA_SPORTAGE_5TH_GEN: { (Ecu.fwdCamera, 0x7c4, None): [ b'\xf1\x00NQ5 FR_CMR AT AUS RHD 1.00 1.00 99211-P1040 663', diff --git a/opendbc/car/hyundai/tests/test_hyundai.py b/opendbc/car/hyundai/tests/test_hyundai.py index f598eb18778..9e59aa4b632 100644 --- a/opendbc/car/hyundai/tests/test_hyundai.py +++ b/opendbc/car/hyundai/tests/test_hyundai.py @@ -22,6 +22,7 @@ # CAN FD CAR.KIA_SPORTAGE_5TH_GEN, CAR.HYUNDAI_SANTA_CRUZ_1ST_GEN, + CAR.HYUNDAI_SANTA_CRUZ_2025, CAR.HYUNDAI_TUCSON_4TH_GEN, CAR.HYUNDAI_TUCSON_HEV_2025, # CAN diff --git a/opendbc/car/hyundai/values.py b/opendbc/car/hyundai/values.py index 1a4819853ee..6fa9bc9e21e 100644 --- a/opendbc/car/hyundai/values.py +++ b/opendbc/car/hyundai/values.py @@ -402,6 +402,11 @@ class CAR(Platforms): # weight from Limited trim - the only supported trim, steering ratio according to Hyundai News https://www.hyundainews.com/assets/documents/original/48035-2022SantaCruzProductGuideSpecsv2081521.pdf CarSpecs(mass=1870, wheelbase=3, steerRatio=14.2), ) + HYUNDAI_SANTA_CRUZ_2025 = HyundaiCanFDPlatformConfig( + [HyundaiCarDocs("Hyundai Santa Cruz 2025", car_parts=CarParts.common([CarHarness.hyundai_n]))], + CarSpecs(mass=1920, wheelbase=3, steerRatio=14.2), + flags=HyundaiFlags.CCNC, + ) HYUNDAI_CUSTIN_1ST_GEN = HyundaiPlatformConfig( [HyundaiCarDocs("Hyundai Custin 2023", "All", car_parts=CarParts.common([CarHarness.hyundai_k]))], CarSpecs(mass=1690, wheelbase=3.055, steerRatio=17), # mass: from https://www.hyundai-motor.com.tw/clicktobuy/custin#spec_0, steerRatio: from learner diff --git a/opendbc/car/tests/routes.py b/opendbc/car/tests/routes.py index 19844360edd..871942ae0a4 100644 --- a/opendbc/car/tests/routes.py +++ b/opendbc/car/tests/routes.py @@ -122,6 +122,7 @@ class CarTestRoute(NamedTuple): CarTestRoute("66eaa6c3b6b2afc6/00000009--3a5199aabe", HYUNDAI.GENESIS_G80_2ND_GEN_FL), # LKA steering CarTestRoute("0bbe367c98fa1538|2023-09-16--00-16-49", HYUNDAI.HYUNDAI_CUSTIN_1ST_GEN), CarTestRoute("f0709d2bc6ca451f|2022-10-15--08-13-54", HYUNDAI.HYUNDAI_SANTA_CRUZ_1ST_GEN), + CarTestRoute("todo", HYUNDAI.HYUNDAI_SANTA_CRUZ_2025), CarTestRoute("4dbd55df87507948|2022-03-01--09-45-38", HYUNDAI.HYUNDAI_SANTA_FE), CarTestRoute("bf43d9df2b660eb0|2021-09-23--14-16-37", HYUNDAI.HYUNDAI_SANTA_FE_2022), CarTestRoute("37398f32561a23ad|2021-11-18--00-11-35", HYUNDAI.HYUNDAI_SANTA_FE_HEV_2022), diff --git a/opendbc/car/torque_data/override.toml b/opendbc/car/torque_data/override.toml index 87ffa128f48..432a178594e 100644 --- a/opendbc/car/torque_data/override.toml +++ b/opendbc/car/torque_data/override.toml @@ -82,6 +82,7 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"] "KIA_SORENTO_2024" = [2.5, 2.5, 0.1] "KIA_K5_2025" = [2.5, 2.5, 0.1] "KIA_K4_2025" = [2.5, 2.5, 0.1] +"HYUNDAI_SANTA_CRUZ_2025" = [2.5, 2.5, 0.1] # Dashcam or fallback configured as ideal car "MOCK" = [10.0, 10, 0.0] From aebcc0ef3c5f4359fff34fbcc8f16ad65147973e Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 28 Jun 2025 11:28:15 -0400 Subject: [PATCH 277/316] Update Hyundai CAN FD message field names and sources Replaced references to 'CCNC_0x1B5' with 'FR_CMR_03_50ms' and updated field names in hyundaicanfd.py to match new message definitions. This improves compatibility with updated CAN FD message formats for Hyundai vehicles. --- opendbc/car/hyundai/carstate.py | 4 ++-- opendbc/car/hyundai/hyundaicanfd.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index 9f98a567fd5..b737f367ab0 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -258,7 +258,7 @@ def update_canfd(self, can_parsers) -> structs.CarState: alt = "" if self.CP.flags & HyundaiFlags.CCNC and not self.CP.flags & HyundaiFlags.CANFD_LKA_STEERING: - self.msg_161, self.msg_162, self.msg_1b5 = map(copy.copy, (cp_cam.vl["CCNC_0x161"], cp_cam.vl["CCNC_0x162"], cp_cam.vl["CCNC_0x1B5"])) + self.msg_161, self.msg_162, self.msg_1b5 = map(copy.copy, (cp_cam.vl["CCNC_0x161"], cp_cam.vl["CCNC_0x162"], cp_cam.vl["FR_CMR_03_50ms"])) self.cruise_info = copy.copy((cp_cam if self.CP.flags & HyundaiFlags.CANFD_CAMERA_SCC else cp).vl["SCC_CONTROL"]) alt = "_ALT" ret.leftBlinker, ret.rightBlinker = self.update_blinker_from_lamp(50, cp.vl["BLINKERS"][f"LEFT_LAMP{alt}"], @@ -358,7 +358,7 @@ def get_can_parsers_canfd(self, CP): cam_messages += [ ("CCNC_0x161", 20), ("CCNC_0x162", 20), - ("CCNC_0x1B5", 20), + ("FR_CMR_03_50ms", 20), ] return { diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index d637f3b4ef0..4a76cf9e357 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -152,15 +152,15 @@ def create_ccnc(packer, CAN, openpilotLongitudinalControl, enabled, hud, leftBli }) if enabled and (leftBlinker or rightBlinker): - leftlaneraw, rightlaneraw = msg_1b5["LEFT_POSITION"], msg_1b5["RIGHT_POSITION"] + leftlaneraw, rightlaneraw = msg_1b5["Info_LftLnPosVal"], msg_1b5["Info_RtLnPosVal"] scale_per_m = 15 / 1.7 leftlane = abs(int(round(15 + (leftlaneraw - 1.7) * scale_per_m))) rightlane = abs(int(round(15 + (rightlaneraw - 1.7) * scale_per_m))) - if msg_1b5["LEFT_QUAL"] not in (2, 3): + if msg_1b5["Info_LftLnQualSta"] not in (2, 3): leftlane = 0 - if msg_1b5["RIGHT_QUAL"] not in (2, 3): + if msg_1b5["Info_RtLnQualSta"] not in (2, 3): rightlane = 0 if leftlaneraw == -2.0248375: @@ -215,7 +215,7 @@ def create_ccnc(packer, CAN, openpilotLongitudinalControl, enabled, hud, leftBli }) msg_162["LEAD"] = 0 if not main_cruise_enabled else 2 if enabled else 1 - msg_162["LEAD_DISTANCE"] = msg_1b5["LEAD_DISTANCE"] + msg_162["LEAD_DISTANCE"] = msg_1b5["Longitudinal_Distance"] return [packer.make_can_msg(msg, CAN.ECAN, data) for msg, data in [("CCNC_0x161", msg_161), ("CCNC_0x162", msg_162)]] From c8677dc0213e379b1e800b92075d16370a4c0a5d Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 28 Jun 2025 11:34:50 -0400 Subject: [PATCH 278/316] Add Dummy to Longitudinal_Distance signal Marked the Longitudinal_Distance signal in FR_CMR_03_50ms as Dummy for consistency with other signals. No functional changes to signal definition. --- opendbc/dbc/generator/hyundai/hyundai_canfd.dbc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/dbc/generator/hyundai/hyundai_canfd.dbc b/opendbc/dbc/generator/hyundai/hyundai_canfd.dbc index c73411d3bf3..548436e57cc 100644 --- a/opendbc/dbc/generator/hyundai/hyundai_canfd.dbc +++ b/opendbc/dbc/generator/hyundai/hyundai_canfd.dbc @@ -385,7 +385,7 @@ BO_ 437 FR_CMR_03_50ms: 32 FR_CMR SG_ Info_RtLnCvtrVal : 128|16@1- (1,0) [0|65535] "" CGW SG_ Info_RtLnCrvtrDrvtvVal : 144|16@1- (1,0) [0|65535] "" CGW SG_ ID_CIPV : 192|7@1+ (1,0) [0|127] "" Dummy - SG_ Longitudinal_Distance : 212|12@1+ (0.05,0) [0|204.75] "m" + SG_ Longitudinal_Distance : 212|12@1+ (0.05,0) [0|204.75] "m" Dummy BO_ 442 BLINDSPOTS_REAR_CORNERS: 24 XXX SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX From c2cc189026d5821eebfa1edb699e46222768ab9f Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 1 Jul 2025 18:25:40 -0400 Subject: [PATCH 279/316] Update CARS.md --- docs/CARS.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/CARS.md b/docs/CARS.md index 5725f599edc..9cac7e12843 100644 --- a/docs/CARS.md +++ b/docs/CARS.md @@ -1,6 +1,6 @@ -# Support Information for 363 Known Cars +# Support Information for 372 Known Cars |Make|Model|Package|Support Level| |---|---|---|:---:| @@ -125,27 +125,33 @@ |Hyundai|Ioniq Plug-in Hybrid 2020-22|All|[Upstream](#upstream)| |Hyundai|Kona 2020|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Hyundai|Kona 2022|Smart Cruise Control (SCC)|[Dashcam mode](#dashcam)| +|Hyundai|Kona 2024-25|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Hyundai|Kona Electric 2018-21|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Hyundai|Kona Electric 2022-23|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Hyundai|Kona Electric (with HDA II, Korea only) 2023|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Hyundai|Kona Hybrid 2020|Smart Cruise Control (SCC)|[Upstream](#upstream)| +|Hyundai|Kona Hybrid 2024|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Hyundai|Nexo 2021|All|[Upstream](#upstream)| |Hyundai|Palisade 2020-22|All|[Upstream](#upstream)| |Hyundai|Palisade 2023-24|HDA2|[Community](#community)| |Hyundai|Santa Cruz 2022-24|Smart Cruise Control (SCC)|[Upstream](#upstream)| +|Hyundai|Santa Cruz 2025|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Hyundai|Santa Fe 2019-20|All|[Upstream](#upstream)| |Hyundai|Santa Fe 2021-23|All|[Upstream](#upstream)| |Hyundai|Santa Fe Hybrid 2022-23|All|[Upstream](#upstream)| |Hyundai|Santa Fe Plug-in Hybrid 2022-23|All|[Upstream](#upstream)| |Hyundai|Sonata 2018-19|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Hyundai|Sonata 2020-23|All|[Upstream](#upstream)| +|Hyundai|Sonata 2024-25|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Hyundai|Sonata Hybrid 2020-23|All|[Upstream](#upstream)| +|Hyundai|Sonata Hybrid 2024-25|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Hyundai|Staria 2023|All|[Upstream](#upstream)| |Hyundai|Tucson 2021|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Hyundai|Tucson 2022|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Hyundai|Tucson 2023-24|All|[Upstream](#upstream)| |Hyundai|Tucson Diesel 2019|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Hyundai|Tucson Hybrid 2022-24|All|[Upstream](#upstream)| +|Hyundai|Tucson Hybrid 2025|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Hyundai|Tucson Plug-in Hybrid 2024|All|[Upstream](#upstream)| |Hyundai|Veloster 2019-20|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Jeep|Grand Cherokee 2016-18|Adaptive Cruise Control (ACC)|[Upstream](#upstream)| @@ -158,7 +164,9 @@ |Kia|EV6 (without HDA II) 2022-24|Highway Driving Assist|[Upstream](#upstream)| |Kia|Forte 2019-21|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Kia|Forte 2022-23|Smart Cruise Control (SCC)|[Upstream](#upstream)| +|Kia|K4 2025|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Kia|K5 2021-24|Smart Cruise Control (SCC)|[Upstream](#upstream)| +|Kia|K5 2025|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Kia|K5 Hybrid 2020-22|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Kia|K8 Hybrid (with HDA II) 2023|Highway Driving Assist II|[Upstream](#upstream)| |Kia|Niro EV 2019|All|[Upstream](#upstream)| @@ -183,6 +191,7 @@ |Kia|Sorento 2018|Advanced Smart Cruise Control & LKAS|[Upstream](#upstream)| |Kia|Sorento 2019|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Kia|Sorento 2021-23|Smart Cruise Control (SCC)|[Upstream](#upstream)| +|Kia|Sorento 2024-25|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Kia|Sorento Hybrid 2021-23|All|[Upstream](#upstream)| |Kia|Sorento Plug-in Hybrid 2022-23|All|[Upstream](#upstream)| |Kia|Sportage 2023-24|Smart Cruise Control (SCC)|[Upstream](#upstream)| From 6e91e67e7c57ec1066549958f4d4be33ea1b2cd4 Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 31 Jul 2025 18:55:16 -0400 Subject: [PATCH 280/316] Update CARS.md --- docs/CARS.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/CARS.md b/docs/CARS.md index 827e5ce3e7a..792443cbfed 100644 --- a/docs/CARS.md +++ b/docs/CARS.md @@ -1,6 +1,6 @@ -# Support Information for 372 Known Cars +# Support Information for 374 Known Cars |Make|Model|Package|Support Level| |---|---|---|:---:| @@ -27,7 +27,7 @@ |Chrysler|Pacifica 2019-20|Adaptive Cruise Control (ACC)|[Upstream](#upstream)| |Chrysler|Pacifica 2021-23|All|[Upstream](#upstream)| |Chrysler|Pacifica Hybrid 2017-18|Adaptive Cruise Control (ACC)|[Upstream](#upstream)| -|Chrysler|Pacifica Hybrid 2019-24|Adaptive Cruise Control (ACC)|[Upstream](#upstream)| +|Chrysler|Pacifica Hybrid 2019-25|Adaptive Cruise Control (ACC)|[Upstream](#upstream)| |comma|body|All|[Upstream](#upstream)| |CUPRA|Ateca 2018-23|Adaptive Cruise Control (ACC) & Lane Assist|[Upstream](#upstream)| |Dodge|Durango 2020-21|Adaptive Cruise Control (ACC)|[Upstream](#upstream)| @@ -82,6 +82,7 @@ |Honda|Civic Hatchback 2022-24|All|[Upstream](#upstream)| |Honda|Civic Hatchback Hybrid 2025|All|[Upstream](#upstream)| |Honda|Civic Hatchback Hybrid (Europe only) 2023|All|[Upstream](#upstream)| +|Honda|Civic Hybrid 2025|All|[Upstream](#upstream)| |Honda|Clarity 2018-21|All|[Community](#community)| |Honda|CR-V 2015-16|Touring Trim|[Upstream](#upstream)| |Honda|CR-V 2017-22|Honda Sensing|[Upstream](#upstream)| @@ -175,7 +176,7 @@ |Kia|Niro EV 2022|All|[Upstream](#upstream)| |Kia|Niro EV (with HDA II) 2025|Highway Driving Assist II|[Upstream](#upstream)| |Kia|Niro EV (without HDA II) 2023-25|All|[Upstream](#upstream)| -|Kia|Niro Hybrid 2018|All|[Upstream](#upstream)| +|Kia|Niro Hybrid 2018|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Kia|Niro Hybrid 2021|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Kia|Niro Hybrid 2022|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Kia|Niro Hybrid 2023|Smart Cruise Control (SCC)|[Upstream](#upstream)| @@ -276,6 +277,7 @@ |Å koda|Superb 2015-22|Adaptive Cruise Control (ACC) & Lane Assist|[Upstream](#upstream)| |Tesla|Model 3 (with HW3) 2019-23|All|[Upstream](#upstream)| |Tesla|Model 3 (with HW4) 2024-25|All|[Upstream](#upstream)| +|Tesla|Model X (with HW4) 2024|All|[Dashcam mode](#dashcam)| |Tesla|Model Y (with HW3) 2020-23|All|[Upstream](#upstream)| |Tesla|Model Y (with HW4) 2024|All|[Upstream](#upstream)| |Toyota|Alphard 2019-20|All|[Upstream](#upstream)| From 1400626894e69310d840aea7a13299ad8d0f98d6 Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 31 Jul 2025 18:56:44 -0400 Subject: [PATCH 281/316] remove this? --- opendbc/car/hyundai/carstate.py | 1 + 1 file changed, 1 insertion(+) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index f79d8fddcea..98845f2b7c1 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -306,6 +306,7 @@ def get_can_parsers_canfd(self, CP): msgs += [ ("CRUISE_BUTTONS", 50) ] + # remove this? if self.CP.flags & HyundaiFlags.CCNC and not self.CP.flags & HyundaiFlags.CANFD_LKA_STEERING: msgs += [ ("CCNC_0x161", 20), From 1f44bc0537af22b2e6b186e6e7d0e2001dc644bb Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 31 Jul 2025 19:56:28 -0400 Subject: [PATCH 282/316] remove radar for now --- opendbc/car/hyundai/interface.py | 3 +- opendbc/car/hyundai/radar_interface.py | 25 +- opendbc/car/hyundai/tests/test_hyundai.py | 4 +- .../generator/hyundai/hyundai_canfd_radar.dbc | 646 ------------------ .../generator/hyundai/hyundai_canfd_radar.py | 67 -- 5 files changed, 12 insertions(+), 733 deletions(-) delete mode 100644 opendbc/dbc/generator/hyundai/hyundai_canfd_radar.dbc delete mode 100755 opendbc/dbc/generator/hyundai/hyundai_canfd_radar.py diff --git a/opendbc/car/hyundai/interface.py b/opendbc/car/hyundai/interface.py index 4d7759737d3..7df39574079 100644 --- a/opendbc/car/hyundai/interface.py +++ b/opendbc/car/hyundai/interface.py @@ -3,7 +3,7 @@ from opendbc.car.hyundai.values import HyundaiFlags, CAR, DBC, \ CANFD_UNSUPPORTED_LONGITUDINAL_CAR, \ UNSUPPORTED_LONGITUDINAL_CAR, HyundaiSafetyFlags -from opendbc.car.hyundai.radar_interface import RADAR_START_ADDR_CAN, RADAR_START_ADDR_CANFD +from opendbc.car.hyundai.radar_interface import RADAR_START_ADDR from opendbc.car.interfaces import CarInterfaceBase from opendbc.car.disable_ecu import disable_ecu from opendbc.car.hyundai.carcontroller import CarController @@ -127,7 +127,6 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, alpha_lo # Common longitudinal control setup - RADAR_START_ADDR = RADAR_START_ADDR_CANFD if ret.flags & HyundaiFlags.CANFD else RADAR_START_ADDR_CAN ret.radarUnavailable = RADAR_START_ADDR not in fingerprint[1] or Bus.radar not in DBC[ret.carFingerprint] ret.openpilotLongitudinalControl = alpha_long and ret.alphaLongitudinalAvailable ret.pcmCruise = not ret.openpilotLongitudinalControl diff --git a/opendbc/car/hyundai/radar_interface.py b/opendbc/car/hyundai/radar_interface.py index d41a2501592..7e8c30708a6 100644 --- a/opendbc/car/hyundai/radar_interface.py +++ b/opendbc/car/hyundai/radar_interface.py @@ -3,15 +3,14 @@ from opendbc.can import CANParser from opendbc.car import Bus, structs from opendbc.car.interfaces import RadarInterfaceBase -from opendbc.car.hyundai.values import DBC, HyundaiFlags +from opendbc.car.hyundai.values import DBC -RADAR_START_ADDR_CAN = 0x500 -RADAR_START_ADDR_CANFD = 0x3A5 +RADAR_START_ADDR = 0x500 RADAR_MSG_COUNT = 32 # POC for parsing corner radars: https://github.com/commaai/openpilot/pull/24221/ -def get_radar_can_parser(CP, RADAR_START_ADDR): +def get_radar_can_parser(CP): if Bus.radar not in DBC[CP.carFingerprint]: return None @@ -22,14 +21,12 @@ def get_radar_can_parser(CP, RADAR_START_ADDR): class RadarInterface(RadarInterfaceBase): def __init__(self, CP): super().__init__(CP) - self.CP_flags = CP.flags - self.RADAR_START_ADDR = RADAR_START_ADDR_CANFD if self.CP_flags & HyundaiFlags.CANFD else RADAR_START_ADDR_CAN self.updated_messages = set() - self.trigger_msg = self.RADAR_START_ADDR + RADAR_MSG_COUNT - 1 + self.trigger_msg = RADAR_START_ADDR + RADAR_MSG_COUNT - 1 self.track_id = 0 self.radar_off_can = CP.radarUnavailable - self.rcp = get_radar_can_parser(CP, self.RADAR_START_ADDR) + self.rcp = get_radar_can_parser(CP) def update(self, can_strings): if self.radar_off_can or (self.rcp is None): @@ -54,7 +51,7 @@ def _update(self, updated_messages): if not self.rcp.can_valid: ret.errors.canError = True - for addr in range(self.RADAR_START_ADDR, self.RADAR_START_ADDR + RADAR_MSG_COUNT): + for addr in range(RADAR_START_ADDR, RADAR_START_ADDR + RADAR_MSG_COUNT): msg = self.rcp.vl[f"RADAR_TRACK_{addr:x}"] if addr not in self.pts: @@ -64,14 +61,10 @@ def _update(self, updated_messages): valid = msg['STATE'] in (3, 4) if valid: - if self.CP.flags & HyundaiFlags.CANFD: - self.pts[addr].dRel = msg['LONG_DIST'] - self.pts[addr].yRel = msg['LAT_DIST'] - else: - azimuth = math.radians(msg['AZIMUTH']) - self.pts[addr].dRel = math.cos(azimuth) * msg['LONG_DIST'] - self.pts[addr].yRel = 0.5 * -math.sin(azimuth) * msg['LONG_DIST'] + azimuth = math.radians(msg['AZIMUTH']) self.pts[addr].measured = True + self.pts[addr].dRel = math.cos(azimuth) * msg['LONG_DIST'] + self.pts[addr].yRel = 0.5 * -math.sin(azimuth) * msg['LONG_DIST'] self.pts[addr].vRel = msg['REL_SPEED'] self.pts[addr].aRel = msg['REL_ACCEL'] self.pts[addr].yvRel = float('nan') diff --git a/opendbc/car/hyundai/tests/test_hyundai.py b/opendbc/car/hyundai/tests/test_hyundai.py index 9e59aa4b632..b9663bd3064 100644 --- a/opendbc/car/hyundai/tests/test_hyundai.py +++ b/opendbc/car/hyundai/tests/test_hyundai.py @@ -7,7 +7,7 @@ from opendbc.car.fw_versions import build_fw_dict from opendbc.car.hyundai.interface import CarInterface from opendbc.car.hyundai.hyundaicanfd import CanBus -from opendbc.car.hyundai.radar_interface import RADAR_START_ADDR_CAN +from opendbc.car.hyundai.radar_interface import RADAR_START_ADDR from opendbc.car.hyundai.values import CAMERA_SCC_CAR, CANFD_CAR, CAN_GEARS, CAR, CHECKSUM, DATE_FW_ECUS, \ HYBRID_CAR, EV_CAR, FW_QUERY_CONFIG, LEGACY_SAFETY_MODE_CAR, CANFD_FUZZY_WHITELIST, \ UNSUPPORTED_LONGITUDINAL_CAR, PLATFORM_CODE_ECUS, HYUNDAI_VERSION_REQUEST_LONG, \ @@ -60,7 +60,7 @@ def test_feature_detection(self): for radar in (True, False): fingerprint = gen_empty_fingerprint() if radar: - fingerprint[1][RADAR_START_ADDR_CAN] = 8 + fingerprint[1][RADAR_START_ADDR] = 8 CP = CarInterface.get_params(CAR.HYUNDAI_SONATA, fingerprint, [], False, False, False) assert CP.radarUnavailable != radar diff --git a/opendbc/dbc/generator/hyundai/hyundai_canfd_radar.dbc b/opendbc/dbc/generator/hyundai/hyundai_canfd_radar.dbc deleted file mode 100644 index d9fa7ec0746..00000000000 --- a/opendbc/dbc/generator/hyundai/hyundai_canfd_radar.dbc +++ /dev/null @@ -1,646 +0,0 @@ - -VERSION "" - - -NS_ : - NS_DESC_ - CM_ - BA_DEF_ - BA_ - VAL_ - CAT_DEF_ - CAT_ - FILTER - BA_DEF_DEF_ - EV_DATA_ - ENVVAR_DATA_ - SGTYPE_ - SGTYPE_VAL_ - BA_DEF_SGTYPE_ - BA_SGTYPE_ - SIG_TYPE_REF_ - VAL_TABLE_ - SIG_GROUP_ - SIG_VALTYPE_ - SIGTYPE_VALTYPE_ - BO_TX_BU_ - BA_DEF_REL_ - BA_REL_ - BA_DEF_DEF_REL_ - BU_SG_REL_ - BU_EV_REL_ - BU_BO_REL_ - SG_MUL_VAL_ - -BS_: - -BU_: XXX - -BO_ 933 RADAR_TRACK_3a5: 24 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - -BO_ 934 RADAR_TRACK_3a6: 24 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - -BO_ 935 RADAR_TRACK_3a7: 24 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - -BO_ 936 RADAR_TRACK_3a8: 24 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - -BO_ 937 RADAR_TRACK_3a9: 24 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - -BO_ 938 RADAR_TRACK_3aa: 24 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - -BO_ 939 RADAR_TRACK_3ab: 24 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - -BO_ 940 RADAR_TRACK_3ac: 24 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - -BO_ 941 RADAR_TRACK_3ad: 24 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - -BO_ 942 RADAR_TRACK_3ae: 24 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - -BO_ 943 RADAR_TRACK_3af: 24 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - -BO_ 944 RADAR_TRACK_3b0: 24 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - -BO_ 945 RADAR_TRACK_3b1: 24 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - -BO_ 946 RADAR_TRACK_3b2: 24 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - -BO_ 947 RADAR_TRACK_3b3: 24 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - -BO_ 948 RADAR_TRACK_3b4: 24 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - -BO_ 949 RADAR_TRACK_3b5: 24 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - -BO_ 950 RADAR_TRACK_3b6: 24 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - -BO_ 951 RADAR_TRACK_3b7: 24 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - -BO_ 952 RADAR_TRACK_3b8: 24 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - -BO_ 953 RADAR_TRACK_3b9: 24 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - -BO_ 954 RADAR_TRACK_3ba: 24 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - -BO_ 955 RADAR_TRACK_3bb: 24 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - -BO_ 956 RADAR_TRACK_3bc: 24 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - -BO_ 957 RADAR_TRACK_3bd: 24 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - -BO_ 958 RADAR_TRACK_3be: 24 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - -BO_ 959 RADAR_TRACK_3bf: 24 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - -BO_ 960 RADAR_TRACK_3c0: 24 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - -BO_ 961 RADAR_TRACK_3c1: 24 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - -BO_ 962 RADAR_TRACK_3c2: 24 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - -BO_ 963 RADAR_TRACK_3c3: 24 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - -BO_ 964 RADAR_TRACK_3c4: 24 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - \ No newline at end of file diff --git a/opendbc/dbc/generator/hyundai/hyundai_canfd_radar.py b/opendbc/dbc/generator/hyundai/hyundai_canfd_radar.py deleted file mode 100755 index 6159cd2b4bb..00000000000 --- a/opendbc/dbc/generator/hyundai/hyundai_canfd_radar.py +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env python3 -import os - -if __name__ == "__main__": - dbc_name = os.path.basename(__file__).replace(".py", ".dbc") - hyundai_path = os.path.dirname(os.path.realpath(__file__)) - with open(os.path.join(hyundai_path, dbc_name), "w", encoding='utf-8') as f: - f.write(""" -VERSION "" - - -NS_ : - NS_DESC_ - CM_ - BA_DEF_ - BA_ - VAL_ - CAT_DEF_ - CAT_ - FILTER - BA_DEF_DEF_ - EV_DATA_ - ENVVAR_DATA_ - SGTYPE_ - SGTYPE_VAL_ - BA_DEF_SGTYPE_ - BA_SGTYPE_ - SIG_TYPE_REF_ - VAL_TABLE_ - SIG_GROUP_ - SIG_VALTYPE_ - SIGTYPE_VALTYPE_ - BO_TX_BU_ - BA_DEF_REL_ - BA_REL_ - BA_DEF_DEF_REL_ - BU_SG_REL_ - BU_EV_REL_ - BU_BO_REL_ - SG_MUL_VAL_ - -BS_: - -BU_: XXX - """) - - for a in range(0x3A5, 0x3A5 + 32): - f.write(f""" -BO_ {a} RADAR_TRACK_{a:x}: 24 RADAR - SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX - SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_1 : 25|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_3 : 28|2@0+ (1,0) [0|3] "" XXX - SG_ COUNTER_3 : 31|2@0+ (1,0) [0|3] "" XXX - SG_ NEW_SIGNAL_2 : 38|7@0- (1,0) [0|127] "" XXX - SG_ COUNTER_256 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ NEW_SIGNAL_6 : 51|4@0+ (1,0) [0|15] "" XXX - SG_ STATE : 54|3@0+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_8 : 62|7@0- (1,0) [0|127] "" XXX - SG_ LONG_DIST : 63|12@1+ (0.05,0) [0|8191] "m" XXX - SG_ LAT_DIST : 76|12@1- (0.05,0) [0|127] "" XXX - SG_ REL_SPEED : 88|14@1- (0.01,0) [0|16383] "" XXX - SG_ NEW_SIGNAL_4 : 103|2@0+ (1,0) [0|3] "" XXX - SG_ LAT_DIST_ACCEL : 104|13@1- (1,0) [0|8191] "" XXX - SG_ REL_ACCEL : 118|10@1- (0.02,0) [0|1023] "" XXX - SG_ NEW_SIGNAL_5 : 133|4@0+ (1,0) [0|15] "" XXX - """) From f20981517cb9edfc4b588feef73ac7ec2b1d9bd0 Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 31 Jul 2025 19:59:09 -0400 Subject: [PATCH 283/316] more no radar --- opendbc/car/hyundai/values.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/opendbc/car/hyundai/values.py b/opendbc/car/hyundai/values.py index 2c1d116f864..1e9abce772b 100644 --- a/opendbc/car/hyundai/values.py +++ b/opendbc/car/hyundai/values.py @@ -164,8 +164,6 @@ class HyundaiCanFDPlatformConfig(PlatformConfig): def init(self): self.flags |= HyundaiFlags.CANFD - if self.flags & HyundaiFlags.MANDO_RADAR: - self.dbc_dict = {Bus.pt: "hyundai_canfd_generated", Bus.radar: 'hyundai_canfd_radar_generated'} class CAR(Platforms): From 62c638a043d6406d22df40e216e892250d22c8bc Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 31 Jul 2025 20:00:29 -0400 Subject: [PATCH 284/316] cleanup dbc --- opendbc/dbc/generator/hyundai/hyundai_canfd.dbc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opendbc/dbc/generator/hyundai/hyundai_canfd.dbc b/opendbc/dbc/generator/hyundai/hyundai_canfd.dbc index 3655f739261..614eb0ad9a0 100644 --- a/opendbc/dbc/generator/hyundai/hyundai_canfd.dbc +++ b/opendbc/dbc/generator/hyundai/hyundai_canfd.dbc @@ -361,9 +361,9 @@ BO_ 426 CRUISE_BUTTONS_ALT: 16 XXX SG_ NEW_SIGNAL_5 : 42|2@1+ (1,0) [0|3] "" XXX SG_ SET_ME_2 : 44|3@1+ (1,0) [0|7] "" XXX SG_ NEW_SIGNAL_6 : 47|1@1+ (1,0) [0|1] "" XXX - SG_ CLUSTER_SPEED_MPH : 48|8@1+ (0.5,0) [0|255] "mph" XXX + SG_ BYTE6 : 48|8@1+ (1,0) [0|255] "" XXX SG_ BYTE7 : 56|8@1+ (1,0) [0|255] "" XXX - SG_ CLUSTER_SPEED_KPH : 64|8@1+ (1,0) [0|255] "kph" XXX + SG_ BYTE8 : 64|8@1+ (1,0) [0|255] "" XXX SG_ BYTE9 : 72|8@1+ (1,0) [0|255] "" XXX SG_ BYTE10 : 80|8@1+ (1,0) [0|255] "" XXX SG_ BYTE11 : 88|8@1+ (1,0) [0|255] "" XXX From 9c53c756c905a7735f96cceaddbe74ce3e082458 Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 31 Jul 2025 20:09:50 -0400 Subject: [PATCH 285/316] remove HYUNDAI_KONA_EV_2ND_GEN since HDA2 --- opendbc/car/hyundai/carstate.py | 2 ++ opendbc/car/hyundai/fingerprints.py | 7 +++---- opendbc/car/hyundai/values.py | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index 98845f2b7c1..46ef8fc2a59 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -247,6 +247,8 @@ def update_canfd(self, can_parsers) -> structs.CarState: ret.steerFaultTemporary = cp.vl["MDPS"]["LKA_FAULT"] != 0 alt = "" + if self.CP.carFingerprint == CAR.HYUNDAI_KONA_EV_2ND_GEN: + alt = "_ALT" if self.CP.flags & HyundaiFlags.CCNC and not self.CP.flags & HyundaiFlags.CANFD_LKA_STEERING: self.msg_161, self.msg_162, self.msg_1b5 = map(copy.copy, (cp_cam.vl["CCNC_0x161"], cp_cam.vl["CCNC_0x162"], cp_cam.vl["FR_CMR_03_50ms"])) self.cruise_info = copy.copy((cp_cam if self.CP.flags & HyundaiFlags.CANFD_CAMERA_SCC else cp).vl["SCC_CONTROL"]) diff --git a/opendbc/car/hyundai/fingerprints.py b/opendbc/car/hyundai/fingerprints.py index 8ef6289142b..2999b5fb6dc 100644 --- a/opendbc/car/hyundai/fingerprints.py +++ b/opendbc/car/hyundai/fingerprints.py @@ -739,13 +739,12 @@ ], }, CAR.HYUNDAI_KONA_EV_2ND_GEN: { - (Ecu.fwdCamera, 0x7c4, None): [ - b'\xf1\x00SX2EMFC AT KOR LHD 1.00 1.00 99211-BF000 230410', - b'\xf1\x00SX2EMFC AT USA LHD 1.00 1.02 99211-BF000 230823', - ], (Ecu.fwdRadar, 0x7d0, None): [ b'\xf1\x00SXev RDR ----- 1.00 1.00 99110-BF000 ', ], + (Ecu.fwdCamera, 0x7c4, None): [ + b'\xf1\x00SX2EMFC AT KOR LHD 1.00 1.00 99211-BF000 230410', + ], }, CAR.KIA_NIRO_EV: { (Ecu.fwdRadar, 0x7d0, None): [ diff --git a/opendbc/car/hyundai/values.py b/opendbc/car/hyundai/values.py index 1e9abce772b..0cc2d185673 100644 --- a/opendbc/car/hyundai/values.py +++ b/opendbc/car/hyundai/values.py @@ -282,7 +282,7 @@ class CAR(Platforms): [HyundaiCarDocs("Hyundai Kona Electric (with HDA II, Korea only) 2023", video="https://www.youtube.com/watch?v=U2fOCmcQ8hw", car_parts=CarParts.common([CarHarness.hyundai_r]))], CarSpecs(mass=1740, wheelbase=2.66, steerRatio=13.6, tireStiffnessFactor=0.385), - flags=HyundaiFlags.EV | HyundaiFlags.CANFD_NO_RADAR_DISABLE | HyundaiFlags.CCNC, + flags=HyundaiFlags.EV | HyundaiFlags.CANFD_NO_RADAR_DISABLE, ) HYUNDAI_KONA_HEV = HyundaiPlatformConfig( [HyundaiCarDocs("Hyundai Kona Hybrid 2020", car_parts=CarParts.common([CarHarness.hyundai_i]))], # TODO: check packages, From d53a515e485fa7c2fcb7f1e677dadd304e26e4cf Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 31 Jul 2025 20:27:18 -0400 Subject: [PATCH 286/316] more stock --- opendbc/car/hyundai/hyundaicanfd.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 23dcd9b3afa..2c84091acd0 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -240,6 +240,7 @@ def create_acc_control(packer, CAN, enabled, accel_last, accel, stopping, gas_ov "JerkLowerLimit": jerk if enabled else 1, "JerkUpperLimit": 3.0, + "ACC_ObjDist": 1, "ObjValid": 0, "OBJ_STATUS": 2, "SET_ME_2": 0x4, @@ -247,8 +248,8 @@ def create_acc_control(packer, CAN, enabled, accel_last, accel, stopping, gas_ov "SET_ME_TMP_64": 0x64, "DISTANCE_SETTING": hud_control.leadDistanceBars, } - - values.update({"ACC_ObjDist": 1} if cruise_info is None else {s: cruise_info[s] for s in ["ACC_ObjDist", "ACC_ObjRelSpd"]}) + if cruise_info: + values.update({s: cruise_info[s] for s in ["ACC_ObjDist", "ACC_ObjRelSpd"]}) return packer.make_can_msg("SCC_CONTROL", CAN.ECAN, values) From 2e0d812fa41e710dbd98d421e017197ee41a7b66 Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 31 Jul 2025 21:25:12 -0400 Subject: [PATCH 287/316] remove --- opendbc/car/hyundai/carstate.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index 46ef8fc2a59..eae34ab1c6d 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -308,13 +308,6 @@ def get_can_parsers_canfd(self, CP): msgs += [ ("CRUISE_BUTTONS", 50) ] - # remove this? - if self.CP.flags & HyundaiFlags.CCNC and not self.CP.flags & HyundaiFlags.CANFD_LKA_STEERING: - msgs += [ - ("CCNC_0x161", 20), - ("CCNC_0x162", 20), - ("FR_CMR_03_50ms", 20), - ] return { Bus.pt: CANParser(DBC[CP.carFingerprint][Bus.pt], msgs, CanBus(CP).ECAN), Bus.cam: CANParser(DBC[CP.carFingerprint][Bus.pt], [], CanBus(CP).CAM), From a933a5a807791e9fc5263e06d7cdbf2029ec62dc Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 31 Jul 2025 21:29:14 -0400 Subject: [PATCH 288/316] one line assign --- opendbc/car/hyundai/carstate.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index eae34ab1c6d..f81dc5fbecd 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -56,9 +56,7 @@ def __init__(self, CP): self.buttons_counter = 0 self.cruise_info = {} - self.msg_161 = {} - self.msg_162 = {} - self.msg_1b5 = {} + self.msg_161, self.msg_162, self.msg_1b5 = {}, {}, {} # On some cars, CLU15->CF_Clu_VehicleSpeed can oscillate faster than the dash updates. Sample at 5 Hz self.cluster_speed = 0 From aa7ce428517d3c94ec85375b2e59a582d5491084 Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 31 Jul 2025 21:31:53 -0400 Subject: [PATCH 289/316] one line alt --- opendbc/car/hyundai/carstate.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index f81dc5fbecd..3e12a9c4c42 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -244,9 +244,7 @@ def update_canfd(self, can_parsers) -> structs.CarState: ret.steeringPressed = self.update_steering_pressed(abs(ret.steeringTorque) > self.params.STEER_THRESHOLD, 5) ret.steerFaultTemporary = cp.vl["MDPS"]["LKA_FAULT"] != 0 - alt = "" - if self.CP.carFingerprint == CAR.HYUNDAI_KONA_EV_2ND_GEN: - alt = "_ALT" + alt = "_ALT" if self.CP.carFingerprint == CAR.HYUNDAI_KONA_EV_2ND_GEN else "" if self.CP.flags & HyundaiFlags.CCNC and not self.CP.flags & HyundaiFlags.CANFD_LKA_STEERING: self.msg_161, self.msg_162, self.msg_1b5 = map(copy.copy, (cp_cam.vl["CCNC_0x161"], cp_cam.vl["CCNC_0x162"], cp_cam.vl["FR_CMR_03_50ms"])) self.cruise_info = copy.copy((cp_cam if self.CP.flags & HyundaiFlags.CANFD_CAMERA_SCC else cp).vl["SCC_CONTROL"]) From 274f16f3674b555a201366a5d774248e3acb8119 Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 31 Jul 2025 21:32:31 -0400 Subject: [PATCH 290/316] one line blinker --- opendbc/car/hyundai/carstate.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index 3e12a9c4c42..9880fd63e32 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -249,8 +249,7 @@ def update_canfd(self, can_parsers) -> structs.CarState: self.msg_161, self.msg_162, self.msg_1b5 = map(copy.copy, (cp_cam.vl["CCNC_0x161"], cp_cam.vl["CCNC_0x162"], cp_cam.vl["FR_CMR_03_50ms"])) self.cruise_info = copy.copy((cp_cam if self.CP.flags & HyundaiFlags.CANFD_CAMERA_SCC else cp).vl["SCC_CONTROL"]) alt = "_ALT" - ret.leftBlinker, ret.rightBlinker = self.update_blinker_from_lamp(50, cp.vl["BLINKERS"][f"LEFT_LAMP{alt}"], - cp.vl["BLINKERS"][f"RIGHT_LAMP{alt}"]) + ret.leftBlinker, ret.rightBlinker = self.update_blinker_from_lamp(50, cp.vl["BLINKERS"][f"LEFT_LAMP{alt}"], cp.vl["BLINKERS"][f"RIGHT_LAMP{alt}"]) if self.CP.enableBsm: ret.leftBlindspot = cp.vl["BLINDSPOTS_REAR_CORNERS"][f"FL_INDICATOR{alt}"] != 0 ret.rightBlindspot = cp.vl["BLINDSPOTS_REAR_CORNERS"][f"FR_INDICATOR{alt}"] != 0 From 51496239d513df2c73cc2c0f4bfe12c3c40249a3 Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 31 Jul 2025 21:35:26 -0400 Subject: [PATCH 291/316] one line blindspot --- opendbc/car/hyundai/carstate.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index 9880fd63e32..7815f06aa82 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -251,8 +251,7 @@ def update_canfd(self, can_parsers) -> structs.CarState: alt = "_ALT" ret.leftBlinker, ret.rightBlinker = self.update_blinker_from_lamp(50, cp.vl["BLINKERS"][f"LEFT_LAMP{alt}"], cp.vl["BLINKERS"][f"RIGHT_LAMP{alt}"]) if self.CP.enableBsm: - ret.leftBlindspot = cp.vl["BLINDSPOTS_REAR_CORNERS"][f"FL_INDICATOR{alt}"] != 0 - ret.rightBlindspot = cp.vl["BLINDSPOTS_REAR_CORNERS"][f"FR_INDICATOR{alt}"] != 0 + ret.leftBlindspot, ret.rightBlindspot = [cp.vl["BLINDSPOTS_REAR_CORNERS"][f"{s}_INDICATOR{alt}"] != 0 for s in ("FL", "FR")] # cruise state # CAN FD cars enable on main button press, set available if no TCS faults preventing engagement From 7e0df31c4ccb2674a14f77c0a0431cc26dc08d1c Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 31 Jul 2025 21:36:29 -0400 Subject: [PATCH 292/316] dont need for now --- opendbc/car/hyundai/carstate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index 7815f06aa82..13175637311 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -245,7 +245,7 @@ def update_canfd(self, can_parsers) -> structs.CarState: ret.steerFaultTemporary = cp.vl["MDPS"]["LKA_FAULT"] != 0 alt = "_ALT" if self.CP.carFingerprint == CAR.HYUNDAI_KONA_EV_2ND_GEN else "" - if self.CP.flags & HyundaiFlags.CCNC and not self.CP.flags & HyundaiFlags.CANFD_LKA_STEERING: + if self.CP.flags & HyundaiFlags.CCNC: self.msg_161, self.msg_162, self.msg_1b5 = map(copy.copy, (cp_cam.vl["CCNC_0x161"], cp_cam.vl["CCNC_0x162"], cp_cam.vl["FR_CMR_03_50ms"])) self.cruise_info = copy.copy((cp_cam if self.CP.flags & HyundaiFlags.CANFD_CAMERA_SCC else cp).vl["SCC_CONTROL"]) alt = "_ALT" From fa54c81db8c84aa3112539e4618afd8671e6d513 Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 31 Jul 2025 21:37:33 -0400 Subject: [PATCH 293/316] Revert "one line blindspot" This reverts commit 51496239d513df2c73cc2c0f4bfe12c3c40249a3. --- opendbc/car/hyundai/carstate.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index 13175637311..acaad2ac4c1 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -251,7 +251,8 @@ def update_canfd(self, can_parsers) -> structs.CarState: alt = "_ALT" ret.leftBlinker, ret.rightBlinker = self.update_blinker_from_lamp(50, cp.vl["BLINKERS"][f"LEFT_LAMP{alt}"], cp.vl["BLINKERS"][f"RIGHT_LAMP{alt}"]) if self.CP.enableBsm: - ret.leftBlindspot, ret.rightBlindspot = [cp.vl["BLINDSPOTS_REAR_CORNERS"][f"{s}_INDICATOR{alt}"] != 0 for s in ("FL", "FR")] + ret.leftBlindspot = cp.vl["BLINDSPOTS_REAR_CORNERS"][f"FL_INDICATOR{alt}"] != 0 + ret.rightBlindspot = cp.vl["BLINDSPOTS_REAR_CORNERS"][f"FR_INDICATOR{alt}"] != 0 # cruise state # CAN FD cars enable on main button press, set available if no TCS faults preventing engagement From f51000e324fee61f6792be4671aab6e00bc96a7f Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 31 Jul 2025 21:38:45 -0400 Subject: [PATCH 294/316] Revert "one line blinker" This reverts commit 274f16f3674b555a201366a5d774248e3acb8119. --- opendbc/car/hyundai/carstate.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index acaad2ac4c1..4a54112fdf4 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -249,7 +249,8 @@ def update_canfd(self, can_parsers) -> structs.CarState: self.msg_161, self.msg_162, self.msg_1b5 = map(copy.copy, (cp_cam.vl["CCNC_0x161"], cp_cam.vl["CCNC_0x162"], cp_cam.vl["FR_CMR_03_50ms"])) self.cruise_info = copy.copy((cp_cam if self.CP.flags & HyundaiFlags.CANFD_CAMERA_SCC else cp).vl["SCC_CONTROL"]) alt = "_ALT" - ret.leftBlinker, ret.rightBlinker = self.update_blinker_from_lamp(50, cp.vl["BLINKERS"][f"LEFT_LAMP{alt}"], cp.vl["BLINKERS"][f"RIGHT_LAMP{alt}"]) + ret.leftBlinker, ret.rightBlinker = self.update_blinker_from_lamp(50, cp.vl["BLINKERS"][f"LEFT_LAMP{alt}"], + cp.vl["BLINKERS"][f"RIGHT_LAMP{alt}"]) if self.CP.enableBsm: ret.leftBlindspot = cp.vl["BLINDSPOTS_REAR_CORNERS"][f"FL_INDICATOR{alt}"] != 0 ret.rightBlindspot = cp.vl["BLINDSPOTS_REAR_CORNERS"][f"FR_INDICATOR{alt}"] != 0 From e4e46c89fb16b2fda560a25c34254dab73779998 Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 31 Jul 2025 21:44:49 -0400 Subject: [PATCH 295/316] restore LANELINE_CURVATURE --- opendbc/dbc/generator/hyundai/hyundai_canfd.dbc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/opendbc/dbc/generator/hyundai/hyundai_canfd.dbc b/opendbc/dbc/generator/hyundai/hyundai_canfd.dbc index 614eb0ad9a0..a4c852195f7 100644 --- a/opendbc/dbc/generator/hyundai/hyundai_canfd.dbc +++ b/opendbc/dbc/generator/hyundai/hyundai_canfd.dbc @@ -187,8 +187,7 @@ BO_ 353 CCNC_0x161: 32 CCNC SG_ LANELINE_LEFT_POSITION : 84|6@1+ (1,0) [0|15] "" XXX SG_ LANELINE_RIGHT : 90|4@1+ (1,0) [0|15] "" XXX SG_ LANELINE_RIGHT_POSITION : 94|6@1+ (1,0) [0|3] "" XXX - SG_ LANELINE_CURVATURE : 100|4@1+ (1,0) [0|31] "" XXX - SG_ LANELINE_CURVATURE_DIRECTION : 104|1@0+ (1,0) [0|1] "" XXX + SG_ LANELINE_CURVATURE : 100|5@1- (1,15) [0|31] "" XXX SG_ LANE_HIGHLIGHT : 105|4@1+ (1,0) [0|15] "" XXX SG_ LANE_HIGHLIGHT_DISTANCE : 109|11@1+ (0.1,0) [0|204.7] "m" XXX SG_ LANE_LEFT : 120|3@1+ (1,0) [0|7] "" XXX From b37eae54d296d3885d0a22790713090bc741c459 Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 2 Aug 2025 07:22:08 -0400 Subject: [PATCH 296/316] no cars.md --- docs/CARS.md | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/docs/CARS.md b/docs/CARS.md index 792443cbfed..aad2f2ceef5 100644 --- a/docs/CARS.md +++ b/docs/CARS.md @@ -1,6 +1,6 @@ -# Support Information for 374 Known Cars +# Support Information for 365 Known Cars |Make|Model|Package|Support Level| |---|---|---|:---:| @@ -126,33 +126,27 @@ |Hyundai|Ioniq Plug-in Hybrid 2020-22|All|[Upstream](#upstream)| |Hyundai|Kona 2020|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Hyundai|Kona 2022|Smart Cruise Control (SCC)|[Dashcam mode](#dashcam)| -|Hyundai|Kona 2024-25|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Hyundai|Kona Electric 2018-21|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Hyundai|Kona Electric 2022-23|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Hyundai|Kona Electric (with HDA II, Korea only) 2023|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Hyundai|Kona Hybrid 2020|Smart Cruise Control (SCC)|[Upstream](#upstream)| -|Hyundai|Kona Hybrid 2024|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Hyundai|Nexo 2021|All|[Upstream](#upstream)| |Hyundai|Palisade 2020-22|All|[Upstream](#upstream)| |Hyundai|Palisade 2023-24|HDA2|[Community](#community)| |Hyundai|Santa Cruz 2022-24|Smart Cruise Control (SCC)|[Upstream](#upstream)| -|Hyundai|Santa Cruz 2025|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Hyundai|Santa Fe 2019-20|All|[Upstream](#upstream)| |Hyundai|Santa Fe 2021-23|All|[Upstream](#upstream)| |Hyundai|Santa Fe Hybrid 2022-23|All|[Upstream](#upstream)| |Hyundai|Santa Fe Plug-in Hybrid 2022-23|All|[Upstream](#upstream)| |Hyundai|Sonata 2018-19|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Hyundai|Sonata 2020-23|All|[Upstream](#upstream)| -|Hyundai|Sonata 2024-25|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Hyundai|Sonata Hybrid 2020-23|All|[Upstream](#upstream)| -|Hyundai|Sonata Hybrid 2024-25|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Hyundai|Staria 2023|All|[Upstream](#upstream)| |Hyundai|Tucson 2021|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Hyundai|Tucson 2022|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Hyundai|Tucson 2023-24|All|[Upstream](#upstream)| |Hyundai|Tucson Diesel 2019|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Hyundai|Tucson Hybrid 2022-24|All|[Upstream](#upstream)| -|Hyundai|Tucson Hybrid 2025|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Hyundai|Tucson Plug-in Hybrid 2024|All|[Upstream](#upstream)| |Hyundai|Veloster 2019-20|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Jeep|Grand Cherokee 2016-18|Adaptive Cruise Control (ACC)|[Upstream](#upstream)| @@ -165,9 +159,7 @@ |Kia|EV6 (without HDA II) 2022-24|Highway Driving Assist|[Upstream](#upstream)| |Kia|Forte 2019-21|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Kia|Forte 2022-23|Smart Cruise Control (SCC)|[Upstream](#upstream)| -|Kia|K4 2025|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Kia|K5 2021-24|Smart Cruise Control (SCC)|[Upstream](#upstream)| -|Kia|K5 2025|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Kia|K5 Hybrid 2020-22|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Kia|K8 Hybrid (with HDA II) 2023|Highway Driving Assist II|[Upstream](#upstream)| |Kia|Niro EV 2019|All|[Upstream](#upstream)| @@ -192,7 +184,6 @@ |Kia|Sorento 2018|Advanced Smart Cruise Control & LKAS|[Upstream](#upstream)| |Kia|Sorento 2019|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Kia|Sorento 2021-23|Smart Cruise Control (SCC)|[Upstream](#upstream)| -|Kia|Sorento 2024-25|Smart Cruise Control (SCC)|[Upstream](#upstream)| |Kia|Sorento Hybrid 2021-23|All|[Upstream](#upstream)| |Kia|Sorento Plug-in Hybrid 2022-23|All|[Upstream](#upstream)| |Kia|Sportage 2023-24|Smart Cruise Control (SCC)|[Upstream](#upstream)| From 21d8720d09b8b1c453957f57281cad9eb1b994c8 Mon Sep 17 00:00:00 2001 From: royjr Date: Mon, 4 Aug 2025 19:11:29 -0400 Subject: [PATCH 297/316] fix ruff --- opendbc/car/hyundai/hyundaicanfd.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 617ca5cc8b4..999549cca58 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -130,6 +130,7 @@ def create_lfahda_cluster(packer, CAN, enabled): } return packer.make_can_msg("LFAHDA_CLUSTER", CAN.ECAN, values) + def create_ccnc(packer, CAN, openpilotLongitudinalControl, enabled, hud, leftBlinker, rightBlinker, msg_161, msg_162, msg_1b5, is_metric, out): for f in {"FAULT_LSS", "FAULT_HDA", "FAULT_DAS", "FAULT_LFA", "FAULT_DAW", "FAULT_ESS"}: msg_162[f] = 0 @@ -225,6 +226,7 @@ def create_ccnc(packer, CAN, openpilotLongitudinalControl, enabled, hud, leftBli return [packer.make_can_msg(msg, CAN.ECAN, data) for msg, data in [("CCNC_0x161", msg_161), ("CCNC_0x162", msg_162)]] + def create_acc_control(packer, CAN, enabled, accel_last, accel, stopping, gas_override, set_speed, hud_control, cruise_info=None): jerk = 5 jn = jerk / 50 From b7827ece186291a32c556983d1e4afda9d6e9e4a Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 13 Aug 2025 16:27:25 -0400 Subject: [PATCH 298/316] sync from sp --- opendbc/car/hyundai/carcontroller.py | 7 ++++--- opendbc/car/hyundai/carstate.py | 2 +- opendbc/car/hyundai/fingerprints.py | 1 + opendbc/car/hyundai/interface.py | 2 +- opendbc/car/hyundai/values.py | 27 +++++++++++++++------------ 5 files changed, 22 insertions(+), 17 deletions(-) diff --git a/opendbc/car/hyundai/carcontroller.py b/opendbc/car/hyundai/carcontroller.py index 9e0ce803712..28a84032e8e 100644 --- a/opendbc/car/hyundai/carcontroller.py +++ b/opendbc/car/hyundai/carcontroller.py @@ -165,6 +165,7 @@ def create_canfd_msgs(self, apply_steer_req, apply_torque, set_speed_in_units, a lka_steering = self.CP.flags & HyundaiFlags.CANFD_LKA_STEERING lka_steering_long = lka_steering and self.CP.openpilotLongitudinalControl + ccnc_non_hda2 = self.CP.flags & HyundaiFlags.CCNC and not lka_steering # steering control can_sends.extend(hyundaicanfd.create_steering_messages(self.packer, self.CP, self.CAN, CC.enabled, apply_steer_req, apply_torque)) @@ -176,7 +177,7 @@ def create_canfd_msgs(self, apply_steer_req, apply_torque, set_speed_in_units, a # LFA and HDA icons if self.frame % 5 == 0 and (not lka_steering or lka_steering_long): - if self.CP.flags & HyundaiFlags.CCNC: + if ccnc_non_hda2: can_sends.extend(hyundaicanfd.create_ccnc(self.packer, self.CAN, self.CP.openpilotLongitudinalControl, CC.enabled, CC.hudControl, CC.leftBlinker, CC.rightBlinker, CS.msg_161, CS.msg_162, CS.msg_1b5, CS.is_metric, CS.out)) else: @@ -189,11 +190,11 @@ def create_canfd_msgs(self, apply_steer_req, apply_torque, set_speed_in_units, a if self.CP.openpilotLongitudinalControl: if lka_steering: can_sends.extend(hyundaicanfd.create_adrv_messages(self.packer, self.CAN, self.frame)) - elif not self.CP.flags & HyundaiFlags.CCNC: + elif not ccnc_non_hda2: can_sends.extend(hyundaicanfd.create_fca_warning_light(self.packer, self.CAN, self.frame)) if self.frame % 2 == 0: can_sends.append(hyundaicanfd.create_acc_control(self.packer, self.CAN, CC.enabled, self.accel_last, accel, stopping, CC.cruiseControl.override, - set_speed_in_units, hud_control, CS.cruise_info if self.CP.flags & HyundaiFlags.CCNC else None)) + set_speed_in_units, hud_control, CS.cruise_info if ccnc_non_hda2 else None)) self.accel_last = accel else: # button presses diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index 4a54112fdf4..3e12a9c4c42 100644 --- a/opendbc/car/hyundai/carstate.py +++ b/opendbc/car/hyundai/carstate.py @@ -245,7 +245,7 @@ def update_canfd(self, can_parsers) -> structs.CarState: ret.steerFaultTemporary = cp.vl["MDPS"]["LKA_FAULT"] != 0 alt = "_ALT" if self.CP.carFingerprint == CAR.HYUNDAI_KONA_EV_2ND_GEN else "" - if self.CP.flags & HyundaiFlags.CCNC: + if self.CP.flags & HyundaiFlags.CCNC and not self.CP.flags & HyundaiFlags.CANFD_LKA_STEERING: self.msg_161, self.msg_162, self.msg_1b5 = map(copy.copy, (cp_cam.vl["CCNC_0x161"], cp_cam.vl["CCNC_0x162"], cp_cam.vl["FR_CMR_03_50ms"])) self.cruise_info = copy.copy((cp_cam if self.CP.flags & HyundaiFlags.CANFD_CAMERA_SCC else cp).vl["SCC_CONTROL"]) alt = "_ALT" diff --git a/opendbc/car/hyundai/fingerprints.py b/opendbc/car/hyundai/fingerprints.py index 2999b5fb6dc..97384a1b4e2 100644 --- a/opendbc/car/hyundai/fingerprints.py +++ b/opendbc/car/hyundai/fingerprints.py @@ -744,6 +744,7 @@ ], (Ecu.fwdCamera, 0x7c4, None): [ b'\xf1\x00SX2EMFC AT KOR LHD 1.00 1.00 99211-BF000 230410', + b'\xf1\x00SX2EMFC AT USA LHD 1.00 1.02 99211-BF000 230823', ], }, CAR.KIA_NIRO_EV: { diff --git a/opendbc/car/hyundai/interface.py b/opendbc/car/hyundai/interface.py index 7df39574079..260ca6cbcdf 100644 --- a/opendbc/car/hyundai/interface.py +++ b/opendbc/car/hyundai/interface.py @@ -80,7 +80,7 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, alpha_lo ret.safetyConfigs[-1].safetyParam |= HyundaiSafetyFlags.CANFD_ALT_BUTTONS.value if ret.flags & HyundaiFlags.CANFD_CAMERA_SCC: ret.safetyConfigs[-1].safetyParam |= HyundaiSafetyFlags.CAMERA_SCC.value - if ret.flags & HyundaiFlags.CCNC: + if ret.flags & HyundaiFlags.CCNC and not ret.flags & HyundaiFlags.CANFD_LKA_STEERING: ret.safetyConfigs[-1].safetyParam |= HyundaiSafetyFlags.CCNC.value else: diff --git a/opendbc/car/hyundai/values.py b/opendbc/car/hyundai/values.py index 122cbe9fd9a..e7efd9e5622 100644 --- a/opendbc/car/hyundai/values.py +++ b/opendbc/car/hyundai/values.py @@ -259,12 +259,12 @@ class CAR(Platforms): flags=HyundaiFlags.CAMERA_SCC | HyundaiFlags.ALT_LIMITS_2, ) HYUNDAI_KONA_2ND_GEN = HyundaiCanFDPlatformConfig( - [HyundaiCarDocs("Hyundai Kona 2024-25", car_parts=CarParts.common([CarHarness.hyundai_l]))], + [HyundaiCarDocs("Hyundai Kona (without HDA II) 2024-25", car_parts=CarParts.common([CarHarness.hyundai_l]))], CarSpecs(mass=1590, wheelbase=2.66, steerRatio=13.6, tireStiffnessFactor=0.385), flags=HyundaiFlags.CCNC, ) HYUNDAI_KONA_HEV_2ND_GEN = HyundaiCanFDPlatformConfig( - [HyundaiCarDocs("Hyundai Kona Hybrid 2024", car_parts=CarParts.common([CarHarness.hyundai_l]))], + [HyundaiCarDocs("Hyundai Kona Hybrid (without HDA II) 2024", car_parts=CarParts.common([CarHarness.hyundai_l]))], CarSpecs(mass=1590, wheelbase=2.66, steerRatio=13.6, tireStiffnessFactor=0.385), flags=HyundaiFlags.CCNC, ) @@ -279,10 +279,13 @@ class CAR(Platforms): flags=HyundaiFlags.CAMERA_SCC | HyundaiFlags.EV | HyundaiFlags.ALT_LIMITS, ) HYUNDAI_KONA_EV_2ND_GEN = HyundaiCanFDPlatformConfig( - [HyundaiCarDocs("Hyundai Kona Electric (with HDA II, Korea only) 2023", video="https://www.youtube.com/watch?v=U2fOCmcQ8hw", - car_parts=CarParts.common([CarHarness.hyundai_r]))], + [ + HyundaiCarDocs("Hyundai Kona Electric (with HDA II, Korea only) 2023", video="https://www.youtube.com/watch?v=U2fOCmcQ8hw", + car_parts=CarParts.common([CarHarness.hyundai_r])), + HyundaiCarDocs("Hyundai Kona Electric (without HDA II) 2024", car_parts=CarParts.common([CarHarness.hyundai_a])), + ], CarSpecs(mass=1740, wheelbase=2.66, steerRatio=13.6, tireStiffnessFactor=0.385), - flags=HyundaiFlags.EV | HyundaiFlags.CANFD_NO_RADAR_DISABLE, + flags=HyundaiFlags.EV | HyundaiFlags.CANFD_NO_RADAR_DISABLE | HyundaiFlags.CCNC, ) HYUNDAI_KONA_HEV = HyundaiPlatformConfig( [HyundaiCarDocs("Hyundai Kona Hybrid 2020", car_parts=CarParts.common([CarHarness.hyundai_i]))], # TODO: check packages, @@ -323,7 +326,7 @@ class CAR(Platforms): flags=HyundaiFlags.MANDO_RADAR | HyundaiFlags.CHECKSUM_CRC8, ) HYUNDAI_SONATA_2024 = HyundaiCanFDPlatformConfig( - [HyundaiCarDocs("Hyundai Sonata 2024-25", car_parts=CarParts.common([CarHarness.hyundai_a]))], + [HyundaiCarDocs("Hyundai Sonata (without HDA II) 2024-25", car_parts=CarParts.common([CarHarness.hyundai_a]))], CarSpecs(mass=1556, wheelbase=2.84, steerRatio=12.81), flags=HyundaiFlags.CCNC, ) @@ -363,7 +366,7 @@ class CAR(Platforms): flags=HyundaiFlags.MANDO_RADAR | HyundaiFlags.CHECKSUM_CRC8 | HyundaiFlags.HYBRID, ) HYUNDAI_SONATA_HEV_2024 = HyundaiCanFDPlatformConfig( - [HyundaiCarDocs("Hyundai Sonata Hybrid 2024-25", car_parts=CarParts.common([CarHarness.hyundai_a]))], + [HyundaiCarDocs("Hyundai Sonata Hybrid (without HDA II) 2024-25", car_parts=CarParts.common([CarHarness.hyundai_a]))], CarSpecs(mass=1616, wheelbase=2.84, steerRatio=13.27), flags=HyundaiFlags.CCNC, ) @@ -391,7 +394,7 @@ class CAR(Platforms): CarSpecs(mass=1630, wheelbase=2.756, steerRatio=13.7, tireStiffnessFactor=0.385), ) HYUNDAI_TUCSON_HEV_2025 = HyundaiCanFDPlatformConfig( - [HyundaiCarDocs("Hyundai Tucson Hybrid 2025", car_parts=CarParts.common([CarHarness.hyundai_n]))], + [HyundaiCarDocs("Hyundai Tucson Hybrid (without HDA II) 2025", car_parts=CarParts.common([CarHarness.hyundai_n]))], CarSpecs(mass=1630, wheelbase=2.756, steerRatio=13.7, tireStiffnessFactor=0.385), flags=HyundaiFlags.CCNC, ) @@ -401,7 +404,7 @@ class CAR(Platforms): CarSpecs(mass=1870, wheelbase=3, steerRatio=14.2), ) HYUNDAI_SANTA_CRUZ_2025 = HyundaiCanFDPlatformConfig( - [HyundaiCarDocs("Hyundai Santa Cruz 2025", car_parts=CarParts.common([CarHarness.hyundai_n]))], + [HyundaiCarDocs("Hyundai Santa Cruz (without HDA II) 2025", car_parts=CarParts.common([CarHarness.hyundai_n]))], CarSpecs(mass=1920, wheelbase=3, steerRatio=14.2), flags=HyundaiFlags.CCNC, ) @@ -420,7 +423,7 @@ class CAR(Platforms): CarSpecs(mass=2878 * CV.LB_TO_KG, wheelbase=2.8, steerRatio=13.75, tireStiffnessFactor=0.5) ) KIA_K4_2025 = HyundaiCanFDPlatformConfig( - [HyundaiCarDocs("Kia K4 2025", car_parts=CarParts.common([CarHarness.hyundai_a]))], + [HyundaiCarDocs("Kia K4 (without HDA II) 2025", car_parts=CarParts.common([CarHarness.hyundai_a]))], CarSpecs(mass=2987 * CV.LB_TO_KG, wheelbase=2.72, steerRatio=13.4), flags=HyundaiFlags.CCNC, ) @@ -430,7 +433,7 @@ class CAR(Platforms): flags=HyundaiFlags.CHECKSUM_CRC8, ) KIA_K5_2025 = HyundaiCanFDPlatformConfig( - [HyundaiCarDocs("Kia K5 2025", car_parts=CarParts.common([CarHarness.hyundai_m]))], + [HyundaiCarDocs("Kia K5 (without HDA II) 2025", car_parts=CarParts.common([CarHarness.hyundai_m]))], CarSpecs(mass=3230 * CV.LB_TO_KG, wheelbase=2.85, steerRatio=13.27), flags=HyundaiFlags.CCNC, ) @@ -541,7 +544,7 @@ class CAR(Platforms): flags=HyundaiFlags.RADAR_SCC, ) KIA_SORENTO_2024 = HyundaiCanFDPlatformConfig( - [HyundaiCarDocs("Kia Sorento 2024-25", car_parts=CarParts.common([CarHarness.hyundai_a]))], + [HyundaiCarDocs("Kia Sorento (without HDA II) 2024-25", car_parts=CarParts.common([CarHarness.hyundai_a]))], CarSpecs(mass=3957 * CV.LB_TO_KG, wheelbase=2.81, steerRatio=13.5), flags=HyundaiFlags.CCNC, ) From eec5635cb24f718a7b9b75cc39e5e0ed5d587564 Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 3 Sep 2025 01:12:02 -0400 Subject: [PATCH 299/316] fix tests --- opendbc/car/tests/routes.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/opendbc/car/tests/routes.py b/opendbc/car/tests/routes.py index a4c402f2e6f..3cad523bdbb 100644 --- a/opendbc/car/tests/routes.py +++ b/opendbc/car/tests/routes.py @@ -27,6 +27,10 @@ VOLKSWAGEN.VOLKSWAGEN_CRAFTER_MK2, # need a route from an ACC-equipped Crafter SUBARU.SUBARU_FORESTER_HYBRID, HONDA.HONDA_CITY_7G, # commaai/opendbc#2719 + HYUNDAI.HYUNDAI_SANTA_CRUZ_2025, + HYUNDAI.KIA_SORENTO_2024, + HYUNDAI.HYUNDAI_KONA_2ND_GEN, + HYUNDAI.HYUNDAI_KONA_HEV_2ND_GEN, ] @@ -127,7 +131,6 @@ class CarTestRoute(NamedTuple): CarTestRoute("66eaa6c3b6b2afc6/00000009--3a5199aabe", HYUNDAI.GENESIS_G80_2ND_GEN_FL), # LKA steering CarTestRoute("0bbe367c98fa1538/2023-09-16--00-16-49", HYUNDAI.HYUNDAI_CUSTIN_1ST_GEN), CarTestRoute("f0709d2bc6ca451f/2022-10-15--08-13-54", HYUNDAI.HYUNDAI_SANTA_CRUZ_1ST_GEN), - CarTestRoute("todo", HYUNDAI.HYUNDAI_SANTA_CRUZ_2025), CarTestRoute("4dbd55df87507948/2022-03-01--09-45-38", HYUNDAI.HYUNDAI_SANTA_FE), CarTestRoute("bf43d9df2b660eb0/2021-09-23--14-16-37", HYUNDAI.HYUNDAI_SANTA_FE_2022), CarTestRoute("37398f32561a23ad/2021-11-18--00-11-35", HYUNDAI.HYUNDAI_SANTA_FE_HEV_2022), @@ -141,7 +144,7 @@ class CarTestRoute(NamedTuple): CarTestRoute("6a42c1197b2a8179/2023-09-21--10-23-44", HYUNDAI.KIA_OPTIMA_H_G4_FL), CarTestRoute("c75a59efa0ecd502/2021-03-11--20-52-55", HYUNDAI.KIA_SELTOS), CarTestRoute("5b7c365c50084530/2020-04-15--16-13-24", HYUNDAI.HYUNDAI_SONATA), - CarTestRoute("4267ea8a353cdb36/00000262--8a427003c7", HYUNDAI.HYUNDAI_SONATA_2024), + CarTestRoute("4267ea8a353cdb36/00000262--8a427003c7", HYUNDAI.HYUNDAI_SONATA_2024, segment=34), CarTestRoute("b2a38c712dcf90bd/2020-05-18--18-12-48", HYUNDAI.HYUNDAI_SONATA_LF), CarTestRoute("c344fd2492c7a9d2/2023-12-11--09-03-23", HYUNDAI.HYUNDAI_STARIA_4TH_GEN), CarTestRoute("fb3fd42f0baaa2f8/2022-03-30--15-25-05", HYUNDAI.HYUNDAI_TUCSON), @@ -150,7 +153,6 @@ class CarTestRoute(NamedTuple): CarTestRoute("22f9090014364a87/00000002--4cc739c0b2", HYUNDAI.HYUNDAI_TUCSON_HEV_2025), CarTestRoute("5875672fc1d4bf57/2020-07-23--21-33-28", HYUNDAI.KIA_SORENTO), CarTestRoute("1d0d000db3370fd0/2023-01-04--22-28-42", HYUNDAI.KIA_SORENTO_4TH_GEN, segment=5), - CarTestRoute("60380edf6d76cb45/00000004--e450afc26c", HYUNDAI.KIA_SORENTO_2024), CarTestRoute("fc19648042eb6896/2023-08-16--11-43-27", HYUNDAI.KIA_SORENTO_HEV_4TH_GEN, segment=14), CarTestRoute("628935d7d3e5f4f7/2022-11-30--01-12-46", HYUNDAI.KIA_SORENTO_HEV_4TH_GEN), # plug-in hybrid CarTestRoute("9c917ba0d42ffe78/2020-04-17--12-43-19", HYUNDAI.HYUNDAI_PALISADE), @@ -166,8 +168,6 @@ class CarTestRoute(NamedTuple): CarTestRoute("ab59fe909f626921/2021-10-18--18-34-28", HYUNDAI.HYUNDAI_IONIQ_HEV_2022), CarTestRoute("22d955b2cd499c22/2020-08-10--19-58-21", HYUNDAI.HYUNDAI_KONA), CarTestRoute("0099bdb24d82951b/00000005--c38d940b04", HYUNDAI.HYUNDAI_KONA_2022), - CarTestRoute("8f4a9150d36961c8/00000001--960c4735d5", HYUNDAI.HYUNDAI_KONA_2ND_GEN), - CarTestRoute("97ca61196eb73e0d/00000000--621d16d74f", HYUNDAI.HYUNDAI_KONA_HEV_2ND_GEN), CarTestRoute("efc48acf44b1e64d/2021-05-28--21-05-04", HYUNDAI.HYUNDAI_KONA_EV), CarTestRoute("f90d3cd06caeb6fa/2023-09-06--17-15-47", HYUNDAI.HYUNDAI_KONA_EV), # openpilot longitudinal enabled CarTestRoute("ff973b941a69366f/2022-07-28--22-01-19", HYUNDAI.HYUNDAI_KONA_EV_2022, segment=11), From 5718a57d93093654a118abf45c9dce50cefb6edc Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 3 Sep 2025 22:14:11 -0400 Subject: [PATCH 300/316] add route HYUNDAI_KONA_HEV_2ND_GEN --- opendbc/car/tests/routes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/tests/routes.py b/opendbc/car/tests/routes.py index 3cad523bdbb..a09eac9fb1d 100644 --- a/opendbc/car/tests/routes.py +++ b/opendbc/car/tests/routes.py @@ -30,7 +30,6 @@ HYUNDAI.HYUNDAI_SANTA_CRUZ_2025, HYUNDAI.KIA_SORENTO_2024, HYUNDAI.HYUNDAI_KONA_2ND_GEN, - HYUNDAI.HYUNDAI_KONA_HEV_2ND_GEN, ] @@ -168,6 +167,7 @@ class CarTestRoute(NamedTuple): CarTestRoute("ab59fe909f626921/2021-10-18--18-34-28", HYUNDAI.HYUNDAI_IONIQ_HEV_2022), CarTestRoute("22d955b2cd499c22/2020-08-10--19-58-21", HYUNDAI.HYUNDAI_KONA), CarTestRoute("0099bdb24d82951b/00000005--c38d940b04", HYUNDAI.HYUNDAI_KONA_2022), + CarTestRoute("97ca61196eb73e0d/00000052--4555329470", HYUNDAI.HYUNDAI_KONA_HEV_2ND_GEN), CarTestRoute("efc48acf44b1e64d/2021-05-28--21-05-04", HYUNDAI.HYUNDAI_KONA_EV), CarTestRoute("f90d3cd06caeb6fa/2023-09-06--17-15-47", HYUNDAI.HYUNDAI_KONA_EV), # openpilot longitudinal enabled CarTestRoute("ff973b941a69366f/2022-07-28--22-01-19", HYUNDAI.HYUNDAI_KONA_EV_2022, segment=11), From 8a7171c4995be3627a2fae7a5b04ea177cc64b62 Mon Sep 17 00:00:00 2001 From: royjr Date: Sun, 7 Sep 2025 14:07:38 -0400 Subject: [PATCH 301/316] add route HYUNDAI_KONA_2ND_GEN --- opendbc/car/tests/routes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/tests/routes.py b/opendbc/car/tests/routes.py index e961bb2dbfd..bca9ad09b3e 100644 --- a/opendbc/car/tests/routes.py +++ b/opendbc/car/tests/routes.py @@ -28,7 +28,6 @@ SUBARU.SUBARU_FORESTER_HYBRID, HYUNDAI.HYUNDAI_SANTA_CRUZ_2025, HYUNDAI.KIA_SORENTO_2024, - HYUNDAI.HYUNDAI_KONA_2ND_GEN, ] @@ -167,6 +166,7 @@ class CarTestRoute(NamedTuple): CarTestRoute("ab59fe909f626921/2021-10-18--18-34-28", HYUNDAI.HYUNDAI_IONIQ_HEV_2022), CarTestRoute("22d955b2cd499c22/2020-08-10--19-58-21", HYUNDAI.HYUNDAI_KONA), CarTestRoute("0099bdb24d82951b/00000005--c38d940b04", HYUNDAI.HYUNDAI_KONA_2022), + CarTestRoute("32025f26789d8fab/00000022--a499e8ffa3", HYUNDAI.HYUNDAI_KONA_2ND_GEN), CarTestRoute("97ca61196eb73e0d/00000052--4555329470", HYUNDAI.HYUNDAI_KONA_HEV_2ND_GEN), CarTestRoute("efc48acf44b1e64d/2021-05-28--21-05-04", HYUNDAI.HYUNDAI_KONA_EV), CarTestRoute("f90d3cd06caeb6fa/2023-09-06--17-15-47", HYUNDAI.HYUNDAI_KONA_EV), # openpilot longitudinal enabled From fc5e04705590288908b1a1db220f48bf85208375 Mon Sep 17 00:00:00 2001 From: royjr Date: Sun, 7 Sep 2025 17:44:41 -0400 Subject: [PATCH 302/316] add route HYUNDAI_SANTA_CRUZ_2025 --- opendbc/car/tests/routes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/tests/routes.py b/opendbc/car/tests/routes.py index bca9ad09b3e..2468a5fdb76 100644 --- a/opendbc/car/tests/routes.py +++ b/opendbc/car/tests/routes.py @@ -26,7 +26,6 @@ HYUNDAI.GENESIS_G90, VOLKSWAGEN.VOLKSWAGEN_CRAFTER_MK2, # need a route from an ACC-equipped Crafter SUBARU.SUBARU_FORESTER_HYBRID, - HYUNDAI.HYUNDAI_SANTA_CRUZ_2025, HYUNDAI.KIA_SORENTO_2024, ] @@ -129,6 +128,7 @@ class CarTestRoute(NamedTuple): CarTestRoute("66eaa6c3b6b2afc6/00000009--3a5199aabe", HYUNDAI.GENESIS_G80_2ND_GEN_FL), # LKA steering CarTestRoute("0bbe367c98fa1538/2023-09-16--00-16-49", HYUNDAI.HYUNDAI_CUSTIN_1ST_GEN), CarTestRoute("f0709d2bc6ca451f/2022-10-15--08-13-54", HYUNDAI.HYUNDAI_SANTA_CRUZ_1ST_GEN), + CarTestRoute("6e7904b03a4aafc2/0000012f--d1b1e56a00", HYUNDAI.HYUNDAI_SANTA_CRUZ_2025), CarTestRoute("4dbd55df87507948/2022-03-01--09-45-38", HYUNDAI.HYUNDAI_SANTA_FE), CarTestRoute("bf43d9df2b660eb0/2021-09-23--14-16-37", HYUNDAI.HYUNDAI_SANTA_FE_2022), CarTestRoute("37398f32561a23ad/2021-11-18--00-11-35", HYUNDAI.HYUNDAI_SANTA_FE_HEV_2022), From b835393f0c88b410752a332d95063dff0d5a5d04 Mon Sep 17 00:00:00 2001 From: royjr Date: Sun, 7 Sep 2025 17:47:48 -0400 Subject: [PATCH 303/316] Revert "add route HYUNDAI_SANTA_CRUZ_2025" This reverts commit fc5e04705590288908b1a1db220f48bf85208375. --- opendbc/car/tests/routes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/tests/routes.py b/opendbc/car/tests/routes.py index 2468a5fdb76..bca9ad09b3e 100644 --- a/opendbc/car/tests/routes.py +++ b/opendbc/car/tests/routes.py @@ -26,6 +26,7 @@ HYUNDAI.GENESIS_G90, VOLKSWAGEN.VOLKSWAGEN_CRAFTER_MK2, # need a route from an ACC-equipped Crafter SUBARU.SUBARU_FORESTER_HYBRID, + HYUNDAI.HYUNDAI_SANTA_CRUZ_2025, HYUNDAI.KIA_SORENTO_2024, ] @@ -128,7 +129,6 @@ class CarTestRoute(NamedTuple): CarTestRoute("66eaa6c3b6b2afc6/00000009--3a5199aabe", HYUNDAI.GENESIS_G80_2ND_GEN_FL), # LKA steering CarTestRoute("0bbe367c98fa1538/2023-09-16--00-16-49", HYUNDAI.HYUNDAI_CUSTIN_1ST_GEN), CarTestRoute("f0709d2bc6ca451f/2022-10-15--08-13-54", HYUNDAI.HYUNDAI_SANTA_CRUZ_1ST_GEN), - CarTestRoute("6e7904b03a4aafc2/0000012f--d1b1e56a00", HYUNDAI.HYUNDAI_SANTA_CRUZ_2025), CarTestRoute("4dbd55df87507948/2022-03-01--09-45-38", HYUNDAI.HYUNDAI_SANTA_FE), CarTestRoute("bf43d9df2b660eb0/2021-09-23--14-16-37", HYUNDAI.HYUNDAI_SANTA_FE_2022), CarTestRoute("37398f32561a23ad/2021-11-18--00-11-35", HYUNDAI.HYUNDAI_SANTA_FE_HEV_2022), From 3b6e0225e39d99340ab94627406898b82174053d Mon Sep 17 00:00:00 2001 From: royjr Date: Sun, 7 Sep 2025 17:51:06 -0400 Subject: [PATCH 304/316] add route HYUNDAI_SANTA_CRUZ_2025 --- opendbc/car/tests/routes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/tests/routes.py b/opendbc/car/tests/routes.py index bca9ad09b3e..d92b609bd85 100644 --- a/opendbc/car/tests/routes.py +++ b/opendbc/car/tests/routes.py @@ -26,7 +26,6 @@ HYUNDAI.GENESIS_G90, VOLKSWAGEN.VOLKSWAGEN_CRAFTER_MK2, # need a route from an ACC-equipped Crafter SUBARU.SUBARU_FORESTER_HYBRID, - HYUNDAI.HYUNDAI_SANTA_CRUZ_2025, HYUNDAI.KIA_SORENTO_2024, ] @@ -129,6 +128,7 @@ class CarTestRoute(NamedTuple): CarTestRoute("66eaa6c3b6b2afc6/00000009--3a5199aabe", HYUNDAI.GENESIS_G80_2ND_GEN_FL), # LKA steering CarTestRoute("0bbe367c98fa1538/2023-09-16--00-16-49", HYUNDAI.HYUNDAI_CUSTIN_1ST_GEN), CarTestRoute("f0709d2bc6ca451f/2022-10-15--08-13-54", HYUNDAI.HYUNDAI_SANTA_CRUZ_1ST_GEN), + CarTestRoute("6e7904b03a4aafc2/0000012f--d1b1e56a00", HYUNDAI.HYUNDAI_SANTA_CRUZ_2025, segment=0), CarTestRoute("4dbd55df87507948/2022-03-01--09-45-38", HYUNDAI.HYUNDAI_SANTA_FE), CarTestRoute("bf43d9df2b660eb0/2021-09-23--14-16-37", HYUNDAI.HYUNDAI_SANTA_FE_2022), CarTestRoute("37398f32561a23ad/2021-11-18--00-11-35", HYUNDAI.HYUNDAI_SANTA_FE_HEV_2022), From 527624e509cde402f198d54bbe9a453a4f70efa4 Mon Sep 17 00:00:00 2001 From: royjr Date: Sun, 7 Sep 2025 17:54:38 -0400 Subject: [PATCH 305/316] Revert "add route HYUNDAI_SANTA_CRUZ_2025" This reverts commit 3b6e0225e39d99340ab94627406898b82174053d. --- opendbc/car/tests/routes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/tests/routes.py b/opendbc/car/tests/routes.py index d92b609bd85..bca9ad09b3e 100644 --- a/opendbc/car/tests/routes.py +++ b/opendbc/car/tests/routes.py @@ -26,6 +26,7 @@ HYUNDAI.GENESIS_G90, VOLKSWAGEN.VOLKSWAGEN_CRAFTER_MK2, # need a route from an ACC-equipped Crafter SUBARU.SUBARU_FORESTER_HYBRID, + HYUNDAI.HYUNDAI_SANTA_CRUZ_2025, HYUNDAI.KIA_SORENTO_2024, ] @@ -128,7 +129,6 @@ class CarTestRoute(NamedTuple): CarTestRoute("66eaa6c3b6b2afc6/00000009--3a5199aabe", HYUNDAI.GENESIS_G80_2ND_GEN_FL), # LKA steering CarTestRoute("0bbe367c98fa1538/2023-09-16--00-16-49", HYUNDAI.HYUNDAI_CUSTIN_1ST_GEN), CarTestRoute("f0709d2bc6ca451f/2022-10-15--08-13-54", HYUNDAI.HYUNDAI_SANTA_CRUZ_1ST_GEN), - CarTestRoute("6e7904b03a4aafc2/0000012f--d1b1e56a00", HYUNDAI.HYUNDAI_SANTA_CRUZ_2025, segment=0), CarTestRoute("4dbd55df87507948/2022-03-01--09-45-38", HYUNDAI.HYUNDAI_SANTA_FE), CarTestRoute("bf43d9df2b660eb0/2021-09-23--14-16-37", HYUNDAI.HYUNDAI_SANTA_FE_2022), CarTestRoute("37398f32561a23ad/2021-11-18--00-11-35", HYUNDAI.HYUNDAI_SANTA_FE_HEV_2022), From 0ef47008ffb7e0926e0600468b3b57df3d606d4e Mon Sep 17 00:00:00 2001 From: royjr Date: Sun, 7 Sep 2025 17:58:18 -0400 Subject: [PATCH 306/316] add route HYUNDAI_SANTA_CRUZ_2025 --- opendbc/car/tests/routes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/tests/routes.py b/opendbc/car/tests/routes.py index bca9ad09b3e..139760ece0b 100644 --- a/opendbc/car/tests/routes.py +++ b/opendbc/car/tests/routes.py @@ -26,7 +26,6 @@ HYUNDAI.GENESIS_G90, VOLKSWAGEN.VOLKSWAGEN_CRAFTER_MK2, # need a route from an ACC-equipped Crafter SUBARU.SUBARU_FORESTER_HYBRID, - HYUNDAI.HYUNDAI_SANTA_CRUZ_2025, HYUNDAI.KIA_SORENTO_2024, ] @@ -129,6 +128,7 @@ class CarTestRoute(NamedTuple): CarTestRoute("66eaa6c3b6b2afc6/00000009--3a5199aabe", HYUNDAI.GENESIS_G80_2ND_GEN_FL), # LKA steering CarTestRoute("0bbe367c98fa1538/2023-09-16--00-16-49", HYUNDAI.HYUNDAI_CUSTIN_1ST_GEN), CarTestRoute("f0709d2bc6ca451f/2022-10-15--08-13-54", HYUNDAI.HYUNDAI_SANTA_CRUZ_1ST_GEN), + CarTestRoute("6e7904b03a4aafc2/00000010--31034184b6", HYUNDAI.HYUNDAI_SANTA_CRUZ_2025), CarTestRoute("4dbd55df87507948/2022-03-01--09-45-38", HYUNDAI.HYUNDAI_SANTA_FE), CarTestRoute("bf43d9df2b660eb0/2021-09-23--14-16-37", HYUNDAI.HYUNDAI_SANTA_FE_2022), CarTestRoute("37398f32561a23ad/2021-11-18--00-11-35", HYUNDAI.HYUNDAI_SANTA_FE_HEV_2022), From eea84cd341ef0acd368eec21eb4a1442b8893b90 Mon Sep 17 00:00:00 2001 From: royjr Date: Sun, 5 Oct 2025 06:00:30 -0400 Subject: [PATCH 307/316] add HYUNDAI_KONA_HEV_2ND_GEN fps --- opendbc/car/hyundai/fingerprints.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/opendbc/car/hyundai/fingerprints.py b/opendbc/car/hyundai/fingerprints.py index b9d777de918..d636b1e8408 100644 --- a/opendbc/car/hyundai/fingerprints.py +++ b/opendbc/car/hyundai/fingerprints.py @@ -1004,9 +1004,11 @@ }, CAR.HYUNDAI_KONA_HEV_2ND_GEN: { (Ecu.fwdCamera, 0x7c4, None): [ + b'\xf1\x00SX2HMFC AT AUS RHD 1.00 1.00 99211-BE001 241015', b'\xf1\x00SX2HMFC AT EUR RHD 1.00 1.04 99211-BE000 231010', ], (Ecu.fwdRadar, 0x7d0, None): [ + b'\xf1\x00SX2_ RDR ----- 1.00 1.02 99110-BE000 ', b'\xf1\x00SX2_ RDR ----- 1.00 1.02 99110-BE500 ', ], }, From 72cd4a510406bb3b39bb51a7e3097e2032c469bd Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 11 Oct 2025 23:57:09 -0400 Subject: [PATCH 308/316] anyBlinker simple --- opendbc/car/hyundai/hyundaicanfd.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 999549cca58..dba820f9121 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -144,16 +144,17 @@ def create_ccnc(packer, CAN, openpilotLongitudinalControl, enabled, hud, leftBli msg_161["SOUNDS_4"] = 0 LANE_CHANGE_SPEED_MIN = 8.9408 + anyBlinker = leftBlinker or rightBlinker msg_161.update({ "DAW_ICON": 0, "LKA_ICON": 0, "LFA_ICON": 2 if enabled else 0, "CENTERLINE": 1 if enabled else 0, - "LANELINE_LEFT": (0 if not enabled else 1 if not hud.leftLaneVisible else 4 if hud.leftLaneDepart else 6 if leftBlinker or rightBlinker else 2), - "LANELINE_RIGHT": (0 if not enabled else 1 if not hud.rightLaneVisible else 4 if hud.rightLaneDepart else 6 if leftBlinker or rightBlinker else 2), - "LCA_LEFT_ICON": (0 if not enabled or out.vEgo < LANE_CHANGE_SPEED_MIN else 1 if out.leftBlindspot else 2 if leftBlinker or rightBlinker else 4), - "LCA_RIGHT_ICON": (0 if not enabled or out.vEgo < LANE_CHANGE_SPEED_MIN else 1 if out.rightBlindspot else 2 if leftBlinker or rightBlinker else 4), + "LANELINE_LEFT": (0 if not enabled else 1 if not hud.leftLaneVisible else 4 if hud.leftLaneDepart else 6 if anyBlinker else 2), + "LANELINE_RIGHT": (0 if not enabled else 1 if not hud.rightLaneVisible else 4 if hud.rightLaneDepart else 6 if anyBlinker else 2), + "LCA_LEFT_ICON": (0 if not enabled or out.vEgo < LANE_CHANGE_SPEED_MIN else 1 if out.leftBlindspot else 2 if anyBlinker else 4), + "LCA_RIGHT_ICON": (0 if not enabled or out.vEgo < LANE_CHANGE_SPEED_MIN else 1 if out.rightBlindspot else 2 if anyBlinker else 4), "LCA_LEFT_ARROW": 2 if leftBlinker else 0, "LCA_RIGHT_ARROW": 2 if rightBlinker else 0, }) From 0c5f345bbe287740ed14dfe9e87500789f24b0d8 Mon Sep 17 00:00:00 2001 From: royjr Date: Sat, 11 Oct 2025 23:57:57 -0400 Subject: [PATCH 309/316] add LANELINE_CURVATURE --- opendbc/car/hyundai/hyundaicanfd.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index dba820f9121..614dd76a1a3 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -145,12 +145,14 @@ def create_ccnc(packer, CAN, openpilotLongitudinalControl, enabled, hud, leftBli LANE_CHANGE_SPEED_MIN = 8.9408 anyBlinker = leftBlinker or rightBlinker + curvature = {i: (31 if i == -1 else 13 - abs(i + 15)) if i < 0 else 15 + i for i in range(-15, 16)} msg_161.update({ "DAW_ICON": 0, "LKA_ICON": 0, "LFA_ICON": 2 if enabled else 0, "CENTERLINE": 1 if enabled else 0, + "LANELINE_CURVATURE": curvature.get(max(-15, min(int(out.steeringAngleDeg / 4.5), 15)), 14) if enabled and not anyBlinker else 15, "LANELINE_LEFT": (0 if not enabled else 1 if not hud.leftLaneVisible else 4 if hud.leftLaneDepart else 6 if anyBlinker else 2), "LANELINE_RIGHT": (0 if not enabled else 1 if not hud.rightLaneVisible else 4 if hud.rightLaneDepart else 6 if anyBlinker else 2), "LCA_LEFT_ICON": (0 if not enabled or out.vEgo < LANE_CHANGE_SPEED_MIN else 1 if out.leftBlindspot else 2 if anyBlinker else 4), From a7f355d301b9b685ed06685be5ddb4c659e44cf9 Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 12 Nov 2025 16:25:32 -0500 Subject: [PATCH 310/316] Update routes.py --- opendbc/car/tests/routes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/tests/routes.py b/opendbc/car/tests/routes.py index ccd6f792e1d..95e871b77d4 100644 --- a/opendbc/car/tests/routes.py +++ b/opendbc/car/tests/routes.py @@ -30,7 +30,7 @@ HONDA.ACURA_TLX_2G, HONDA.HONDA_NBOX_2G, HONDA.ACURA_MDX_4G_MMR, - HONDA.HONDA_CITY_7G + HONDA.HONDA_CITY_7G, HYUNDAI.KIA_SORENTO_2024, ] From 62ff2943421a829810b709428e1ac097dcbc4987 Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 12 Nov 2025 18:57:48 -0500 Subject: [PATCH 311/316] better match sp logic --- opendbc/car/hyundai/hyundaicanfd.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/opendbc/car/hyundai/hyundaicanfd.py b/opendbc/car/hyundai/hyundaicanfd.py index 614dd76a1a3..47dc1a19dc7 100644 --- a/opendbc/car/hyundai/hyundaicanfd.py +++ b/opendbc/car/hyundai/hyundaicanfd.py @@ -147,21 +147,23 @@ def create_ccnc(packer, CAN, openpilotLongitudinalControl, enabled, hud, leftBli anyBlinker = leftBlinker or rightBlinker curvature = {i: (31 if i == -1 else 13 - abs(i + 15)) if i < 0 else 15 + i for i in range(-15, 16)} + lfa_icon = enabled + msg_161.update({ "DAW_ICON": 0, "LKA_ICON": 0, - "LFA_ICON": 2 if enabled else 0, - "CENTERLINE": 1 if enabled else 0, - "LANELINE_CURVATURE": curvature.get(max(-15, min(int(out.steeringAngleDeg / 4.5), 15)), 14) if enabled and not anyBlinker else 15, - "LANELINE_LEFT": (0 if not enabled else 1 if not hud.leftLaneVisible else 4 if hud.leftLaneDepart else 6 if anyBlinker else 2), - "LANELINE_RIGHT": (0 if not enabled else 1 if not hud.rightLaneVisible else 4 if hud.rightLaneDepart else 6 if anyBlinker else 2), - "LCA_LEFT_ICON": (0 if not enabled or out.vEgo < LANE_CHANGE_SPEED_MIN else 1 if out.leftBlindspot else 2 if anyBlinker else 4), - "LCA_RIGHT_ICON": (0 if not enabled or out.vEgo < LANE_CHANGE_SPEED_MIN else 1 if out.rightBlindspot else 2 if anyBlinker else 4), + "LFA_ICON": 2 if lfa_icon else 0, + "CENTERLINE": 1 if lfa_icon else 0, + "LANELINE_CURVATURE": curvature.get(max(-15, min(int(out.steeringAngleDeg / 4.5), 15)), 14) if lfa_icon and not anyBlinker else 15, + "LANELINE_LEFT": (0 if not lfa_icon else 1 if not hud.leftLaneVisible else 4 if hud.leftLaneDepart else 6 if anyBlinker else 2), + "LANELINE_RIGHT": (0 if not lfa_icon else 1 if not hud.rightLaneVisible else 4 if hud.rightLaneDepart else 6 if anyBlinker else 2), + "LCA_LEFT_ICON": (0 if not lfa_icon or out.vEgo < LANE_CHANGE_SPEED_MIN else 1 if out.leftBlindspot else 2 if anyBlinker else 4), + "LCA_RIGHT_ICON": (0 if not lfa_icon or out.vEgo < LANE_CHANGE_SPEED_MIN else 1 if out.rightBlindspot else 2 if anyBlinker else 4), "LCA_LEFT_ARROW": 2 if leftBlinker else 0, "LCA_RIGHT_ARROW": 2 if rightBlinker else 0, }) - if enabled and (leftBlinker or rightBlinker): + if lfa_icon and (leftBlinker or rightBlinker): leftlaneraw, rightlaneraw = msg_1b5["Info_LftLnPosVal"], msg_1b5["Info_RtLnPosVal"] scale_per_m = 15 / 1.7 From 80b88e41e33c1842b674859d01adab4298f01d16 Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 12 Nov 2025 19:02:53 -0500 Subject: [PATCH 312/316] fix cov --- opendbc/safety/modes/hyundai_canfd.h | 4 +- opendbc/safety/tests/test_hyundai_canfd.py | 75 ++++++++++++++++++++++ 2 files changed, 77 insertions(+), 2 deletions(-) diff --git a/opendbc/safety/modes/hyundai_canfd.h b/opendbc/safety/modes/hyundai_canfd.h index c03f8bf257f..1e9429f8aa6 100644 --- a/opendbc/safety/modes/hyundai_canfd.h +++ b/opendbc/safety/modes/hyundai_canfd.h @@ -319,7 +319,7 @@ static safety_config hyundai_canfd_init(uint16_t param) { if (hyundai_camera_scc) { if (get_hyundai_ccnc()) { - SET_TX_MSGS(hyundai_canfd_lfa_steering_camera_scc_ccnc_tx_msgs, ret); // LCOV_EXCL_LINE + SET_TX_MSGS(hyundai_canfd_lfa_steering_camera_scc_ccnc_tx_msgs, ret); } else { SET_TX_MSGS(hyundai_canfd_lfa_steering_camera_scc_tx_msgs, ret); } @@ -388,7 +388,7 @@ static safety_config hyundai_canfd_init(uint16_t param) { }; if (get_hyundai_ccnc()) { - SET_TX_MSGS(hyundai_canfd_lfa_steering_camera_scc_ccnc_tx_msgs, ret); // LCOV_EXCL_LINE + SET_TX_MSGS(hyundai_canfd_lfa_steering_camera_scc_ccnc_tx_msgs, ret); } else { SET_TX_MSGS(hyundai_canfd_lfa_steering_camera_scc_tx_msgs, ret); } diff --git a/opendbc/safety/tests/test_hyundai_canfd.py b/opendbc/safety/tests/test_hyundai_canfd.py index dd992f33799..42c7716ca77 100755 --- a/opendbc/safety/tests/test_hyundai_canfd.py +++ b/opendbc/safety/tests/test_hyundai_canfd.py @@ -21,6 +21,13 @@ {"GAS_MSG": ("ACCELERATOR_ALT", "ACCELERATOR_PEDAL"), "SCC_BUS": 2, "SAFETY_PARAM": HyundaiSafetyFlags.HYBRID_GAS | HyundaiSafetyFlags.CAMERA_SCC}, ] +ALL_GAS_EV_HYBRID_COMBOS_CCNC = [ + # Camera SCC + {"GAS_MSG": ("ACCELERATOR_BRAKE_ALT", "ACCELERATOR_PEDAL_PRESSED"), "SCC_BUS": 2, "SAFETY_PARAM": HyundaiSafetyFlags.CAMERA_SCC}, + {"GAS_MSG": ("ACCELERATOR", "ACCELERATOR_PEDAL"), "SCC_BUS": 2, "SAFETY_PARAM": HyundaiSafetyFlags.EV_GAS | HyundaiSafetyFlags.CAMERA_SCC}, + {"GAS_MSG": ("ACCELERATOR_ALT", "ACCELERATOR_PEDAL"), "SCC_BUS": 2, "SAFETY_PARAM": HyundaiSafetyFlags.HYBRID_GAS | HyundaiSafetyFlags.CAMERA_SCC}, +] + class TestHyundaiCanfdBase(HyundaiButtonBase, common.CarSafetyTest, common.DriverTorqueSteeringSafetyTest, common.SteerRequestCutSafetyTest): @@ -284,5 +291,73 @@ def test_acc_cancel(self): pass +@parameterized_class(ALL_GAS_EV_HYBRID_COMBOS_CCNC) +class TestHyundaiCanfdLFASteeringCCNC(TestHyundaiCanfdLFASteeringBase): + + TX_MSGS = [[0x12A, 0], [0x1E0, 0], [0x1CF, 2], [0x7C4, 2]] + RELAY_MALFUNCTION_ADDRS = {0: (0x12A, 0x1E0, 0x161, 0x162), 2: (0x7C4, 0xEA)} + FWD_BLACKLISTED_ADDRS = {2: [0x12A, 0x1E0, 0x161, 0x162], 0: [0x7C4, 0xEA]} + + @classmethod + def setUpClass(cls): + if cls.__name__ == "TestHyundaiCanfdLFASteeringCCNC": + cls.safety = None + raise unittest.SkipTest + + def setUp(self): + self.packer = CANPackerPanda("hyundai_canfd_generated") + self.safety = libsafety_py.libsafety + self.safety.set_safety_hooks(CarParams.SafetyModel.hyundaiCanfd, HyundaiSafetyFlags.CCNC | self.SAFETY_PARAM) + self.safety.init_tests() + + def test_ccnc(self): + self.assertTrue(self._tx(self.packer.make_can_msg_panda("CCNC_0x161", self.STEER_BUS, {}))) + self.assertTrue(self._tx(self.packer.make_can_msg_panda("CCNC_0x162", self.STEER_BUS, {}))) + + def test_tx_hook_on_wrong_safety_mode(self): + from opendbc.safety.tests.common import make_msg + import importlib + for test_name in ["TestElm327"]: + mod = importlib.import_module("opendbc.safety.tests.test_" + test_name.replace("Test", "").lower()) + tx_list = [m for m in getattr(mod, test_name).TX_MSGS if m[0] != 0x7C4] # skip overlapping 0x7C4 from Elm327 + for addr, bus in tx_list: + if [addr, bus] not in self.TX_MSGS: + self.assertFalse(self._tx(make_msg(bus, addr)), f"allowed TX {addr=:#x} {bus=}") + + +@parameterized_class(ALL_GAS_EV_HYBRID_COMBOS_CCNC) +class TestHyundaiCanfdLFASteeringLongCCNC(TestHyundaiCanfdLFASteeringLongBase): + + TX_MSGS = [[0x12A, 0], [0x1E0, 0], [0x1CF, 2], [0x7C4, 2], [0x1A0, 0]] + RELAY_MALFUNCTION_ADDRS = {0: (0x12A, 0x1E0, 0x161, 0x162, 0x1A0), 2: (0x7C4, 0xEA)} + FWD_BLACKLISTED_ADDRS = {2: [0x12A, 0x1E0, 0x161, 0x162, 0x1A0], 0: [0x7C4, 0xEA]} + + @classmethod + def setUpClass(cls): + if cls.__name__ == "TestHyundaiCanfdLFASteeringLongCCNC": + cls.safety = None + raise unittest.SkipTest + + def setUp(self): + self.packer = CANPackerPanda("hyundai_canfd_generated") + self.safety = libsafety_py.libsafety + self.safety.set_safety_hooks(CarParams.SafetyModel.hyundaiCanfd, HyundaiSafetyFlags.CCNC | HyundaiSafetyFlags.LONG | self.SAFETY_PARAM) + self.safety.init_tests() + + def test_ccnc(self): + self.assertTrue(self._tx(self.packer.make_can_msg_panda("CCNC_0x161", self.STEER_BUS, {}))) + self.assertTrue(self._tx(self.packer.make_can_msg_panda("CCNC_0x162", self.STEER_BUS, {}))) + + def test_tx_hook_on_wrong_safety_mode(self): + from opendbc.safety.tests.common import make_msg + import importlib + for test_name in ["TestElm327"]: + mod = importlib.import_module("opendbc.safety.tests.test_" + test_name.replace("Test", "").lower()) + tx_list = [m for m in getattr(mod, test_name).TX_MSGS if m[0] != 0x7C4] # skip overlapping 0x7C4 from Elm327 + for addr, bus in tx_list: + if [addr, bus] not in self.TX_MSGS: + self.assertFalse(self._tx(make_msg(bus, addr)), f"allowed TX {addr=:#x} {bus=}") + + if __name__ == "__main__": unittest.main() From c0433572625cb563d116abbfa5d8fa038af54dec Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 12 Nov 2025 19:12:45 -0500 Subject: [PATCH 313/316] CANPackerSafety --- opendbc/safety/tests/test_hyundai_canfd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opendbc/safety/tests/test_hyundai_canfd.py b/opendbc/safety/tests/test_hyundai_canfd.py index 42c7716ca77..d22c726a47b 100755 --- a/opendbc/safety/tests/test_hyundai_canfd.py +++ b/opendbc/safety/tests/test_hyundai_canfd.py @@ -305,7 +305,7 @@ def setUpClass(cls): raise unittest.SkipTest def setUp(self): - self.packer = CANPackerPanda("hyundai_canfd_generated") + self.packer = CANPackerSafety("hyundai_canfd_generated") self.safety = libsafety_py.libsafety self.safety.set_safety_hooks(CarParams.SafetyModel.hyundaiCanfd, HyundaiSafetyFlags.CCNC | self.SAFETY_PARAM) self.safety.init_tests() @@ -339,7 +339,7 @@ def setUpClass(cls): raise unittest.SkipTest def setUp(self): - self.packer = CANPackerPanda("hyundai_canfd_generated") + self.packer = CANPackerSafety("hyundai_canfd_generated") self.safety = libsafety_py.libsafety self.safety.set_safety_hooks(CarParams.SafetyModel.hyundaiCanfd, HyundaiSafetyFlags.CCNC | HyundaiSafetyFlags.LONG | self.SAFETY_PARAM) self.safety.init_tests() From 7d0e9ded5f7dd140c302e910c809326ca98e21ee Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 12 Nov 2025 19:17:33 -0500 Subject: [PATCH 314/316] make_can_msg_safety --- opendbc/safety/tests/test_hyundai_canfd.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/opendbc/safety/tests/test_hyundai_canfd.py b/opendbc/safety/tests/test_hyundai_canfd.py index d22c726a47b..b12decc5495 100755 --- a/opendbc/safety/tests/test_hyundai_canfd.py +++ b/opendbc/safety/tests/test_hyundai_canfd.py @@ -311,8 +311,8 @@ def setUp(self): self.safety.init_tests() def test_ccnc(self): - self.assertTrue(self._tx(self.packer.make_can_msg_panda("CCNC_0x161", self.STEER_BUS, {}))) - self.assertTrue(self._tx(self.packer.make_can_msg_panda("CCNC_0x162", self.STEER_BUS, {}))) + self.assertTrue(self._tx(self.packer.make_can_msg_safety("CCNC_0x161", self.STEER_BUS, {}))) + self.assertTrue(self._tx(self.packer.make_can_msg_safety("CCNC_0x162", self.STEER_BUS, {}))) def test_tx_hook_on_wrong_safety_mode(self): from opendbc.safety.tests.common import make_msg @@ -345,8 +345,8 @@ def setUp(self): self.safety.init_tests() def test_ccnc(self): - self.assertTrue(self._tx(self.packer.make_can_msg_panda("CCNC_0x161", self.STEER_BUS, {}))) - self.assertTrue(self._tx(self.packer.make_can_msg_panda("CCNC_0x162", self.STEER_BUS, {}))) + self.assertTrue(self._tx(self.packer.make_can_msg_safety("CCNC_0x161", self.STEER_BUS, {}))) + self.assertTrue(self._tx(self.packer.make_can_msg_safety("CCNC_0x162", self.STEER_BUS, {}))) def test_tx_hook_on_wrong_safety_mode(self): from opendbc.safety.tests.common import make_msg From 7d8f9e8d4d8e7e637d6ee8297fdb83e5a0dc4fbc Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 12 Nov 2025 19:26:45 -0500 Subject: [PATCH 315/316] try this --- opendbc/car/tests/routes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/tests/routes.py b/opendbc/car/tests/routes.py index 95e871b77d4..42a7c543ad0 100644 --- a/opendbc/car/tests/routes.py +++ b/opendbc/car/tests/routes.py @@ -173,7 +173,7 @@ class CarTestRoute(NamedTuple): CarTestRoute("22d955b2cd499c22/2020-08-10--19-58-21", HYUNDAI.HYUNDAI_KONA), CarTestRoute("0099bdb24d82951b/00000005--c38d940b04", HYUNDAI.HYUNDAI_KONA_2022), CarTestRoute("32025f26789d8fab/00000022--a499e8ffa3", HYUNDAI.HYUNDAI_KONA_2ND_GEN), - CarTestRoute("97ca61196eb73e0d/00000052--4555329470", HYUNDAI.HYUNDAI_KONA_HEV_2ND_GEN), + CarTestRoute("97ca61196eb73e0d/00000052--4555329470", HYUNDAI.HYUNDAI_KONA_HEV_2ND_GEN, segment=0), CarTestRoute("efc48acf44b1e64d/2021-05-28--21-05-04", HYUNDAI.HYUNDAI_KONA_EV), CarTestRoute("f90d3cd06caeb6fa/2023-09-06--17-15-47", HYUNDAI.HYUNDAI_KONA_EV), # openpilot longitudinal enabled CarTestRoute("ff973b941a69366f/2022-07-28--22-01-19", HYUNDAI.HYUNDAI_KONA_EV_2022, segment=11), From d2a3c912e299fcdbbc6ff6de4e001aa6d52abf35 Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 12 Nov 2025 19:31:07 -0500 Subject: [PATCH 316/316] Revert "try this" This reverts commit 7d8f9e8d4d8e7e637d6ee8297fdb83e5a0dc4fbc. --- opendbc/car/tests/routes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/tests/routes.py b/opendbc/car/tests/routes.py index 42a7c543ad0..95e871b77d4 100644 --- a/opendbc/car/tests/routes.py +++ b/opendbc/car/tests/routes.py @@ -173,7 +173,7 @@ class CarTestRoute(NamedTuple): CarTestRoute("22d955b2cd499c22/2020-08-10--19-58-21", HYUNDAI.HYUNDAI_KONA), CarTestRoute("0099bdb24d82951b/00000005--c38d940b04", HYUNDAI.HYUNDAI_KONA_2022), CarTestRoute("32025f26789d8fab/00000022--a499e8ffa3", HYUNDAI.HYUNDAI_KONA_2ND_GEN), - CarTestRoute("97ca61196eb73e0d/00000052--4555329470", HYUNDAI.HYUNDAI_KONA_HEV_2ND_GEN, segment=0), + CarTestRoute("97ca61196eb73e0d/00000052--4555329470", HYUNDAI.HYUNDAI_KONA_HEV_2ND_GEN), CarTestRoute("efc48acf44b1e64d/2021-05-28--21-05-04", HYUNDAI.HYUNDAI_KONA_EV), CarTestRoute("f90d3cd06caeb6fa/2023-09-06--17-15-47", HYUNDAI.HYUNDAI_KONA_EV), # openpilot longitudinal enabled CarTestRoute("ff973b941a69366f/2022-07-28--22-01-19", HYUNDAI.HYUNDAI_KONA_EV_2022, segment=11),