Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions common/op_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def __init__(self):
'localizer might not work correctly'),
'prius_use_lqr': Param(False, bool, 'If you have a newer Prius with a good angle sensor, you can try enabling this to use LQR'),
'corolla_use_lqr': Param(False, bool, 'Enable this to use LQR for lat with your Corolla (2017)'),
'corollaTSS2_use_indi': Param(False, bool, 'Enable this to use INDI for lat with your Corolla with TSS2'),
'username': Param(None, [type(None), str, bool], 'Your identifier provided with any crash logs sent to Sentry.\n'
'Helps the developer reach out to you if anything goes wrong'),

Expand Down
17 changes: 15 additions & 2 deletions selfdrive/car/toyota/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
op_params = opParams()
prius_use_lqr = op_params.get('prius_use_lqr')
corolla_use_lqr = op_params.get('corolla_use_lqr')
corollaTSS2_use_indi = op_params.get('corollaTSS2_use_indi')
EventName = car.CarEvent.EventName

class CarInterface(CarInterfaceBase):
Expand Down Expand Up @@ -255,8 +256,20 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), has_relay=False,
ret.steerRatio = 13.9
tire_stiffness_factor = 0.444 # not optimized yet
ret.mass = 3060. * CV.LB_TO_KG + STD_CARGO_KG
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.6], [0.1]]
ret.lateralTuning.pid.kf = 0.00007818594

# birdman6450#7399's Corolla 2020 TSS2 Tune
if corollaTSS2_use_indi:
ret.steerRatio = 15.33
tire_stiffness_factor = 0.996
ret.lateralTuning.init('indi')
ret.lateralTuning.indi.innerLoopGain = 6.0
ret.lateralTuning.indi.outerLoopGain = 15.0
ret.lateralTuning.indi.timeConstant = 5.5
ret.lateralTuning.indi.actuatorEffectiveness = 6.0
ret.steerActuatorDelay = 0.57
else:
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.6], [0.1]]
ret.lateralTuning.pid.kf = 0.00007818594

elif candidate in [CAR.LEXUS_ES_TSS2, CAR.LEXUS_ESH_TSS2]:
stop_and_go = True
Expand Down