From 1a5245591da34269d50d138fcaf140f8ac746bd9 Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Fri, 6 Dec 2024 14:58:37 -0500 Subject: [PATCH 1/6] HKG: Car Port for Kia Carnival 2025 (HDA2) --- opendbc/car/hyundai/fingerprints.py | 2 ++ opendbc/car/hyundai/values.py | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/opendbc/car/hyundai/fingerprints.py b/opendbc/car/hyundai/fingerprints.py index 256441f70cd..461edb3b628 100644 --- a/opendbc/car/hyundai/fingerprints.py +++ b/opendbc/car/hyundai/fingerprints.py @@ -1147,6 +1147,8 @@ b'\xf1\x00KA4 MFC AT USA LHD 1.00 1.05 99210-R0000 201221', b'\xf1\x00KA4 MFC AT USA LHD 1.00 1.06 99210-R0000 220221', b'\xf1\x00KA4CMFC AT CHN LHD 1.00 1.01 99211-I4000 210525', + b'\xf1\x00KA4HMFC AT USA LHD 1.00 1.05 99210-R0500 240305', + b'\xf1\x00KAhe RDR ----- 1.00 1.01 99110-ES500 ', ], (Ecu.fwdRadar, 0x7d0, None): [ b'\xf1\x00KA4_ SCC F-CUP 1.00 1.03 99110-R0000 ', diff --git a/opendbc/car/hyundai/values.py b/opendbc/car/hyundai/values.py index 223eb97a3dc..e2578a1c81f 100644 --- a/opendbc/car/hyundai/values.py +++ b/opendbc/car/hyundai/values.py @@ -490,8 +490,9 @@ class CAR(Platforms): ) KIA_CARNIVAL_4TH_GEN = HyundaiCanFDPlatformConfig( [ - HyundaiCarDocs("Kia Carnival 2022-24", car_parts=CarParts.common([CarHarness.hyundai_a])), - HyundaiCarDocs("Kia Carnival (China only) 2023", car_parts=CarParts.common([CarHarness.hyundai_k])) + HyundaiCarDocs("Kia Carnival 2022-24", "All", car_parts=CarParts.common([CarHarness.hyundai_a])), + HyundaiCarDocs("Kia Carnival (China only) 2023", "All", car_parts=CarParts.common([CarHarness.hyundai_k])), + HyundaiCarDocs("Kia Carnival (with HDA II) 2025", "Highway Driving Assist II", car_parts=CarParts.common([CarHarness.hyundai_q])), ], CarSpecs(mass=2087, wheelbase=3.09, steerRatio=14.23), flags=HyundaiFlags.RADAR_SCC, From 8bb29a41e7f24272e51e06d370ea7cb1b7cf684a Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Fri, 6 Dec 2024 15:10:24 -0500 Subject: [PATCH 2/6] wrong (in DJT voice) --- opendbc/car/hyundai/fingerprints.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/fingerprints.py b/opendbc/car/hyundai/fingerprints.py index 461edb3b628..335bef48fe2 100644 --- a/opendbc/car/hyundai/fingerprints.py +++ b/opendbc/car/hyundai/fingerprints.py @@ -1148,7 +1148,6 @@ b'\xf1\x00KA4 MFC AT USA LHD 1.00 1.06 99210-R0000 220221', b'\xf1\x00KA4CMFC AT CHN LHD 1.00 1.01 99211-I4000 210525', b'\xf1\x00KA4HMFC AT USA LHD 1.00 1.05 99210-R0500 240305', - b'\xf1\x00KAhe RDR ----- 1.00 1.01 99110-ES500 ', ], (Ecu.fwdRadar, 0x7d0, None): [ b'\xf1\x00KA4_ SCC F-CUP 1.00 1.03 99110-R0000 ', @@ -1156,6 +1155,7 @@ b'\xf1\x00KA4_ SCC FHCUP 1.00 1.02 99110-R0000 ', b'\xf1\x00KA4_ SCC FHCUP 1.00 1.03 99110-R0000 ', b'\xf1\x00KA4c SCC FHCUP 1.00 1.01 99110-I4000 ', + b'\xf1\x00KAhe RDR ----- 1.00 1.01 99110-ES500 ', ], }, CAR.KIA_K8_HEV_1ST_GEN: { From cb93a6eb63459f54bdaa5144f7b2b9658bae34af Mon Sep 17 00:00:00 2001 From: Brad Cheung Date: Wed, 11 Dec 2024 16:25:53 -0500 Subject: [PATCH 3/6] Update fingerprints.py with Carnival 2025 non-hybrid (#44) * Update fingerprints.py with Carnival 2025 non-hybrid * Update values.py with 2025 carnival * Update opendbc/car/hyundai/values.py --------- Co-authored-by: Jason Wen --- 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 335bef48fe2..6528cbb95c9 100644 --- a/opendbc/car/hyundai/fingerprints.py +++ b/opendbc/car/hyundai/fingerprints.py @@ -1148,6 +1148,7 @@ b'\xf1\x00KA4 MFC AT USA LHD 1.00 1.06 99210-R0000 220221', b'\xf1\x00KA4CMFC AT CHN LHD 1.00 1.01 99211-I4000 210525', b'\xf1\x00KA4HMFC AT USA LHD 1.00 1.05 99210-R0500 240305', + b'\xf1\x00KA4 MFC AT USA LHD 1.00 1.05 99210-R0500 240305', ], (Ecu.fwdRadar, 0x7d0, None): [ b'\xf1\x00KA4_ SCC F-CUP 1.00 1.03 99110-R0000 ', @@ -1156,6 +1157,7 @@ b'\xf1\x00KA4_ SCC FHCUP 1.00 1.03 99110-R0000 ', b'\xf1\x00KA4c SCC FHCUP 1.00 1.01 99110-I4000 ', b'\xf1\x00KAhe RDR ----- 1.00 1.01 99110-ES500 ', + b'\xf1\x00KA4_ SCC FHCUP 1.00 1.01 99110-R0510 ', ], }, CAR.KIA_K8_HEV_1ST_GEN: { From ec112bcf999b3603817b8fd60a8e9bd373994a3e Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Sun, 15 Dec 2024 11:02:52 -0500 Subject: [PATCH 4/6] accelerator pedal and cruise button tests --- opendbc/car/hyundai/interface.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/opendbc/car/hyundai/interface.py b/opendbc/car/hyundai/interface.py index adebd4fe1da..3537634af4b 100644 --- a/opendbc/car/hyundai/interface.py +++ b/opendbc/car/hyundai/interface.py @@ -29,8 +29,8 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experime ret.experimentalLongitudinalAvailable = candidate not in (CANFD_UNSUPPORTED_LONGITUDINAL_CAR | CANFD_RADAR_SCC_CAR) ret.enableBsm = 0x1e5 in fingerprint[CAN.ECAN] - if 0x105 in fingerprint[CAN.ECAN]: - ret.flags |= HyundaiFlags.HYBRID.value + #if 0x105 in fingerprint[CAN.ECAN]: + # ret.flags |= HyundaiFlags.HYBRID.value # detect HDA2 with ADAS Driving ECU if hda2: @@ -38,9 +38,6 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experime if 0x110 in fingerprint[CAN.CAM]: ret.flags |= HyundaiFlags.CANFD_HDA2_ALT_STEERING.value else: - # non-HDA2 - if 0x1cf not in fingerprint[CAN.ECAN]: - ret.flags |= HyundaiFlags.CANFD_ALT_BUTTONS.value if not ret.flags & HyundaiFlags.RADAR_SCC: ret.flags |= HyundaiFlags.CANFD_CAMERA_SCC.value @@ -52,6 +49,10 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experime else: ret.flags |= HyundaiFlags.CANFD_ALT_GEARS.value + # Some HDA2 do not have 0x1cf + if 0x1cf not in fingerprint[CAN.ECAN]: + ret.flags |= HyundaiFlags.CANFD_ALT_BUTTONS.value + cfgs = [get_safety_config(structs.CarParams.SafetyModel.hyundaiCanfd), ] if CAN.ECAN >= 4: cfgs.insert(0, get_safety_config(structs.CarParams.SafetyModel.noOutput)) From e2d3ada7be69319e51feb7b08276196314c92119 Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Sun, 15 Dec 2024 16:26:33 -0500 Subject: [PATCH 5/6] hack to support hybrid --- opendbc/car/hyundai/interface.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/opendbc/car/hyundai/interface.py b/opendbc/car/hyundai/interface.py index 3537634af4b..0ee87d6b983 100644 --- a/opendbc/car/hyundai/interface.py +++ b/opendbc/car/hyundai/interface.py @@ -29,8 +29,9 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experime ret.experimentalLongitudinalAvailable = candidate not in (CANFD_UNSUPPORTED_LONGITUDINAL_CAR | CANFD_RADAR_SCC_CAR) ret.enableBsm = 0x1e5 in fingerprint[CAN.ECAN] - #if 0x105 in fingerprint[CAN.ECAN]: - # ret.flags |= HyundaiFlags.HYBRID.value + for fw in car_fw: + if fw.ecu == "fwdCamera" and (fw.fwVersion.startswith(b'\xf1\x00KA4HMFC')): + ret.flags |= HyundaiFlags.HYBRID.value # detect HDA2 with ADAS Driving ECU if hda2: From d8a344e5862028fa34d2eb53d848eaabafcbe0f0 Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Sun, 15 Dec 2024 16:28:10 -0500 Subject: [PATCH 6/6] hack to test long --- opendbc/car/hyundai/values.py | 1 - 1 file changed, 1 deletion(-) diff --git a/opendbc/car/hyundai/values.py b/opendbc/car/hyundai/values.py index e2578a1c81f..e76477d6822 100644 --- a/opendbc/car/hyundai/values.py +++ b/opendbc/car/hyundai/values.py @@ -495,7 +495,6 @@ class CAR(Platforms): HyundaiCarDocs("Kia Carnival (with HDA II) 2025", "Highway Driving Assist II", car_parts=CarParts.common([CarHarness.hyundai_q])), ], CarSpecs(mass=2087, wheelbase=3.09, steerRatio=14.23), - flags=HyundaiFlags.RADAR_SCC, ) # Genesis