From 7de437c621b2c55074aa4e627a649e00b40633f6 Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 22 Oct 2024 11:55:20 -0400 Subject: [PATCH 1/3] init --- opendbc/car/hyundai/carstate.py | 2 +- opendbc/car/hyundai/fingerprints.py | 8 ++++++++ opendbc/car/hyundai/values.py | 7 +++++++ opendbc/car/torque_data/override.toml | 1 + 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/opendbc/car/hyundai/carstate.py b/opendbc/car/hyundai/carstate.py index 9406d858fb..094dac1877 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_HEV_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 7496e2bff0..0bf67abe90 100644 --- a/opendbc/car/hyundai/fingerprints.py +++ b/opendbc/car/hyundai/fingerprints.py @@ -936,6 +936,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 2eeb337636..81caa709ee 100644 --- a/opendbc/car/hyundai/values.py +++ b/opendbc/car/hyundai/values.py @@ -307,6 +307,13 @@ 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 * 1.15, tireStiffnessFactor=0.65), + flags=HyundaiFlags.HYBRID, + # TODO: confirm steerRatio increase + # TODO: confirm tireStiffnessFactor + ) 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/torque_data/override.toml b/opendbc/car/torque_data/override.toml index aad06e8e3e..571cb32fd5 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_HEV_2024" = [2.5, 2.5, 0.1] # Dashcam or fallback configured as ideal car "MOCK" = [10.0, 10, 0.0] From 55239df4eb4522a6809b46e080cb7378022f81d3 Mon Sep 17 00:00:00 2001 From: royjr Date: Sun, 3 Nov 2024 20:31:37 -0500 Subject: [PATCH 2/3] remove hybrid flag --- 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 81caa709ee..bcf1e9e226 100644 --- a/opendbc/car/hyundai/values.py +++ b/opendbc/car/hyundai/values.py @@ -310,7 +310,6 @@ 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 * 1.15, tireStiffnessFactor=0.65), - flags=HyundaiFlags.HYBRID, # TODO: confirm steerRatio increase # TODO: confirm tireStiffnessFactor ) From 2fca39078f04c4f1da637f28b7e1c78adfc585c5 Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 7 Nov 2024 18:34:34 -0500 Subject: [PATCH 3/3] 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 2e1eca29a0..5039455bbe 100644 --- a/opendbc/car/tests/routes.py +++ b/opendbc/car/tests/routes.py @@ -180,6 +180,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/000000d2--d08ba01f7d", 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),