From 3ca1a2d6faa02e86b8fa628985cd5d76e1763688 Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Sat, 10 Dec 2022 12:40:28 -0500 Subject: [PATCH] Check IONIQ_5 fwdCamera FW to segregate radar and camera SCC cars --- selfdrive/car/hyundai/interface.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/selfdrive/car/hyundai/interface.py b/selfdrive/car/hyundai/interface.py index b9f6b8fc58..c4b57a578e 100644 --- a/selfdrive/car/hyundai/interface.py +++ b/selfdrive/car/hyundai/interface.py @@ -27,6 +27,7 @@ class CarInterface(CarInterfaceBase): # added to selfdrive/car/tests/routes.py, we can remove it from this list. ret.dashcamOnly = candidate in {CAR.KIA_OPTIMA_H, } + canfd_radar_scc = False if candidate in CANFD_CAR: # detect HDA2 with ADAS Driving ECU if Ecu.adas in [fw.ecu for fw in car_fw]: @@ -38,7 +39,10 @@ class CarInterface(CarInterfaceBase): # ICE cars do not have 0x130; GEARS message on 0x40 instead if 0x130 not in fingerprint[4]: ret.flags |= HyundaiFlags.CANFD_ALT_GEARS.value - if candidate not in CANFD_RADAR_SCC_CAR: + for fw in car_fw: + if fw.ecu == "fwdCamera" and fw.fwVersion == b'\xf1\x00NE1 MFC AT EUR RHD 1.00 1.01 99211-GI010 211007': + canfd_radar_scc = True + if candidate not in CANFD_RADAR_SCC_CAR or not canfd_radar_scc: ret.flags |= HyundaiFlags.CANFD_CAMERA_SCC.value ret.steerActuatorDelay = 0.1 # Default delay @@ -217,7 +221,7 @@ class CarInterface(CarInterfaceBase): if candidate in CANFD_CAR: ret.longitudinalTuning.kpV = [0.1] ret.longitudinalTuning.kiV = [0.0] - ret.experimentalLongitudinalAvailable = candidate in (HYBRID_CAR | EV_CAR) and candidate not in CANFD_RADAR_SCC_CAR + ret.experimentalLongitudinalAvailable = (candidate in (HYBRID_CAR | EV_CAR) and candidate not in CANFD_RADAR_SCC_CAR) or not canfd_radar_scc else: ret.longitudinalTuning.kpV = [0.5] ret.longitudinalTuning.kiV = [0.0]