From 732830b0957bc3a07ddb44fda45f07efbc77132d Mon Sep 17 00:00:00 2001 From: firestar5683 <168790843+firestar5683@users.noreply.github.com> Date: Thu, 28 May 2026 13:18:20 -0500 Subject: [PATCH] g90 radar --- opendbc_repo/opendbc/car/hyundai/interface.py | 3 ++- .../opendbc/car/hyundai/tests/test_hyundai.py | 20 +++++++++++++------ opendbc_repo/opendbc/car/hyundai/values.py | 2 ++ 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/opendbc_repo/opendbc/car/hyundai/interface.py b/opendbc_repo/opendbc/car/hyundai/interface.py index 09a038b0e..3d122a265 100644 --- a/opendbc_repo/opendbc/car/hyundai/interface.py +++ b/opendbc_repo/opendbc/car/hyundai/interface.py @@ -5,6 +5,7 @@ from opendbc.car.hyundai.values import HyundaiFlags, CAR, CarControllerParams, \ CANFD_UNSUPPORTED_LONGITUDINAL_CAR, \ CANFD_SECURITYACCESS_CAR, \ CANFD_RADAR_LIVE_LONGITUDINAL_CAR, \ + RADAR_LIVE_LONGITUDINAL_CAR, \ UNSUPPORTED_LONGITUDINAL_CAR, HyundaiSafetyFlags, \ HyundaiStarPilotSafetyFlags, \ hyundai_cancel_button_enables_cruise @@ -181,7 +182,7 @@ class CarInterface(CarInterfaceBase): if ret.flags & HyundaiFlags.NON_SCC: ret.alphaLongitudinalAvailable = False ret.openpilotLongitudinalControl = alpha_long and ret.alphaLongitudinalAvailable - if ret.openpilotLongitudinalControl and not (candidate in CANFD_RADAR_LIVE_LONGITUDINAL_CAR and radar_tracks_available): + if ret.openpilotLongitudinalControl and not (candidate in RADAR_LIVE_LONGITUDINAL_CAR and radar_tracks_available): ret.radarUnavailable = True ret.pcmCruise = not ret.openpilotLongitudinalControl apply_platform_longitudinal_params(ret) diff --git a/opendbc_repo/opendbc/car/hyundai/tests/test_hyundai.py b/opendbc_repo/opendbc/car/hyundai/tests/test_hyundai.py index 9daa8fbba..160a8097d 100644 --- a/opendbc_repo/opendbc/car/hyundai/tests/test_hyundai.py +++ b/opendbc_repo/opendbc/car/hyundai/tests/test_hyundai.py @@ -120,12 +120,20 @@ class TestHyundaiFingerprint: assert bool(CP.flags & HyundaiFlags.CANFD_LKA_STEERING) == lka_steering # radar available - for radar in (True, False): - fingerprint = gen_empty_fingerprint() - if radar: - fingerprint[1][RADAR_START_ADDR] = 8 - CP = CarInterface.get_params(CAR.HYUNDAI_SONATA, fingerprint, [], False, False, False, None) - assert CP.radarUnavailable != radar + for candidate in (CAR.HYUNDAI_SONATA, CAR.GENESIS_G90): + assert get_radar_track_config(candidate).start_addr == RADAR_START_ADDR + for radar in (True, False): + fingerprint = gen_empty_fingerprint() + if radar: + fingerprint[1][RADAR_START_ADDR] = 8 + CP = CarInterface.get_params(candidate, fingerprint, [], False, False, False, None) + assert CP.radarUnavailable != radar + + fingerprint = gen_empty_fingerprint() + fingerprint[1][RADAR_START_ADDR] = 8 + CP = CarInterface.get_params(CAR.GENESIS_G90, fingerprint, [], True, False, False, None) + assert CP.openpilotLongitudinalControl + assert not CP.radarUnavailable for candidate, radar_addr in ( (CAR.HYUNDAI_IONIQ_5, MRR30_RADAR_START_ADDR), diff --git a/opendbc_repo/opendbc/car/hyundai/values.py b/opendbc_repo/opendbc/car/hyundai/values.py index 26fd9a613..3b475e0e7 100644 --- a/opendbc_repo/opendbc/car/hyundai/values.py +++ b/opendbc_repo/opendbc/car/hyundai/values.py @@ -836,6 +836,7 @@ class CAR(Platforms): GENESIS_G90 = HyundaiPlatformConfig( [HyundaiCarDocs("Genesis G90 2017-20", "All", car_parts=CarParts.common([CarHarness.hyundai_c]))], CarSpecs(mass=2200, wheelbase=3.15, steerRatio=12.069), + flags=HyundaiFlags.MANDO_RADAR, ) GENESIS_GV80 = HyundaiCanFDPlatformConfig( [HyundaiCarDocs("Genesis GV80 2023", "All", car_parts=CarParts.common([CarHarness.hyundai_m]))], @@ -1110,6 +1111,7 @@ CANFD_RADAR_SCC_CAR = CAR.with_flags(HyundaiFlags.RADAR_SCC) # TODO: merge with CANFD_SECURITYACCESS_CAR = {CAR.HYUNDAI_IONIQ_5, CAR.HYUNDAI_IONIQ_6, CAR.HYUNDAI_KONA_EV_2ND_GEN} CANFD_UNSUPPORTED_LONGITUDINAL_CAR = CAR.with_flags(HyundaiFlags.CANFD_NO_RADAR_DISABLE) - CANFD_SECURITYACCESS_CAR # TODO: merge with UNSUPPORTED_LONGITUDINAL_CAR CANFD_RADAR_LIVE_LONGITUDINAL_CAR = {CAR.HYUNDAI_IONIQ_5, CAR.HYUNDAI_IONIQ_6} +RADAR_LIVE_LONGITUDINAL_CAR = CANFD_RADAR_LIVE_LONGITUDINAL_CAR | {CAR.GENESIS_G90} CAMERA_SCC_CAR = CAR.with_flags(HyundaiFlags.CAMERA_SCC)