From 9b486007d23dcb23dab566aaceb1296064f070d7 Mon Sep 17 00:00:00 2001 From: Griffin Date: Wed, 5 Aug 2020 22:49:39 -0400 Subject: [PATCH 1/3] Update interface.py Add birdman6450#7399's Tune for Corolla TSS2. --- selfdrive/car/toyota/interface.py | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index c7da513acc543f..a375f252052e38 100755 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -249,14 +249,28 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), has_relay=False, break elif candidate in [CAR.COROLLA_TSS2, CAR.COROLLAH_TSS2]: + #stop_and_go = True + #ret.safetyParam = 73 + #ret.wheelbase = 2.63906 + #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 Tune stop_and_go = True ret.safetyParam = 73 ret.wheelbase = 2.63906 - ret.steerRatio = 13.9 - tire_stiffness_factor = 0.444 # not optimized yet + ret.steerRatio = 15.33 + tire_stiffness_factor = 0.996 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 + 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 elif candidate in [CAR.LEXUS_ES_TSS2, CAR.LEXUS_ESH_TSS2]: stop_and_go = True From 45853b142e5089812372ef6fd4387b172fad737e Mon Sep 17 00:00:00 2001 From: Griffin Date: Thu, 6 Aug 2020 08:28:24 -0400 Subject: [PATCH 2/3] Update op_params.py Add Corolla TSS2 Parameter --- common/op_params.py | 1 + 1 file changed, 1 insertion(+) diff --git a/common/op_params.py b/common/op_params.py index abb272836d2f57..a319fb088ace71 100644 --- a/common/op_params.py +++ b/common/op_params.py @@ -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'), From 66aac8578782ae1d9ef15fbc951299a144d7546e Mon Sep 17 00:00:00 2001 From: Griffin Date: Thu, 6 Aug 2020 08:40:05 -0400 Subject: [PATCH 3/3] Update interface.py Update to add support for OP_Edit toggle. --- selfdrive/car/toyota/interface.py | 35 +++++++++++++++---------------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index a375f252052e38..050d71a795a85e 100755 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -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): @@ -249,28 +250,26 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), has_relay=False, break elif candidate in [CAR.COROLLA_TSS2, CAR.COROLLAH_TSS2]: - #stop_and_go = True - #ret.safetyParam = 73 - #ret.wheelbase = 2.63906 - #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 Tune stop_and_go = True ret.safetyParam = 73 ret.wheelbase = 2.63906 - ret.steerRatio = 15.33 - tire_stiffness_factor = 0.996 + ret.steerRatio = 13.9 + tire_stiffness_factor = 0.444 # not optimized yet ret.mass = 3060. * CV.LB_TO_KG + STD_CARGO_KG - 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 + + # 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