@ -27,15 +27,7 @@ class CarInterface(CarInterfaceBase):
if DBC [ candidate ] [ " pt " ] == " toyota_new_mc_pt_generated " :
if DBC [ candidate ] [ " pt " ] == " toyota_new_mc_pt_generated " :
ret . safetyConfigs [ 0 ] . safetyParam | = Panda . FLAG_TOYOTA_ALT_BRAKE
ret . safetyConfigs [ 0 ] . safetyParam | = Panda . FLAG_TOYOTA_ALT_BRAKE
# Allow angle control cars with whitelisted EPSs to use torque control (made in Japan)
if candidate in ANGLE_CONTROL_CAR :
# So far only hybrid RAV4 2023 has been seen with this FW version
angle_car_torque_fw = any ( fw . ecu == " eps " and fw . fwVersion == b ' 8965B42371 \x00 \x00 \x00 \x00 \x00 \x00 ' for fw in car_fw )
if candidate not in ANGLE_CONTROL_CAR or ( angle_car_torque_fw and candidate == CAR . RAV4H_TSS2_2023 ) :
CarInterfaceBase . configure_torque_tune ( candidate , ret . lateralTuning )
ret . steerActuatorDelay = 0.12 # Default delay, Prius has larger delay
ret . steerLimitTimer = 0.4
else :
ret . dashcamOnly = True
ret . dashcamOnly = True
ret . steerControlType = SteerControlType . angle
ret . steerControlType = SteerControlType . angle
ret . safetyConfigs [ 0 ] . safetyParam | = Panda . FLAG_TOYOTA_LTA
ret . safetyConfigs [ 0 ] . safetyParam | = Panda . FLAG_TOYOTA_LTA
@ -43,6 +35,11 @@ class CarInterface(CarInterfaceBase):
# LTA control can be more delayed and winds up more often
# LTA control can be more delayed and winds up more often
ret . steerActuatorDelay = 0.25
ret . steerActuatorDelay = 0.25
ret . steerLimitTimer = 0.8
ret . steerLimitTimer = 0.8
else :
CarInterfaceBase . configure_torque_tune ( candidate , ret . lateralTuning )
ret . steerActuatorDelay = 0.12 # Default delay, Prius has larger delay
ret . steerLimitTimer = 0.4
ret . stoppingControl = False # Toyota starts braking more when it thinks you want to stop
ret . stoppingControl = False # Toyota starts braking more when it thinks you want to stop
@ -124,10 +121,6 @@ class CarInterface(CarInterfaceBase):
ret . steerRatio = 14.3
ret . steerRatio = 14.3
ret . tireStiffnessFactor = 0.7933
ret . tireStiffnessFactor = 0.7933
ret . mass = 3585. * CV . LB_TO_KG # Average between ICE and Hybrid
ret . mass = 3585. * CV . LB_TO_KG # Average between ICE and Hybrid
# Only specific EPS FW accept torque on 2023 RAV4, so they likely are all the same
# TODO: revisit this disparity if there is a divide for 2023
if candidate not in ( CAR . RAV4_TSS2_2023 , CAR . RAV4H_TSS2_2023 ) :
ret . lateralTuning . init ( ' pid ' )
ret . lateralTuning . init ( ' pid ' )
ret . lateralTuning . pid . kiBP = [ 0.0 ]
ret . lateralTuning . pid . kiBP = [ 0.0 ]
ret . lateralTuning . pid . kpBP = [ 0.0 ]
ret . lateralTuning . pid . kpBP = [ 0.0 ]