From c27efd01d630dce94a5e675d60a5e70dfa93905d Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Mon, 1 Jul 2024 09:37:29 -0400 Subject: [PATCH] Hyundai: Car Port for Kona Electric Non-SCC 2019 --- CHANGELOGS.md | 1 + selfdrive/car/hyundai/fingerprints.py | 11 +++++++++++ selfdrive/car/hyundai/interface.py | 3 ++- selfdrive/car/hyundai/values.py | 6 ++++++ selfdrive/car/sunnypilot_carname.json | 1 + selfdrive/car/torque_data/substitute.toml | 1 + 6 files changed, 22 insertions(+), 1 deletion(-) diff --git a/CHANGELOGS.md b/CHANGELOGS.md index 005afc9e8d..cf577cf592 100644 --- a/CHANGELOGS.md +++ b/CHANGELOGS.md @@ -4,6 +4,7 @@ sunnypilot - 0.9.8.0 (2024-xx-xx) ************************ * UPDATED: Synced with commaai's openpilot * master commit b45caf4 (June 14, 2024) +* Hyundai Kona Electric Non-SCC 2019 support thanks to NikitaNekrasov! * Kia Ceed Plug-in Hybrid Non-SCC 2022 support thanks to TerminatorNL! sunnypilot - 0.9.7.1 (2024-06-13) diff --git a/selfdrive/car/hyundai/fingerprints.py b/selfdrive/car/hyundai/fingerprints.py index b426ec9fb0..ceaf04f0e7 100644 --- a/selfdrive/car/hyundai/fingerprints.py +++ b/selfdrive/car/hyundai/fingerprints.py @@ -1195,6 +1195,17 @@ FW_VERSIONS = { b'\xf1\x006T6J0_C2\x00\x006T6K1051\x00\x00TOS4N20NS2\x00\x00\x00\x00', ], }, + CAR.HYUNDAI_KONA_EV_NON_SCC: { + (Ecu.abs, 0x7d1, None): [ + b'\xf1\x00OS IEB \x02 212 \x11\x13 58520-K4000', + ], + (Ecu.eps, 0x7d4, None): [ + b'\xf1\x00OS MDPS C 1.00 1.04 56310K4000\x00 4OEDC104', + ], + (Ecu.fwdCamera, 0x7c4, None): [ + b'\xf1\x00OSE LKAS AT USA LHD 1.00 1.00 95740-K4100 W40', + ], + }, CAR.KIA_CEED_PHEV_2022_NON_SCC: { (Ecu.eps, 0x7D4, None): [ b'\xf1\x00CD MDPS C 1.00 1.01 56310-XX000 4CPHC101', diff --git a/selfdrive/car/hyundai/interface.py b/selfdrive/car/hyundai/interface.py index e801b47771..2b3b2dd68f 100644 --- a/selfdrive/car/hyundai/interface.py +++ b/selfdrive/car/hyundai/interface.py @@ -167,7 +167,8 @@ class CarInterface(CarInterfaceBase): elif ret.flags & HyundaiFlags.EV: ret.safetyConfigs[-1].safetyParam |= Panda.FLAG_HYUNDAI_EV_GAS - if candidate in (CAR.HYUNDAI_KONA, CAR.HYUNDAI_KONA_EV, CAR.HYUNDAI_KONA_HEV, CAR.HYUNDAI_KONA_EV_2022, CAR.HYUNDAI_KONA_NON_SCC): + if candidate in (CAR.HYUNDAI_KONA, CAR.HYUNDAI_KONA_EV, CAR.HYUNDAI_KONA_HEV, CAR.HYUNDAI_KONA_EV_2022, + CAR.HYUNDAI_KONA_NON_SCC, CAR.HYUNDAI_KONA_EV_NON_SCC): ret.flags |= HyundaiFlags.ALT_LIMITS.value ret.safetyConfigs[-1].safetyParam |= Panda.FLAG_HYUNDAI_ALT_LIMITS diff --git a/selfdrive/car/hyundai/values.py b/selfdrive/car/hyundai/values.py index 075085ee8d..fb18c110ca 100644 --- a/selfdrive/car/hyundai/values.py +++ b/selfdrive/car/hyundai/values.py @@ -573,6 +573,12 @@ class CAR(Platforms): HYUNDAI_KONA.specs, spFlags=HyundaiFlagsSP.SP_NON_SCC | HyundaiFlagsSP.SP_NON_SCC_FCA, ) + HYUNDAI_KONA_EV_NON_SCC = HyundaiPlatformConfig( + [HyundaiCarDocs("Hyundai Kona Electric Non-SCC 2019", "No Smart Cruise Control (SCC)", car_parts=CarParts.common([CarHarness.hyundai_g]))], + HYUNDAI_KONA.specs, + flags=HyundaiFlags.EV, + spFlags=HyundaiFlagsSP.SP_NON_SCC | HyundaiFlagsSP.SP_NON_SCC_FCA, + ) KIA_CEED_PHEV_2022_NON_SCC = HyundaiPlatformConfig( [HyundaiCarDocs("Kia Ceed PHEV Non-SCC 2022", "No Smart Cruise Control (SCC)", car_parts=CarParts.common([CarHarness.hyundai_i]))], CarSpecs(mass=1650, wheelbase=2.65, steerRatio=13.75, tireStiffnessFactor=0.5), diff --git a/selfdrive/car/sunnypilot_carname.json b/selfdrive/car/sunnypilot_carname.json index 8f6a9660b1..5b8f8cafdb 100644 --- a/selfdrive/car/sunnypilot_carname.json +++ b/selfdrive/car/sunnypilot_carname.json @@ -101,6 +101,7 @@ "Hyundai Kona Electric 2018-21": "HYUNDAI_KONA_EV", "Hyundai Kona Electric 2022-23": "HYUNDAI_KONA_EV_2022", "Hyundai Kona Electric (with HDA II, Korea only) 2023": "HYUNDAI_KONA_EV_2ND_GEN", + "Hyundai Kona Electric Non-SCC 2019": "HYUNDAI_KONA_EV_NON_SCC", "Hyundai Kona Hybrid 2020": "HYUNDAI_KONA_HEV", "Hyundai Kona Non-SCC 2019": "HYUNDAI_KONA_NON_SCC", "Hyundai Palisade 2020-22": "HYUNDAI_PALISADE", diff --git a/selfdrive/car/torque_data/substitute.toml b/selfdrive/car/torque_data/substitute.toml index 921846667b..7fb8ec7f3f 100644 --- a/selfdrive/car/torque_data/substitute.toml +++ b/selfdrive/car/torque_data/substitute.toml @@ -86,6 +86,7 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"] "KIA_FORTE_2021_NON_SCC" = "HYUNDAI_SONATA" "KIA_SELTOS_2023_NON_SCC" = "HYUNDAI_SONATA" "HYUNDAI_KONA_NON_SCC" = "HYUNDAI_KONA_EV" +"HYUNDAI_KONA_EV_NON_SCC" = "HYUNDAI_KONA_EV" "HYUNDAI_ELANTRA_2022_NON_SCC" = "HYUNDAI_ELANTRA_2021" "GENESIS_G70_2021_NON_SCC" = "HYUNDAI_SONATA" "KIA_CEED_PHEV_2022_NON_SCC" = "HYUNDAI_SONATA"