From 603b2c5937c9efced2e085523780e15888a5824e Mon Sep 17 00:00:00 2001 From: cgw1968-5779 <58063525+cgw1968-5779@users.noreply.github.com> Date: Mon, 15 Feb 2021 01:01:49 +0800 Subject: [PATCH] Update interface.py --- selfdrive/car/toyota/interface.py | 50 +++++++++++++++++-------------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index 5f8fd07fd556ec..ff88c6bc2458fe 100755 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -243,44 +243,50 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), has_relay=False, ret.safetyParam = 56 ret.wheelbase = 2.68986 ret.steerRatio = 14.3 - ret.steerRateCost = 0.45 + ret.steerRateCost = 0.3 tire_stiffness_factor = 0.7933 ret.mass = 3370. * CV.LB_TO_KG + STD_CARGO_KG ret.longitudinalTuning.kpV = [2.1, 1.2, 0.34] ret.longitudinalTuning.kiV = [0.54, 0.34] - ret.steerActuatorDelay = 0.35 - ret.steerLimitTimer = 5.0 + ret.stoppingBrakeRate = 0.16 # reach stopping target smoothly + ret.startingBrakeRate = 0.75 # release brakes fast + ret.startAccel = 1.30 # Accelerate from 0 faster + ret.steerActuatorDelay = 0.12 + ret.steerLimitTimer = 0.1 ret.lateralTuning.init('indi') - ret.lateralTuning.indi.innerLoopGainBP = [16.7, 25, 36.1] - ret.lateralTuning.indi.innerLoopGainV = [9.5, 15, 15] - ret.lateralTuning.indi.outerLoopGainBP = [16.7, 25, 36.1] - ret.lateralTuning.indi.outerLoopGainV = [9.5, 14.99, 14.99] - ret.lateralTuning.indi.timeConstantBP = [16.7, 16.71, 22, 22.01, 26, 26.01, 36, 36.01] - ret.lateralTuning.indi.timeConstantV = [0.5, 1, 1, 2, 2, 4, 4, 5] - ret.lateralTuning.indi.actuatorEffectivenessBP = [16.7, 25, 36.1] - ret.lateralTuning.indi.actuatorEffectivenessV = [9.5, 15, 15] + ret.lateralTuning.indi.innerLoopGainBP = [16.7, 25] + ret.lateralTuning.indi.innerLoopGainV = [15, 15] + ret.lateralTuning.indi.outerLoopGainBP = [8.3, 11.1, 13.9, 16.7, 19.4, 22.2, 25, 30.1, 33.3, 36.1] + ret.lateralTuning.indi.outerLoopGainV = [4.6, 6.2, 8.3, 10.4, 12.8, 14.99, 16, 17, 18, 19] + ret.lateralTuning.indi.timeConstantBP = [8.3, 11.1, 13.9, 16.7, 19.4, 22.2, 25, 30.1, 33.3, 36.1] + ret.lateralTuning.indi.timeConstantV = [1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.0, 4.0, 4.0] + ret.lateralTuning.indi.actuatorEffectivenessBP = [16.7, 25] + ret.lateralTuning.indi.actuatorEffectivenessV = [15, 15] elif candidate == CAR.RAV4H_TSS2: stop_and_go = True ret.safetyParam = 56 ret.wheelbase = 2.68986 ret.steerRatio = 14.3 - ret.steerRateCost = 0.45 + ret.steerRateCost = 0.3 tire_stiffness_factor = 0.7933 ret.mass = 3370. * CV.LB_TO_KG + STD_CARGO_KG ret.longitudinalTuning.kpV = [2.1, 1.2, 0.34] ret.longitudinalTuning.kiV = [0.54, 0.34] - ret.steerActuatorDelay = 0.35 - ret.steerLimitTimer = 5.0 + ret.stoppingBrakeRate = 0.16 # reach stopping target smoothly + ret.startingBrakeRate = 0.75 # release brakes fast + ret.startAccel = 1.30 # Accelerate from 0 faster + ret.steerActuatorDelay = 0.12 + ret.steerLimitTimer = 0.1 ret.lateralTuning.init('indi') - ret.lateralTuning.indi.innerLoopGainBP = [16.7, 25, 36.1] - ret.lateralTuning.indi.innerLoopGainV = [9.5, 15, 15] - ret.lateralTuning.indi.outerLoopGainBP = [16.7, 25, 36.1] - ret.lateralTuning.indi.outerLoopGainV = [9.5, 14.99, 14.99] - ret.lateralTuning.indi.timeConstantBP = [16.7, 16.71, 22, 22.01, 26, 26.01, 36, 36.01] - ret.lateralTuning.indi.timeConstantV = [0.5, 1, 1, 2, 2, 4, 4, 5] - ret.lateralTuning.indi.actuatorEffectivenessBP = [16.7, 25, 36.1] - ret.lateralTuning.indi.actuatorEffectivenessV = [9.5, 15, 15] + ret.lateralTuning.indi.innerLoopGainBP = [16.7, 25] + ret.lateralTuning.indi.innerLoopGainV = [15, 15] + ret.lateralTuning.indi.outerLoopGainBP = [8.3, 11.1, 13.9, 16.7, 19.4, 22.2, 25, 30.1, 33.3, 36.1] + ret.lateralTuning.indi.outerLoopGainV = [4.6, 6.2, 8.3, 10.4, 12.8, 14.99, 16, 17, 18, 19] + ret.lateralTuning.indi.timeConstantBP = [8.3, 11.1, 13.9, 16.7, 19.4, 22.2, 25, 30.1, 33.3, 36.1] + ret.lateralTuning.indi.timeConstantV = [1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.0, 4.0, 4.0] + ret.lateralTuning.indi.actuatorEffectivenessBP = [16.7, 25] + ret.lateralTuning.indi.actuatorEffectivenessV = [15, 15] elif candidate in [CAR.COROLLA_TSS2, CAR.COROLLAH_TSS2]: stop_and_go = True