@ -3,7 +3,7 @@ from cereal import car
from panda import Panda
from common . params import Params
from selfdrive . config import Conversions as CV
from selfdrive . car . hyundai . values import CAR , EV_CAR , HYBRID_CAR , Buttons , CarControllerParams
from selfdrive . car . hyundai . values import CAR , EV_CAR , HYBRID_CAR , LEGACY_SAFETY_MODE_CAR , Buttons , CarControllerParams
from selfdrive . car . hyundai . radar_interface import RADAR_START_ADDR
from selfdrive . car import STD_CARGO_KG , scale_rot_inertia , scale_tire_stiffness , gen_empty_fingerprint , get_safety_config
from selfdrive . car . interfaces import CarInterfaceBase
@ -26,7 +26,7 @@ class CarInterface(CarInterfaceBase):
ret . radarOffCan = RADAR_START_ADDR not in fingerprint [ 1 ]
# WARNING: disabling radar also disables AEB (and we show the same warning on the instrument cluster as if you manually disabled AEB)
ret . openpilotLongitudinalControl = Params ( ) . get_bool ( " DisableRadar " ) and candidate in [ CAR . SONATA , CAR . SONATA_HYBRID , CAR . PALISADE , CAR . SANTA_FE , CAR . ELANTRA_2021 , CAR . GENESIS_G70_2020 ]
ret . openpilotLongitudinalControl = Params ( ) . get_bool ( " DisableRadar " ) and ( candidate not in LEGACY_SAFETY_MODE_CAR )
ret . pcmCruise = not ret . openpilotLongitudinalControl
@ -254,10 +254,7 @@ class CarInterface(CarInterfaceBase):
ret . lateralTuning . pid . kpV , ret . lateralTuning . pid . kiV = [ [ 0.16 ] , [ 0.01 ] ]
# these cars require a special panda safety mode due to missing counters and checksums in the messages
if candidate in [ CAR . HYUNDAI_GENESIS , CAR . IONIQ_EV_2020 , CAR . IONIQ_EV_LTD , CAR . IONIQ_PHEV , CAR . IONIQ , CAR . KONA_EV , CAR . KIA_SORENTO ,
CAR . SONATA_LF , CAR . KIA_NIRO_EV , CAR . KIA_OPTIMA , CAR . VELOSTER , CAR . KIA_STINGER ,
CAR . GENESIS_G70 , CAR . GENESIS_G80 , CAR . KIA_CEED , CAR . ELANTRA , CAR . IONIQ_HEV_2022 ] :
assert not ret . openpilotLongitudinalControl # Legacy safety mode doesn't support longitudinal
if candidate in LEGACY_SAFETY_MODE_CAR :
ret . safetyConfigs = [ get_safety_config ( car . CarParams . SafetyModel . hyundaiLegacy ) ]
# set appropriate safety param for gas signal