|
|
@ -2,7 +2,7 @@ |
|
|
|
from cereal import car |
|
|
|
from cereal import car |
|
|
|
from selfdrive.config import Conversions as CV |
|
|
|
from selfdrive.config import Conversions as CV |
|
|
|
from selfdrive.car.toyota.tunes import LatTunes, LongTunes, set_long_tune, set_lat_tune |
|
|
|
from selfdrive.car.toyota.tunes import LatTunes, LongTunes, set_long_tune, set_lat_tune |
|
|
|
from selfdrive.car.toyota.values import Ecu, CAR, ToyotaFlags, TSS2_CAR, NO_DSU_CAR, MIN_ACC_SPEED, CarControllerParams |
|
|
|
from selfdrive.car.toyota.values import Ecu, CAR, ToyotaFlags, TSS2_CAR, NO_DSU_CAR, MIN_ACC_SPEED, EPS_SCALE, CarControllerParams |
|
|
|
from selfdrive.car import STD_CARGO_KG, scale_rot_inertia, scale_tire_stiffness, gen_empty_fingerprint, get_safety_config |
|
|
|
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 |
|
|
|
from selfdrive.car.interfaces import CarInterfaceBase |
|
|
|
|
|
|
|
|
|
|
@ -20,17 +20,13 @@ class CarInterface(CarInterfaceBase): |
|
|
|
|
|
|
|
|
|
|
|
ret.carName = "toyota" |
|
|
|
ret.carName = "toyota" |
|
|
|
ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.toyota)] |
|
|
|
ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.toyota)] |
|
|
|
|
|
|
|
ret.safetyConfigs[0].safetyParam = EPS_SCALE[candidate] |
|
|
|
|
|
|
|
|
|
|
|
ret.steerActuatorDelay = 0.12 # Default delay, Prius has larger delay |
|
|
|
ret.steerActuatorDelay = 0.12 # Default delay, Prius has larger delay |
|
|
|
ret.steerLimitTimer = 0.4 |
|
|
|
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 |
|
|
|
|
|
|
|
|
|
|
|
# Most cars use this default safety param |
|
|
|
|
|
|
|
ret.safetyConfigs[0].safetyParam = 73 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if candidate == CAR.PRIUS: |
|
|
|
if candidate == CAR.PRIUS: |
|
|
|
ret.safetyConfigs[0].safetyParam = 66 # see conversion factor for STEER_TORQUE_EPS in dbc file |
|
|
|
|
|
|
|
stop_and_go = True |
|
|
|
stop_and_go = True |
|
|
|
ret.wheelbase = 2.70 |
|
|
|
ret.wheelbase = 2.70 |
|
|
|
ret.steerRatio = 15.74 # unknown end-to-end spec |
|
|
|
ret.steerRatio = 15.74 # unknown end-to-end spec |
|
|
@ -49,7 +45,6 @@ class CarInterface(CarInterfaceBase): |
|
|
|
set_lat_tune(ret.lateralTuning, LatTunes.LQR_RAV4) |
|
|
|
set_lat_tune(ret.lateralTuning, LatTunes.LQR_RAV4) |
|
|
|
|
|
|
|
|
|
|
|
elif candidate == CAR.COROLLA: |
|
|
|
elif candidate == CAR.COROLLA: |
|
|
|
ret.safetyConfigs[0].safetyParam = 88 |
|
|
|
|
|
|
|
stop_and_go = False |
|
|
|
stop_and_go = False |
|
|
|
ret.wheelbase = 2.70 |
|
|
|
ret.wheelbase = 2.70 |
|
|
|
ret.steerRatio = 18.27 |
|
|
|
ret.steerRatio = 18.27 |
|
|
@ -154,7 +149,6 @@ class CarInterface(CarInterfaceBase): |
|
|
|
set_lat_tune(ret.lateralTuning, LatTunes.PID_J) |
|
|
|
set_lat_tune(ret.lateralTuning, LatTunes.PID_J) |
|
|
|
|
|
|
|
|
|
|
|
elif candidate == CAR.LEXUS_IS: |
|
|
|
elif candidate == CAR.LEXUS_IS: |
|
|
|
ret.safetyConfigs[0].safetyParam = 77 |
|
|
|
|
|
|
|
stop_and_go = False |
|
|
|
stop_and_go = False |
|
|
|
ret.wheelbase = 2.79908 |
|
|
|
ret.wheelbase = 2.79908 |
|
|
|
ret.steerRatio = 13.3 |
|
|
|
ret.steerRatio = 13.3 |
|
|
@ -163,7 +157,6 @@ class CarInterface(CarInterfaceBase): |
|
|
|
set_lat_tune(ret.lateralTuning, LatTunes.PID_L) |
|
|
|
set_lat_tune(ret.lateralTuning, LatTunes.PID_L) |
|
|
|
|
|
|
|
|
|
|
|
elif candidate == CAR.LEXUS_RC: |
|
|
|
elif candidate == CAR.LEXUS_RC: |
|
|
|
ret.safetyConfigs[0].safetyParam = 77 |
|
|
|
|
|
|
|
stop_and_go = False |
|
|
|
stop_and_go = False |
|
|
|
ret.wheelbase = 2.73050 |
|
|
|
ret.wheelbase = 2.73050 |
|
|
|
ret.steerRatio = 13.3 |
|
|
|
ret.steerRatio = 13.3 |
|
|
@ -172,7 +165,6 @@ class CarInterface(CarInterfaceBase): |
|
|
|
set_lat_tune(ret.lateralTuning, LatTunes.PID_L) |
|
|
|
set_lat_tune(ret.lateralTuning, LatTunes.PID_L) |
|
|
|
|
|
|
|
|
|
|
|
elif candidate == CAR.LEXUS_CTH: |
|
|
|
elif candidate == CAR.LEXUS_CTH: |
|
|
|
ret.safetyConfigs[0].safetyParam = 100 |
|
|
|
|
|
|
|
stop_and_go = True |
|
|
|
stop_and_go = True |
|
|
|
ret.wheelbase = 2.60 |
|
|
|
ret.wheelbase = 2.60 |
|
|
|
ret.steerRatio = 18.6 |
|
|
|
ret.steerRatio = 18.6 |
|
|
|