From 4fb1d4fcb2103414126cbbc26b9cbe31cbceda81 Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Sat, 1 Mar 2025 23:16:10 -0500 Subject: [PATCH 1/3] Hyundai CAN FD: Accurate hybrid powertrain detection --- opendbc/car/hyundai/interface.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/interface.py b/opendbc/car/hyundai/interface.py index 5d5731968c3..510b786580b 100644 --- a/opendbc/car/hyundai/interface.py +++ b/opendbc/car/hyundai/interface.py @@ -32,7 +32,8 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experime ret.enableBsm = 0x1e5 in fingerprint[CAN.ECAN] - if 0x105 in fingerprint[CAN.ECAN]: + # Check if the car is hybrid. Some ICE cars have 0x105, so check if both 0x105 and 0x130 are on E-CAN + if 0x105 in fingerprint[CAN.ECAN] and 0x130 in fingerprint[CAN.ECAN]: ret.flags |= HyundaiFlags.HYBRID.value if lka_steering: From fc695742460d111e03945ebb7cf37651ce954e8f Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Mon, 3 Mar 2025 01:03:47 -0500 Subject: [PATCH 2/3] label message names --- opendbc/car/hyundai/interface.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/interface.py b/opendbc/car/hyundai/interface.py index 510b786580b..17544c1bb4d 100644 --- a/opendbc/car/hyundai/interface.py +++ b/opendbc/car/hyundai/interface.py @@ -32,7 +32,8 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experime ret.enableBsm = 0x1e5 in fingerprint[CAN.ECAN] - # Check if the car is hybrid. Some ICE cars have 0x105, so check if both 0x105 and 0x130 are on E-CAN + # Check if the car is hybrid. Some ICE cars have 0x105 (ACCELERATOR_ALT), + # so check if both 0x105 (ACCELERATOR_ALT) and 0x130 (GEAR_SHIFTER) are on E-CAN if 0x105 in fingerprint[CAN.ECAN] and 0x130 in fingerprint[CAN.ECAN]: ret.flags |= HyundaiFlags.HYBRID.value From 9be943fb627c885b7deff189161fa5e6a6a2008e Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Tue, 4 Mar 2025 01:42:57 -0500 Subject: [PATCH 3/3] use 0xFA --- opendbc/car/hyundai/interface.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/opendbc/car/hyundai/interface.py b/opendbc/car/hyundai/interface.py index 17544c1bb4d..087d6e2f9ed 100644 --- a/opendbc/car/hyundai/interface.py +++ b/opendbc/car/hyundai/interface.py @@ -32,9 +32,8 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experime ret.enableBsm = 0x1e5 in fingerprint[CAN.ECAN] - # Check if the car is hybrid. Some ICE cars have 0x105 (ACCELERATOR_ALT), - # so check if both 0x105 (ACCELERATOR_ALT) and 0x130 (GEAR_SHIFTER) are on E-CAN - if 0x105 in fingerprint[CAN.ECAN] and 0x130 in fingerprint[CAN.ECAN]: + # Check if the car is hybrid. Only HEV/PHEV cars have 0xFA on E-CAN. + if 0xFA in fingerprint[CAN.ECAN]: ret.flags |= HyundaiFlags.HYBRID.value if lka_steering: