@ -310,8 +310,6 @@ class CarInterface(CarInterfaceBase):
ret . safetyConfigs = [ get_safety_config ( car . CarParams . SafetyModel . noOutput ) ,
ret . safetyConfigs = [ get_safety_config ( car . CarParams . SafetyModel . noOutput ) ,
get_safety_config ( car . CarParams . SafetyModel . hyundaiCanfd ) ]
get_safety_config ( car . CarParams . SafetyModel . hyundaiCanfd ) ]
if ret . openpilotLongitudinalControl :
ret . safetyConfigs [ 1 ] . safetyParam | = Panda . FLAG_HYUNDAI_CANFD_LONG
if ret . flags & HyundaiFlags . CANFD_HDA2 :
if ret . flags & HyundaiFlags . CANFD_HDA2 :
ret . safetyConfigs [ 1 ] . safetyParam | = Panda . FLAG_HYUNDAI_CANFD_HDA2
ret . safetyConfigs [ 1 ] . safetyParam | = Panda . FLAG_HYUNDAI_CANFD_HDA2
if ret . flags & HyundaiFlags . CANFD_ALT_BUTTONS :
if ret . flags & HyundaiFlags . CANFD_ALT_BUTTONS :
@ -325,18 +323,16 @@ class CarInterface(CarInterfaceBase):
else :
else :
ret . safetyConfigs = [ get_safety_config ( car . CarParams . SafetyModel . hyundai , 0 ) ]
ret . safetyConfigs = [ get_safety_config ( car . CarParams . SafetyModel . hyundai , 0 ) ]
# set appropriate safety param for gas signal
if candidate in HYBRID_CAR :
ret . safetyConfigs [ 0 ] . safetyParam = 2
elif candidate in EV_CAR :
ret . safetyConfigs [ 0 ] . safetyParam = 1
if ret . openpilotLongitudinalControl :
ret . safetyConfigs [ 0 ] . safetyParam | = Panda . FLAG_HYUNDAI_LONG
if candidate in CAMERA_SCC_CAR :
if candidate in CAMERA_SCC_CAR :
ret . safetyConfigs [ 0 ] . safetyParam | = Panda . FLAG_HYUNDAI_CAMERA_SCC
ret . safetyConfigs [ 0 ] . safetyParam | = Panda . FLAG_HYUNDAI_CAMERA_SCC
if ret . openpilotLongitudinalControl :
ret . safetyConfigs [ - 1 ] . safetyParam | = Panda . FLAG_HYUNDAI_LONG
if candidate in HYBRID_CAR :
ret . safetyConfigs [ - 1 ] . safetyParam | = Panda . FLAG_HYUNDAI_HYBRID_GAS
elif candidate in EV_CAR :
ret . safetyConfigs [ - 1 ] . safetyParam | = Panda . FLAG_HYUNDAI_EV_GAS
ret . centerToFront = ret . wheelbase * 0.4
ret . centerToFront = ret . wheelbase * 0.4
# TODO: get actual value, for now starting with reasonable value for
# TODO: get actual value, for now starting with reasonable value for
@ -347,7 +343,6 @@ class CarInterface(CarInterfaceBase):
# mass and CG position, so all cars will have approximately similar dyn behaviors
# mass and CG position, so all cars will have approximately similar dyn behaviors
ret . tireStiffnessFront , ret . tireStiffnessRear = scale_tire_stiffness ( ret . mass , ret . wheelbase , ret . centerToFront ,
ret . tireStiffnessFront , ret . tireStiffnessRear = scale_tire_stiffness ( ret . mass , ret . wheelbase , ret . centerToFront ,
tire_stiffness_factor = tire_stiffness_factor )
tire_stiffness_factor = tire_stiffness_factor )
return ret
return ret
@staticmethod
@staticmethod