From 37a61b9d95fcb1ff84794eff17b54059f8b0b3f9 Mon Sep 17 00:00:00 2001 From: rav4kumar <36933347+rav4kumar@users.noreply.github.com> Date: Fri, 26 Mar 2021 10:25:28 -0700 Subject: [PATCH 01/35] TUNE TSS2_prius --- selfdrive/car/toyota/interface.py | 42 ++++++++++++++----------------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index 078faa0715506a..5dfd609c93a813 100755 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -81,37 +81,33 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), has_relay=False, ret.steerRatio = 13.4 # True steerRation from older prius tire_stiffness_factor = 0.6371 # hand-tune ret.mass = 3115. * CV.LB_TO_KG + STD_CARGO_KG - ret.steerActuatorDelay = 0.6 if prius_pid: ret.lateralTuning.init('pid') - ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP, ret.lateralTuning.pid.kfBP = [[0.], [0.], [0.]] - ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.35, 0.18], [0.03, 0.1]] - ret.lateralTuning.pid.kdV = [2.2] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.6], [0.1]] ret.lateralTuning.pid.kfV = [0.00007818594] - ret.lateralTuning.pid.newKfTuned = False + #ret.lateralTuning.pid.newKfTuned = False else: + ret.steerActuatorDelay = 0.6 ret.steerRateCost = 0.45 #0.45 ret.steerLimitTimer = 5.0 ret.lateralTuning.init('indi') - #ret.lateralTuning.indi.innerLoopGainBP = [16.7, 25] - #ret.lateralTuning.indi.innerLoopGainV = [15, 15] - #ret.lateralTuning.indi.outerLoopGainBP = [8.3, 25, 27.7, 36.1] - #ret.lateralTuning.indi.outerLoopGainV = [4.6, 14.99, 14.99, 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] + ret.lateralTuning.indi.innerLoopGainBP = [16.7, 25] + ret.lateralTuning.indi.innerLoopGainV = [15, 15] + ret.lateralTuning.indi.outerLoopGainBP = [8.3, 25, 27.7, 36.1] + ret.lateralTuning.indi.outerLoopGainV = [4.6, 14.99, 14.99, 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] #ret.lateralTuning.init('indi') #really good tune from cgw. - 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, 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] elif candidate in [CAR.RAV4, CAR.RAV4H]: stop_and_go = True if (candidate in CAR.RAV4H) else False From d95c1e29676a884bddaed552106f6867c05e3d6a Mon Sep 17 00:00:00 2001 From: Arne Schwarck Date: Tue, 30 Mar 2021 07:07:44 +0200 Subject: [PATCH 02/35] Increase RAV4 steering ratio by 2.5% --- selfdrive/car/toyota/interface.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index 5dfd609c93a813..7cc8a4da1a9dab 100755 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -113,7 +113,7 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), has_relay=False, stop_and_go = True if (candidate in CAR.RAV4H) else False ret.safetyParam = 73 ret.wheelbase = 2.65 - ret.steerRatio = 13.88 # 14.5 is spec end-to-end + ret.steerRatio = 14.1 # 14.5 is spec end-to-end tire_stiffness_factor = 0.5533 ret.mass = 3650. * CV.LB_TO_KG + STD_CARGO_KG # mean between normal and hybrid if ret.enableGasInterceptor: From 475cb9c22caf266473fa8f298cdbd20784b16a0c Mon Sep 17 00:00:00 2001 From: rav4kumar <36933347+rav4kumar@users.noreply.github.com> Date: Tue, 30 Mar 2021 13:29:14 -0700 Subject: [PATCH 03/35] try birdmans tune once again. --- selfdrive/car/toyota/interface.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index 7cc8a4da1a9dab..75163d1fc9515d 100755 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -83,9 +83,12 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), has_relay=False, ret.mass = 3115. * CV.LB_TO_KG + STD_CARGO_KG if prius_pid: ret.lateralTuning.init('pid') - ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.6], [0.1]] - ret.lateralTuning.pid.kfV = [0.00007818594] - #ret.lateralTuning.pid.newKfTuned = False + ret.lateralTuning.pid.kpBP = [0.0] + ret.lateralTuning.pid.kiBP = [0.0] + ret.lateralTuning.pid.kpV = [0.036] + ret.lateralTuning.pid.kiV = [0.0012] + ret.lateralTuning.pid.kf = 0.000153263811757641 + ret.lateralTuning.pid.newKfTuned = True else: ret.steerActuatorDelay = 0.6 ret.steerRateCost = 0.45 #0.45 From 51621c7441969002727f3bf2ba016179448a9622 Mon Sep 17 00:00:00 2001 From: Arne Schwarck Date: Sat, 3 Apr 2021 13:56:17 +0200 Subject: [PATCH 04/35] decrease rav4h steering ratio by 5% --- selfdrive/car/toyota/interface.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index 75163d1fc9515d..009e58e9bd8aeb 100755 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -116,7 +116,7 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), has_relay=False, stop_and_go = True if (candidate in CAR.RAV4H) else False ret.safetyParam = 73 ret.wheelbase = 2.65 - ret.steerRatio = 14.1 # 14.5 is spec end-to-end + ret.steerRatio = 13.7 # 14.5 is spec end-to-end tire_stiffness_factor = 0.5533 ret.mass = 3650. * CV.LB_TO_KG + STD_CARGO_KG # mean between normal and hybrid if ret.enableGasInterceptor: From c9e21cd0e1d703ad32098dcf8f60f37df63921b7 Mon Sep 17 00:00:00 2001 From: cgw1968-5779 <58063525+cgw1968-5779@users.noreply.github.com> Date: Sun, 4 Apr 2021 23:57:23 +0800 Subject: [PATCH 05/35] Update interface.py --- selfdrive/car/toyota/interface.py | 59 ++++++++++++++++--------------- 1 file changed, 31 insertions(+), 28 deletions(-) diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index 009e58e9bd8aeb..f0cac2c70257e6 100755 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -268,8 +268,8 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), has_relay=False, stop_and_go = True ret.safetyParam = 56 ret.wheelbase = 2.68986 - ret.steerRatio = 14.3 - ret.steerRateCost = 0.4 + ret.steerRatio = 13.1 + ret.steerRateCost = 0.7 tire_stiffness_factor = 0.7933 ret.mass = 3370. * CV.LB_TO_KG + STD_CARGO_KG ret.longitudinalTuning.deadzoneBP = [0., 8.05] @@ -278,45 +278,48 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), has_relay=False, ret.longitudinalTuning.kpV = [1.3, 1.0, 0.7] ret.longitudinalTuning.kiBP = [0., 5., 12., 20., 27.] ret.longitudinalTuning.kiV = [.35, .23, .20, .17, .1] - ret.stoppingBrakeRate = 0.15 # reach stopping target smoothly + ret.stoppingBrakeRate = 0.16 # reach stopping target smoothly ret.startingBrakeRate = 1.21 # release brakes fast ret.startAccel = 1.50 # Accelerate from 0 faster ret.steerActuatorDelay = 0 - ret.steerLimitTimer = 5 + ret.steerLimitTimer = 1 ret.lateralTuning.init('indi') - ret.lateralTuning.indi.innerLoopGainBP = [8.3, 11.1, 13.9, 16.7, 19.4, 22.2, 25, 26] - ret.lateralTuning.indi.innerLoopGainV = [4.15, 5.55, 7, 8.9, 10.0, 12.15, 14.25, 15] - ret.lateralTuning.indi.outerLoopGainBP = [8.3, 11.1, 13.9, 16.7, 19.4, 22.2, 25, 26, 30.3, 33.6] - ret.lateralTuning.indi.outerLoopGainV = [3.6, 4.9, 6.15, 7.5, 10, 11.2, 15, 16, 17, 17] - ret.lateralTuning.indi.timeConstantBP = [8.3, 11.1, 13.9, 16.7, 19.4, 22.2, 25, 26, 30.3, 33.6] - ret.lateralTuning.indi.timeConstantV = [0.46, 0.62, 0.77, 0.93, 1.1, 3.0, 4.0, 5.5, 7.0, 8.0] - ret.lateralTuning.indi.actuatorEffectivenessBP = [8.3, 11.1, 13.9, 16.7, 19.4, 22.2, 25, 26] - ret.lateralTuning.indi.actuatorEffectivenessV = [4.15, 5.55, 7, 8.9, 10.0, 12.15, 14.25, 15] + ret.lateralTuning.indi.innerLoopGainBP = [5.5, 8.3, 11.1, 13.9, 16.7, 19.4, 22.2, 25] + ret.lateralTuning.indi.innerLoopGainV = [6.4, 8.2, 10, 12, 13.8, 15, 15, 15] + ret.lateralTuning.indi.outerLoopGainBP = [5.5, 8.3, 11.1, 13.9, 16.7, 19.4, 22.2, 25, 28.4, 30.3] + ret.lateralTuning.indi.outerLoopGainV = [2.75, 4.6, 6.35, 8.1, 9.85, 11.7, 13.6, 15.4, 17.2, 19] + ret.lateralTuning.indi.timeConstantV = [0.33, 0.44, 0.55, 0.66, 0.88, 1.3, 3.0, 3.0, 6.0] + ret.lateralTuning.indi.actuatorEffectivenessBP = [5.5, 8.3, 11.1, 13.9, 16.7, 19.4, 22.2, 25] + ret.lateralTuning.indi.actuatorEffectivenessV = [6.0, 7.8, 9.6, 11.6, 13.4, 15, 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.3 + ret.steerRatio = 13.1 + ret.steerRateCost = 0.7 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.longitudinalTuning.deadzoneBP = [0., 8.05] + ret.longitudinalTuning.deadzoneV = [.0, .14] + ret.longitudinalTuning.kpBP = [0., 5., 20.] + ret.longitudinalTuning.kpV = [1.3, 1.0, 0.7] + ret.longitudinalTuning.kiBP = [0., 5., 12., 20., 27.] + ret.longitudinalTuning.kiV = [.35, .23, .20, .17, .1] 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.startingBrakeRate = 1.21 # release brakes fast + ret.startAccel = 1.50 # Accelerate from 0 faster + ret.steerActuatorDelay = 0 + ret.steerLimitTimer = 1 ret.lateralTuning.init('indi') - 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] + ret.lateralTuning.indi.innerLoopGainBP = [5.5, 8.3, 11.1, 13.9, 16.7, 19.4, 22.2, 25] + ret.lateralTuning.indi.innerLoopGainV = [6.4, 8.2, 10, 12, 13.8, 15, 15, 15] + ret.lateralTuning.indi.outerLoopGainBP = [5.5, 8.3, 11.1, 13.9, 16.7, 19.4, 22.2, 25, 28.4, 30.3] + ret.lateralTuning.indi.outerLoopGainV = [2.75, 4.6, 6.35, 8.1, 9.85, 11.7, 13.6, 15.4, 17.2, 19] + ret.lateralTuning.indi.timeConstantBP = [5.5, 8.3, 11.1, 13.9, 16.7, 19.4, 22.2, 30.09, 30.1] + ret.lateralTuning.indi.timeConstantV = [0.33, 0.44, 0.55, 0.66, 0.88, 1.3, 3.0, 3.0, 6.0] + ret.lateralTuning.indi.actuatorEffectivenessBP = [5.5, 8.3, 11.1, 13.9, 16.7, 19.4, 22.2, 25] + ret.lateralTuning.indi.actuatorEffectivenessV = [6.0, 7.8, 9.6, 11.6, 13.4, 15, 15, 15] elif candidate in [CAR.COROLLA_TSS2, CAR.COROLLAH_TSS2]: stop_and_go = True From aea76bff0a87e2368c5c2177f5860448df964438 Mon Sep 17 00:00:00 2001 From: Arne Schwarck Date: Tue, 6 Apr 2021 11:54:06 +0200 Subject: [PATCH 06/35] increase rav4h SteeringRatio --- selfdrive/car/toyota/interface.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index f0cac2c70257e6..ef26c70747fd28 100755 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -116,7 +116,7 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), has_relay=False, stop_and_go = True if (candidate in CAR.RAV4H) else False ret.safetyParam = 73 ret.wheelbase = 2.65 - ret.steerRatio = 13.7 # 14.5 is spec end-to-end + ret.steerRatio = 13.85 # 14.5 is spec end-to-end tire_stiffness_factor = 0.5533 ret.mass = 3650. * CV.LB_TO_KG + STD_CARGO_KG # mean between normal and hybrid if ret.enableGasInterceptor: From 3dc6b5de1ca433afccc042ab999b877d311ac2e6 Mon Sep 17 00:00:00 2001 From: rav4kumar <36933347+rav4kumar@users.noreply.github.com> Date: Tue, 6 Apr 2021 16:59:10 -0700 Subject: [PATCH 07/35] try new things --- selfdrive/car/toyota/interface.py | 35 ++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index ef26c70747fd28..1233e653624f6c 100755 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -81,6 +81,8 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), has_relay=False, ret.steerRatio = 13.4 # True steerRation from older prius tire_stiffness_factor = 0.6371 # hand-tune ret.mass = 3115. * CV.LB_TO_KG + STD_CARGO_KG + ret.steerActuatorDelay = 0.61 + ret.steerLimitTimer = 5.0 if prius_pid: ret.lateralTuning.init('pid') ret.lateralTuning.pid.kpBP = [0.0] @@ -90,18 +92,27 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), has_relay=False, ret.lateralTuning.pid.kf = 0.000153263811757641 ret.lateralTuning.pid.newKfTuned = True else: - ret.steerActuatorDelay = 0.6 ret.steerRateCost = 0.45 #0.45 - ret.steerLimitTimer = 5.0 + ret.longitudinalTuning.deadzoneBP = [0., 8.05] + ret.longitudinalTuning.deadzoneV = [.0, .14] + ret.longitudinalTuning.kpBP = [0., 5., 20.] + ret.longitudinalTuning.kpV = [1.3, 1.0, 0.7] + ret.longitudinalTuning.kiBP = [0., 5., 12., 20., 27.] + ret.longitudinalTuning.kiV = [.35, .23, .20, .17, .1] + ret.stoppingBrakeRate = 0.14 # reach stopping target smoothly + ret.startingBrakeRate = 1.21 # release brakes fast + ret.startAccel = 1.50 # Accelerate from 0 faster + ret.steerActuatorDelay = 0 + ret.steerLimitTimer = 1 ret.lateralTuning.init('indi') - ret.lateralTuning.indi.innerLoopGainBP = [16.7, 25] - ret.lateralTuning.indi.innerLoopGainV = [15, 15] - ret.lateralTuning.indi.outerLoopGainBP = [8.3, 25, 27.7, 36.1] - ret.lateralTuning.indi.outerLoopGainV = [4.6, 14.99, 14.99, 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] + ret.lateralTuning.indi.innerLoopGainBP = [5.5, 8.3, 11.1, 13.9, 16.7, 19.4, 22.2, 25] + ret.lateralTuning.indi.innerLoopGainV = [6.4, 8.2, 10, 12, 13.8, 15, 15, 15] # optimal centering values for curving + ret.lateralTuning.indi.outerLoopGainBP = [5.5, 8.3, 11.1, 13.9, 16.7, 19.4, 22.2, 25, 28.4, 30.3] + ret.lateralTuning.indi.outerLoopGainV = [2.75, 4.6, 6.35, 8.1, 9.85, 11.7, 13.6, 15.4, 17.2, 19] # optimal centering values for curving; last 3 values for smoother ALC and solid lane centering + ret.lateralTuning.indi.timeConstantBP = [5.5, 8.3, 11.1, 13.9, 16.7, 19.4, 22.2, 30.09, 30.1] + ret.lateralTuning.indi.timeConstantV = [0.33, 0.44, 0.55, 0.66, 0.88, 1.3, 3.0, 3.0, 6.0] # optimized course plotting for low speed curves; high last value produces smoother ALC and ride quality + ret.lateralTuning.indi.actuatorEffectivenessBP = [5.5, 8.3, 11.1, 13.9, 16.7, 19.4, 22.2, 25] + ret.lateralTuning.indi.actuatorEffectivenessV = [6.0, 7.8, 9.6, 11.6, 13.4, 15, 15, 15] # balance between high angle curving and rocking #ret.lateralTuning.init('indi') #really good tune from cgw. #ret.lateralTuning.indi.innerLoopGainBP = [16.7, 25, 36.1] #ret.lateralTuning.indi.innerLoopGainV = [9.5, 15, 15] @@ -287,8 +298,8 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), has_relay=False, ret.lateralTuning.indi.innerLoopGainBP = [5.5, 8.3, 11.1, 13.9, 16.7, 19.4, 22.2, 25] ret.lateralTuning.indi.innerLoopGainV = [6.4, 8.2, 10, 12, 13.8, 15, 15, 15] ret.lateralTuning.indi.outerLoopGainBP = [5.5, 8.3, 11.1, 13.9, 16.7, 19.4, 22.2, 25, 28.4, 30.3] - ret.lateralTuning.indi.outerLoopGainV = [2.75, 4.6, 6.35, 8.1, 9.85, 11.7, 13.6, 15.4, 17.2, 19] - ret.lateralTuning.indi.timeConstantV = [0.33, 0.44, 0.55, 0.66, 0.88, 1.3, 3.0, 3.0, 6.0] + ret.lateralTuning.indi.outerLoopGainV = [2.75, 4.6, 6.35, 8.1, 9.85, 11.7, 13.6, 15.4, 17.2, 19] + ret.lateralTuning.indi.timeConstantV = [0.33, 0.44, 0.55, 0.66, 0.88, 1.3, 3.0, 3.0, 6.0] ret.lateralTuning.indi.actuatorEffectivenessBP = [5.5, 8.3, 11.1, 13.9, 16.7, 19.4, 22.2, 25] ret.lateralTuning.indi.actuatorEffectivenessV = [6.0, 7.8, 9.6, 11.6, 13.4, 15, 15, 15] From 431bf369d6fabfdd30be9013e1e4c2e516712cbd Mon Sep 17 00:00:00 2001 From: rav4kumar <36933347+rav4kumar@users.noreply.github.com> Date: Thu, 8 Apr 2021 10:03:14 -0700 Subject: [PATCH 08/35] cgw recom --- selfdrive/car/toyota/interface.py | 33 +++++++++++-------------------- 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index 1233e653624f6c..5241e05b61b75e 100755 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -81,9 +81,9 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), has_relay=False, ret.steerRatio = 13.4 # True steerRation from older prius tire_stiffness_factor = 0.6371 # hand-tune ret.mass = 3115. * CV.LB_TO_KG + STD_CARGO_KG - ret.steerActuatorDelay = 0.61 - ret.steerLimitTimer = 5.0 if prius_pid: + ret.steerActuatorDelay = 0.61 + ret.steerLimitTimer = 5.0 ret.lateralTuning.init('pid') ret.lateralTuning.pid.kpBP = [0.0] ret.lateralTuning.pid.kiBP = [0.0] @@ -92,27 +92,18 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), has_relay=False, ret.lateralTuning.pid.kf = 0.000153263811757641 ret.lateralTuning.pid.newKfTuned = True else: - ret.steerRateCost = 0.45 #0.45 - ret.longitudinalTuning.deadzoneBP = [0., 8.05] - ret.longitudinalTuning.deadzoneV = [.0, .14] - ret.longitudinalTuning.kpBP = [0., 5., 20.] - ret.longitudinalTuning.kpV = [1.3, 1.0, 0.7] - ret.longitudinalTuning.kiBP = [0., 5., 12., 20., 27.] - ret.longitudinalTuning.kiV = [.35, .23, .20, .17, .1] - ret.stoppingBrakeRate = 0.14 # reach stopping target smoothly - ret.startingBrakeRate = 1.21 # release brakes fast - ret.startAccel = 1.50 # Accelerate from 0 faster + ret.steerRateCost = 0.3 #0.45 ret.steerActuatorDelay = 0 - ret.steerLimitTimer = 1 + #ret.steerLimitTimer = 1 ret.lateralTuning.init('indi') - ret.lateralTuning.indi.innerLoopGainBP = [5.5, 8.3, 11.1, 13.9, 16.7, 19.4, 22.2, 25] - ret.lateralTuning.indi.innerLoopGainV = [6.4, 8.2, 10, 12, 13.8, 15, 15, 15] # optimal centering values for curving - ret.lateralTuning.indi.outerLoopGainBP = [5.5, 8.3, 11.1, 13.9, 16.7, 19.4, 22.2, 25, 28.4, 30.3] - ret.lateralTuning.indi.outerLoopGainV = [2.75, 4.6, 6.35, 8.1, 9.85, 11.7, 13.6, 15.4, 17.2, 19] # optimal centering values for curving; last 3 values for smoother ALC and solid lane centering - ret.lateralTuning.indi.timeConstantBP = [5.5, 8.3, 11.1, 13.9, 16.7, 19.4, 22.2, 30.09, 30.1] - ret.lateralTuning.indi.timeConstantV = [0.33, 0.44, 0.55, 0.66, 0.88, 1.3, 3.0, 3.0, 6.0] # optimized course plotting for low speed curves; high last value produces smoother ALC and ride quality - ret.lateralTuning.indi.actuatorEffectivenessBP = [5.5, 8.3, 11.1, 13.9, 16.7, 19.4, 22.2, 25] - ret.lateralTuning.indi.actuatorEffectivenessV = [6.0, 7.8, 9.6, 11.6, 13.4, 15, 15, 15] # balance between high angle curving and rocking + ret.lateralTuning.indi.innerLoopGainBP = [18, 22, 26] + ret.lateralTuning.indi.innerLoopGainV = [10, 13, 15] + ret.lateralTuning.indi.outerLoopGainBP = [18, 22, 26] + ret.lateralTuning.indi.outerLoopGainV = [9, 12, 14.99] + ret.lateralTuning.indi.timeConstantBP = [18, 22, 26, 33] + ret.lateralTuning.indi.timeConstantV = [1, 3, 4.5, 8] + et.lateralTuning.indi.actuatorEffectivenessBP = [18, 22, 26] + ret.lateralTuning.indi.actuatorEffectivenessV = [10, 13, 15] #ret.lateralTuning.init('indi') #really good tune from cgw. #ret.lateralTuning.indi.innerLoopGainBP = [16.7, 25, 36.1] #ret.lateralTuning.indi.innerLoopGainV = [9.5, 15, 15] From c23ef972f4bbee424ad3dce918ac9141324e4c16 Mon Sep 17 00:00:00 2001 From: cgw1968-5779 <58063525+cgw1968-5779@users.noreply.github.com> Date: Fri, 9 Apr 2021 01:08:45 +0800 Subject: [PATCH 09/35] near perfect RAV4TSS2 INDI tune (#829) --- selfdrive/car/toyota/interface.py | 35 ++++++++++++++++--------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index 5241e05b61b75e..8e28082097ca0f 100755 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -270,8 +270,8 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), has_relay=False, stop_and_go = True ret.safetyParam = 56 ret.wheelbase = 2.68986 - ret.steerRatio = 13.1 - ret.steerRateCost = 0.7 + ret.steerRatio = 13.7 + ret.steerRateCost = 0.3 tire_stiffness_factor = 0.7933 ret.mass = 3370. * CV.LB_TO_KG + STD_CARGO_KG ret.longitudinalTuning.deadzoneBP = [0., 8.05] @@ -284,22 +284,23 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), has_relay=False, ret.startingBrakeRate = 1.21 # release brakes fast ret.startAccel = 1.50 # Accelerate from 0 faster ret.steerActuatorDelay = 0 - ret.steerLimitTimer = 1 + ret.steerLimitTimer = 5 ret.lateralTuning.init('indi') ret.lateralTuning.indi.innerLoopGainBP = [5.5, 8.3, 11.1, 13.9, 16.7, 19.4, 22.2, 25] - ret.lateralTuning.indi.innerLoopGainV = [6.4, 8.2, 10, 12, 13.8, 15, 15, 15] - ret.lateralTuning.indi.outerLoopGainBP = [5.5, 8.3, 11.1, 13.9, 16.7, 19.4, 22.2, 25, 28.4, 30.3] - ret.lateralTuning.indi.outerLoopGainV = [2.75, 4.6, 6.35, 8.1, 9.85, 11.7, 13.6, 15.4, 17.2, 19] - ret.lateralTuning.indi.timeConstantV = [0.33, 0.44, 0.55, 0.66, 0.88, 1.3, 3.0, 3.0, 6.0] + ret.lateralTuning.indi.innerLoopGainV = [4.2, 5.8, 7.55, 9.3, 11.1, 12.9, 14.7, 15] + ret.lateralTuning.indi.outerLoopGainBP = [5.5, 8.3, 11.1, 13.9, 16.7, 19.4, 22.2, 25] + ret.lateralTuning.indi.outerLoopGainV = [3.05, 4.66, 6.32, 8.12, 9.87, 11.72, 13.62, 14.99] + ret.lateralTuning.indi.timeConstantBP = [5.5, 8.3, 11.1, 13.9, 16.7, 19.4, 22.2, 30.09, 30.1, 33.32, 33.33] + ret.lateralTuning.indi.timeConstantV = [0.31, 0.46, 0.62, 0.84, 0.97, 1.2, 3.0, 3.0, 6.5, 6.5, 8.0] ret.lateralTuning.indi.actuatorEffectivenessBP = [5.5, 8.3, 11.1, 13.9, 16.7, 19.4, 22.2, 25] - ret.lateralTuning.indi.actuatorEffectivenessV = [6.0, 7.8, 9.6, 11.6, 13.4, 15, 15, 15] + ret.lateralTuning.indi.actuatorEffectivenessV = [4.2, 5.8, 7.55, 9.3, 11.1, 12.9, 14.7, 15] elif candidate == CAR.RAV4H_TSS2: stop_and_go = True ret.safetyParam = 56 ret.wheelbase = 2.68986 - ret.steerRatio = 13.1 - ret.steerRateCost = 0.7 + ret.steerRatio = 13.7 + ret.steerRateCost = 0.3 tire_stiffness_factor = 0.7933 ret.mass = 3370. * CV.LB_TO_KG + STD_CARGO_KG ret.longitudinalTuning.deadzoneBP = [0., 8.05] @@ -312,16 +313,16 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), has_relay=False, ret.startingBrakeRate = 1.21 # release brakes fast ret.startAccel = 1.50 # Accelerate from 0 faster ret.steerActuatorDelay = 0 - ret.steerLimitTimer = 1 + ret.steerLimitTimer = 5 ret.lateralTuning.init('indi') ret.lateralTuning.indi.innerLoopGainBP = [5.5, 8.3, 11.1, 13.9, 16.7, 19.4, 22.2, 25] - ret.lateralTuning.indi.innerLoopGainV = [6.4, 8.2, 10, 12, 13.8, 15, 15, 15] - ret.lateralTuning.indi.outerLoopGainBP = [5.5, 8.3, 11.1, 13.9, 16.7, 19.4, 22.2, 25, 28.4, 30.3] - ret.lateralTuning.indi.outerLoopGainV = [2.75, 4.6, 6.35, 8.1, 9.85, 11.7, 13.6, 15.4, 17.2, 19] - ret.lateralTuning.indi.timeConstantBP = [5.5, 8.3, 11.1, 13.9, 16.7, 19.4, 22.2, 30.09, 30.1] - ret.lateralTuning.indi.timeConstantV = [0.33, 0.44, 0.55, 0.66, 0.88, 1.3, 3.0, 3.0, 6.0] + ret.lateralTuning.indi.innerLoopGainV = [4.2, 5.8, 7.55, 9.3, 11.1, 12.9, 14.7, 15] + ret.lateralTuning.indi.outerLoopGainBP = [5.5, 8.3, 11.1, 13.9, 16.7, 19.4, 22.2, 25] + ret.lateralTuning.indi.outerLoopGainV = [3.05, 4.66, 6.32, 8.12, 9.87, 11.72, 13.62, 14.99] + ret.lateralTuning.indi.timeConstantBP = [5.5, 8.3, 11.1, 13.9, 16.7, 19.4, 22.2, 30.09, 30.1, 33.32, 33.33] + ret.lateralTuning.indi.timeConstantV = [0.31, 0.46, 0.62, 0.84, 0.97, 1.2, 3.0, 3.0, 6.5, 6.5, 8.0] ret.lateralTuning.indi.actuatorEffectivenessBP = [5.5, 8.3, 11.1, 13.9, 16.7, 19.4, 22.2, 25] - ret.lateralTuning.indi.actuatorEffectivenessV = [6.0, 7.8, 9.6, 11.6, 13.4, 15, 15, 15] + ret.lateralTuning.indi.actuatorEffectivenessV = [4.2, 5.8, 7.55, 9.3, 11.1, 12.9, 14.7, 15] elif candidate in [CAR.COROLLA_TSS2, CAR.COROLLAH_TSS2]: stop_and_go = True From a8697e6616683ebef17e42901c3e9b17390a8fbf Mon Sep 17 00:00:00 2001 From: rav4kumar <36933347+rav4kumar@users.noreply.github.com> Date: Thu, 8 Apr 2021 11:29:25 -0700 Subject: [PATCH 10/35] syntax --- selfdrive/car/toyota/interface.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index 8e28082097ca0f..a43dfaddb30e85 100755 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -94,7 +94,7 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), has_relay=False, else: ret.steerRateCost = 0.3 #0.45 ret.steerActuatorDelay = 0 - #ret.steerLimitTimer = 1 + ret.steerLimitTimer = 5 ret.lateralTuning.init('indi') ret.lateralTuning.indi.innerLoopGainBP = [18, 22, 26] ret.lateralTuning.indi.innerLoopGainV = [10, 13, 15] @@ -102,7 +102,7 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), has_relay=False, ret.lateralTuning.indi.outerLoopGainV = [9, 12, 14.99] ret.lateralTuning.indi.timeConstantBP = [18, 22, 26, 33] ret.lateralTuning.indi.timeConstantV = [1, 3, 4.5, 8] - et.lateralTuning.indi.actuatorEffectivenessBP = [18, 22, 26] + ret.lateralTuning.indi.actuatorEffectivenessBP = [18, 22, 26] ret.lateralTuning.indi.actuatorEffectivenessV = [10, 13, 15] #ret.lateralTuning.init('indi') #really good tune from cgw. #ret.lateralTuning.indi.innerLoopGainBP = [16.7, 25, 36.1] From e74bad4445fbd627c588b159cdc55bf67315f324 Mon Sep 17 00:00:00 2001 From: Arne Schwarck Date: Thu, 8 Apr 2021 20:34:42 +0200 Subject: [PATCH 11/35] Retune long --- selfdrive/car/toyota/interface.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index a43dfaddb30e85..cdf650fd4d1d49 100755 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -487,8 +487,8 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), has_relay=False, else: ret.gasMaxBP = [0., 9., 55] ret.gasMaxV = [0.2, 0.5, 0.7] - ret.longitudinalTuning.kpV = [0.4, 0.36, 0.325] # braking tune from rav4h - ret.longitudinalTuning.kiV = [0.195, 0.10] + ret.longitudinalTuning.kpV = [0.25, 0.3, 0.325] # braking tune from rav4h + ret.longitudinalTuning.kiV = [0.1, 0.10] return ret From 932b1b927b28550286d0c75c1965007739dd4c22 Mon Sep 17 00:00:00 2001 From: Arne Schwarck Date: Thu, 8 Apr 2021 20:53:28 +0200 Subject: [PATCH 12/35] Adjust high speed longitudinal tune --- selfdrive/car/toyota/interface.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index cdf650fd4d1d49..a1e16d0c1abd4f 100755 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -487,7 +487,7 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), has_relay=False, else: ret.gasMaxBP = [0., 9., 55] ret.gasMaxV = [0.2, 0.5, 0.7] - ret.longitudinalTuning.kpV = [0.25, 0.3, 0.325] # braking tune from rav4h + ret.longitudinalTuning.kpV = [0.25, 0.3, 0.25] # braking tune from rav4h ret.longitudinalTuning.kiV = [0.1, 0.10] return ret From 572e13964f8ef121fc697d520701cb66e60dd0f0 Mon Sep 17 00:00:00 2001 From: Arne Schwarck Date: Sat, 10 Apr 2021 10:48:40 +0200 Subject: [PATCH 13/35] Update FP from Master --- selfdrive/car/toyota/values.py | 54 ++++++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 3 deletions(-) diff --git a/selfdrive/car/toyota/values.py b/selfdrive/car/toyota/values.py index f66bf8953bfd5d..54be99b154e756 100644 --- a/selfdrive/car/toyota/values.py +++ b/selfdrive/car/toyota/values.py @@ -531,11 +531,13 @@ class CAR: ], (Ecu.dsu, 0x791, None): [ b'8821F0W01000 ', + b'8821F0W01100 ', b'8821FF401600 ', b'8821FF404000 ', b'8821FF404100 ', b'8821FF405100 ', b'8821FF406000 ', + b'8821FF407100 ', b'8821F0W01100 ', b'8821FF403100 ', # 2018 China Toyota CHR ], @@ -552,12 +554,15 @@ class CAR: (Ecu.eps, 0x7a1, None): [ b'8965B10011\x00\x00\x00\x00\x00\x00', b'8965B10040\x00\x00\x00\x00\x00\x00', + b'8965B10070\x00\x00\x00\x00\x00\x00', b'8965B10020\x00\x00\x00\x00\x00\x00', # 2018 China Toyota CHR ], (Ecu.engine, 0x7e0, None): [ + b'\x0331024000\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00895231203202\x00\x00\x00\x00', + b'\x0331024000\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00895231203302\x00\x00\x00\x00', + b'\x0331036000\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00895231203302\x00\x00\x00\x00', b'\x033F401100\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00895231203102\x00\x00\x00\x00', b'\x033F424000\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00895231203202\x00\x00\x00\x00', - b'\x0331024000\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00895231203302\x00\x00\x00\x00', ], (Ecu.fwdRadar, 0x750, 0xf): [ b'8821F0W01000 ', @@ -566,6 +571,7 @@ class CAR: b'8821FF404100 ', b'8821FF405100 ', b'8821FF406000 ', + b'8821FF407100 ', b'8821F0W01100 ', b'8821FF403100 ', # 2018 China Toyota CHR ], @@ -573,33 +579,40 @@ class CAR: b'8646FF401800 ', b'8646FF404000 ', b'8646FF406000 ', + b'8646FF407000 ', b'8646FF403100 ', # 2018 China Toyota CHR ], }, CAR.CHRH: { (Ecu.engine, 0x700, None): [ - b'\x0289663F423000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', b'\x0289663F431000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', + b'\x0289663F423000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', + b'\x0289663F405000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', b'\x0189663F438000\x00\x00\x00\x00', ], (Ecu.esp, 0x7b0, None): [ b'F152610040\x00\x00\x00\x00\x00\x00', b'F152610190\x00\x00\x00\x00\x00\x00', + b'F152610013\x00\x00\x00\x00\x00\x00', ], (Ecu.dsu, 0x791, None): [ b'8821FF404000 ', + b'8821FF406000 ', b'8821FF407100 ', ], (Ecu.eps, 0x7a1, None): [ + b'8965B10011\x00\x00\x00\x00\x00\x00', b'8965B10040\x00\x00\x00\x00\x00\x00', b'8965B10050\x00\x00\x00\x00\x00\x00', ], (Ecu.fwdRadar, 0x750, 0xf): [ b'8821FF404000 ', + b'8821FF406000 ', b'8821FF407100 ', ], (Ecu.fwdCamera, 0x750, 0x6d): [ b'8646FF404000 ', + b'8646FF406000 ', b'8646FF407000 ', ], }, @@ -644,6 +657,7 @@ class CAR: b'\x01896630ZG5100\x00\x00\x00\x00', b'\x01896630ZG5200\x00\x00\x00\x00', b'\x01896630ZG5300\x00\x00\x00\x00', + b'\x01896630ZP2000\x00\x00\x00\x00', b'\x01896630ZQ5000\x00\x00\x00\x00', b'\x018966312L8000\x00\x00\x00\x00', b'\x018966312P9000\x00\x00\x00\x00', @@ -653,6 +667,7 @@ class CAR: b'\x018966312R1000\x00\x00\x00\x00', b'\x018966312R1100\x00\x00\x00\x00', b'\x018966312R3100\x00\x00\x00\x00', + b'\x018966312S7000\x00\x00\x00\x00', ], (Ecu.engine, 0x7e0, None): [ b'\x0230ZN4000\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00', @@ -667,6 +682,7 @@ class CAR: b'8965B12361\x00\x00\x00\x00\x00\x00', b'\x018965B12350\x00\x00\x00\x00\x00\x00', b'\x018965B12470\x00\x00\x00\x00\x00\x00', + b'\x018965B12490\x00\x00\x00\x00\x00\x00', b'\x018965B12500\x00\x00\x00\x00\x00\x00', b'\x018965B12520\x00\x00\x00\x00\x00\x00', b'\x018965B12530\x00\x00\x00\x00\x00\x00', @@ -675,10 +691,12 @@ class CAR: b'F152602191\x00\x00\x00\x00\x00\x00', b'\x01F152602280\x00\x00\x00\x00\x00\x00', b'\x01F152602560\x00\x00\x00\x00\x00\x00', + b'\x01F152602590\x00\x00\x00\x00\x00\x00', b'\x01F152602650\x00\x00\x00\x00\x00\x00', b'\x01F152612641\x00\x00\x00\x00\x00\x00', b'\x01F152612651\x00\x00\x00\x00\x00\x00', b'\x01F152612B10\x00\x00\x00\x00\x00\x00', + b'\x01F152612B51\x00\x00\x00\x00\x00\x00', b'\x01F152612B60\x00\x00\x00\x00\x00\x00', b'\x01F152612B61\x00\x00\x00\x00\x00\x00', b'\x01F152612B90\x00\x00\x00\x00\x00\x00', @@ -694,8 +712,10 @@ class CAR: b'\x028646F1201100\x00\x00\x00\x008646G26011A0\x00\x00\x00\x00', b'\x028646F1201200\x00\x00\x00\x008646G26011A0\x00\x00\x00\x00', b'\x028646F1201300\x00\x00\x00\x008646G2601400\x00\x00\x00\x00', + b'\x028646F1201400\x00\x00\x00\x008646G2601500\x00\x00\x00\x00', b'\x028646F1202000\x00\x00\x00\x008646G2601200\x00\x00\x00\x00', b'\x028646F1202100\x00\x00\x00\x008646G2601400\x00\x00\x00\x00', + b'\x028646F1202200\x00\x00\x00\x008646G2601500\x00\x00\x00\x00', ], }, CAR.COROLLAH_TSS2: { @@ -721,11 +741,11 @@ class CAR: b'\x018965B12490\x00\x00\x00\x00\x00\x00', # Brazil 2020 Corolla Hybrid FPv2 from berno22 ], (Ecu.esp, 0x7b0, None): [ - b'F152612710\x00\x00\x00\x00\x00\x00', b'F152612590\x00\x00\x00\x00\x00\x00', b'F152612691\x00\x00\x00\x00\x00\x00', b'F152612692\x00\x00\x00\x00\x00\x00', b'F152612700\x00\x00\x00\x00\x00\x00', + b'F152612790\x00\x00\x00\x00\x00\x00', b'F152612800\x00\x00\x00\x00\x00\x00', b'F152612840\x00\x00\x00\x00\x00\x00', b'F152612A10\x00\x00\x00\x00\x00\x00', @@ -742,6 +762,7 @@ class CAR: (Ecu.fwdCamera, 0x750, 0x6d): [ b'\x028646F1201100\x00\x00\x00\x008646G26011A0\x00\x00\x00\x00', b'\x028646F1201300\x00\x00\x00\x008646G2601400\x00\x00\x00\x00', + b'\x028646F1201400\x00\x00\x00\x008646G2601500\x00\x00\x00\x00', b'\x028646F1202000\x00\x00\x00\x008646G2601200\x00\x00\x00\x00', b'\x028646F1202100\x00\x00\x00\x008646G2601400\x00\x00\x00\x00', b'\x028646F4203400\x00\x00\x00\x008646G2601200\x00\x00\x00\x00', @@ -762,6 +783,7 @@ class CAR: b'\x01896630E84000\x00\x00\x00\x00', b'\x01896630E85000\x00\x00\x00\x00', b'\x01896630E88000\x00\x00\x00\x00', + b'\x01896630EA0000\x00\x00\x00\x00', ], (Ecu.eps, 0x7a1, None): [ b'8965B48140\x00\x00\x00\x00\x00\x00', @@ -807,38 +829,53 @@ class CAR: CAR.HIGHLANDER_TSS2: { (Ecu.eps, 0x7a1, None): [ b'8965B48241\x00\x00\x00\x00\x00\x00', + b'8965B48310\x00\x00\x00\x00\x00\x00', ], (Ecu.esp, 0x7b0, None): [ b'\x01F15260E051\x00\x00\x00\x00\x00\x00', + b'\x01F15260E110\x00\x00\x00\x00\x00\x00', ], (Ecu.engine, 0x700, None): [ b'\x01896630E62200\x00\x00\x00\x00', b'\x01896630E64100\x00\x00\x00\x00', b'\x01896630E64200\x00\x00\x00\x00', + b'\x01896630EB1000\x00\x00\x00\x00', + b'\x01896630EB1100\x00\x00\x00\x00', + b'\x01896630EB2000\x00\x00\x00\x00', + b'\x01896630EB2100\x00\x00\x00\x00', + b'\x01896630EB2200\x00\x00\x00\x00', ], (Ecu.fwdRadar, 0x750, 0xf): [ b'\x018821F3301400\x00\x00\x00\x00', + b'\x018821F6201200\x00\x00\x00\x00', ], (Ecu.fwdCamera, 0x750, 0x6d): [ b'\x028646F0E02100\x00\x00\x00\x008646G2601200\x00\x00\x00\x00', + b'\x028646F4803000\x00\x00\x00\x008646G5301200\x00\x00\x00\x00', ], }, CAR.HIGHLANDERH_TSS2: { (Ecu.eps, 0x7a1, None): [ b'8965B48241\x00\x00\x00\x00\x00\x00', + b'8965B48310\x00\x00\x00\x00\x00\x00', ], (Ecu.esp, 0x7b0, None): [ b'\x01F15264872300\x00\x00\x00\x00', b'\x01F15264872400\x00\x00\x00\x00', + b'\x01F15264872500\x00\x00\x00\x00', ], (Ecu.engine, 0x700, None): [ b'\x02896630E66000\x00\x00\x00\x00897CF4801001\x00\x00\x00\x00', + b'\x02896630EB3000\x00\x00\x00\x00897CF4801001\x00\x00\x00\x00', + b'\x02896630EB3100\x00\x00\x00\x00897CF4801001\x00\x00\x00\x00', ], (Ecu.fwdRadar, 0x750, 0xf): [ b'\x018821F3301400\x00\x00\x00\x00', + b'\x018821F6201200\x00\x00\x00\x00', ], (Ecu.fwdCamera, 0x750, 0x6d): [ b'\x028646F0E02100\x00\x00\x00\x008646G2601200\x00\x00\x00\x00', + b'\x028646F4803000\x00\x00\x00\x008646G5301200\x00\x00\x00\x00', ], }, CAR.LEXUS_IS: { @@ -1229,6 +1266,7 @@ class CAR: b'8965B78060\x00\x00\x00\x00\x00\x00', ], (Ecu.fwdRadar, 0x750, 0xf): [ + b'8821F4702100\x00\x00\x00\x00', b'8821F4702300\x00\x00\x00\x00', ], (Ecu.fwdCamera, 0x750, 0x6d): [ @@ -1239,6 +1277,7 @@ class CAR: (Ecu.engine, 0x7e0, None): [ b'\x0237882000\x00\x00\x00\x00\x00\x00\x00\x00A4701000\x00\x00\x00\x00\x00\x00\x00\x00', b'\x0237841000\x00\x00\x00\x00\x00\x00\x00\x00A4701000\x00\x00\x00\x00\x00\x00\x00\x00', + b'\x0237886000\x00\x00\x00\x00\x00\x00\x00\x00A4701000\x00\x00\x00\x00\x00\x00\x00\x00', ], (Ecu.esp, 0x7b0, None): [ b'F152678160\x00\x00\x00\x00\x00\x00', @@ -1347,12 +1386,18 @@ class CAR: }, CAR.LEXUS_RX_TSS2: { (Ecu.engine, 0x700, None): [ + b'\x01896630EC9000\x00\x00\x00\x00', + b'\x01896634D12000\x00\x00\x00\x00', b'\x01896630EB0000\x00\x00\x00\x00', b'\x01896630EA9000\x00\x00\x00\x00', + b'\x01896630ED0000\x00\x00\x00\x00', + b'\x018966348W9000\x00\x00\x00\x00', ], (Ecu.esp, 0x7b0, None): [ + b'\x01F152648801\x00\x00\x00\x00\x00\x00', b'\x01F15260E031\x00\x00\x00\x00\x00\x00', b'\x01F15260E041\x00\x00\x00\x00\x00\x00', + b'\x01F152648781\x00\x00\x00\x00\x00\x00', ], (Ecu.eps, 0x7a1, None): [ b'8965B48271\x00\x00\x00\x00\x00\x00', @@ -1363,6 +1408,7 @@ class CAR: b'\x018821F3301400\x00\x00\x00\x00', ], (Ecu.fwdCamera, 0x750, 0x6d): [ + b'\x028646F4810200\x00\x00\x00\x008646G2601400\x00\x00\x00\x00', b'\x028646F4810100\x00\x00\x00\x008646G2601200\x00\x00\x00\x00', ], }, @@ -1389,8 +1435,10 @@ class CAR: CAR.PRIUS_TSS2: { (Ecu.engine, 0x700, None): [ b'\x038966347C1000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4710101\x00\x00\x00\x00', + b'\x038966347C5000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00897CF4707101\x00\x00\x00\x00', ], (Ecu.esp, 0x7b0, None): [ + b'F152647500\x00\x00\x00\x00\x00\x00', b'F152647520\x00\x00\x00\x00\x00\x00', ], (Ecu.eps, 0x7a1, None): [ From 676fcdc47e4b0be465b9ebe20eaa1e32ff0c7331 Mon Sep 17 00:00:00 2001 From: Arne Schwarck Date: Sun, 11 Apr 2021 21:49:06 +0200 Subject: [PATCH 14/35] Smooth longitudinal tune --- selfdrive/car/toyota/interface.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index a1e16d0c1abd4f..adbd1c66cc09ea 100755 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -476,8 +476,8 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), has_relay=False, ret.longitudinalTuning.deadzoneBP = [0., 9.] ret.longitudinalTuning.deadzoneV = [0., .15] - ret.longitudinalTuning.kpBP = [0., 5., 35.] - ret.longitudinalTuning.kiBP = [0., 35.] + ret.longitudinalTuning.kpBP = [0., 5., 55.] + ret.longitudinalTuning.kiBP = [0., 55.] if ret.enableGasInterceptor: ret.gasMaxBP = [0., 9., 35] @@ -487,8 +487,8 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), has_relay=False, else: ret.gasMaxBP = [0., 9., 55] ret.gasMaxV = [0.2, 0.5, 0.7] - ret.longitudinalTuning.kpV = [0.25, 0.3, 0.25] # braking tune from rav4h - ret.longitudinalTuning.kiV = [0.1, 0.10] + ret.longitudinalTuning.kpV = [0.25, 0.2, 0.1] # braking tune from rav4h + ret.longitudinalTuning.kiV = [0.1, 0.010] return ret From 550979d32daa7b606b1096c5d7b304c3e6d9d42a Mon Sep 17 00:00:00 2001 From: Arne Schwarck Date: Mon, 12 Apr 2021 17:19:32 +0200 Subject: [PATCH 15/35] Smooth lowspeed long --- selfdrive/car/toyota/interface.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index adbd1c66cc09ea..8864808e9f5fab 100755 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -487,8 +487,8 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), has_relay=False, else: ret.gasMaxBP = [0., 9., 55] ret.gasMaxV = [0.2, 0.5, 0.7] - ret.longitudinalTuning.kpV = [0.25, 0.2, 0.1] # braking tune from rav4h - ret.longitudinalTuning.kiV = [0.1, 0.010] + ret.longitudinalTuning.kpV = [0.18, 0.15, 0.1] # braking tune from rav4h + ret.longitudinalTuning.kiV = [0.08, 0.010] return ret From 0f712c271037587802d21e7946f306d69b12b016 Mon Sep 17 00:00:00 2001 From: Arne Schwarck Date: Mon, 12 Apr 2021 18:25:56 +0200 Subject: [PATCH 16/35] Needs more brake at low speeds --- selfdrive/car/toyota/interface.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index 8864808e9f5fab..4d0b612483e741 100755 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -487,8 +487,8 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), has_relay=False, else: ret.gasMaxBP = [0., 9., 55] ret.gasMaxV = [0.2, 0.5, 0.7] - ret.longitudinalTuning.kpV = [0.18, 0.15, 0.1] # braking tune from rav4h - ret.longitudinalTuning.kiV = [0.08, 0.010] + ret.longitudinalTuning.kpV = [0.25, 0.2, 0.05] # braking tune from rav4h + ret.longitudinalTuning.kiV = [0.1, 0.010] return ret From 86fbaf3dff1093689589a25a9df914f1be170751 Mon Sep 17 00:00:00 2001 From: brianandyt Date: Wed, 14 Apr 2021 23:39:09 -0400 Subject: [PATCH 17/35] Wei car --- selfdrive/car/toyota/values.py | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/selfdrive/car/toyota/values.py b/selfdrive/car/toyota/values.py index 54be99b154e756..35c11a65567cd4 100644 --- a/selfdrive/car/toyota/values.py +++ b/selfdrive/car/toyota/values.py @@ -45,7 +45,7 @@ class CAR: LEXUS_ISH = "LEXUS IS300h 2017" LEXUS_GSH = "LEXUS GS450h 2017" LEXUS_NXT = "LEXUS NX200T 2015" - + LEXUS_ESH = "LEXUS ES 300H 2017" # addr: (ecu, cars, bus, 1/freq*100, vl) STATIC_MSGS = [ @@ -1251,6 +1251,28 @@ class CAR: b'\x028646F3303100\x00\x00\x00\x008646G26011A0\x00\x00\x00\x00', b'\x028646F3304100\x00\x00\x00\x008646G2601200\x00\x00\x00\x00', ], + }, + CAR.LEXUS_ESH: { + (Ecu.engine, 0x7e0, None): [ + b'\x02333M4200\x00\x00\x00\x00\x00\x00\x00\x00A4701000\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.esp, 0x7b0, None): [ + b'F152633171\x00\x00\x00\x00\x00\x00', + ], + (Ecu.dsu, 0x791, None): [ + b'881513310400\x00\x00\x00\x00', + ], + (Ecu.eps, 0x7a1, None): [ + b'8965B33512\x00\x00\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x750, 0xf): [ + b'8821F4701100\x00\x00\x00\x00', + b'8821F4701300\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x750, 0x6d): [ + b'8646F3302001\x00\x00\x00\x00', + b'8646F3302200\x00\x00\x00\x00', + ], }, CAR.LEXUS_NX: { (Ecu.engine, 0x700, None): [ @@ -1489,6 +1511,7 @@ class CAR: CAR.LEXUS_ISH: dbc_dict('lexus_is300h_2017_pt_generated', 'toyota_adas'), CAR.LEXUS_GSH: dbc_dict('lexus_is300h_2017_pt_generated', 'toyota_adas'), CAR.LEXUS_NXT: dbc_dict('lexus_nxt_2015_pt_generated', 'toyota_adas'), + CAR.LEXUS_ESH: dbc_dict('lexus_ct200h_2018_pt_generated', 'toyota_adas'), } NO_DSU_CAR = set([CAR.CHR, CAR.CHRH, CAR.CAMRY, CAR.CAMRYH, CAR.RAV4_TSS2, CAR.COROLLA_TSS2, CAR.COROLLAH_TSS2, CAR.LEXUS_ES_TSS2, CAR.LEXUS_ESH_TSS2, CAR.RAV4H_TSS2, CAR.LEXUS_RX_TSS2, CAR.LEXUS_RXH_TSS2, CAR.HIGHLANDER_TSS2, CAR.HIGHLANDERH_TSS2, CAR.LEXUS_NXT, CAR.PRIUS_TSS2]) From 4f61cb2c4cb3e456de793039527b70dc50cc30c7 Mon Sep 17 00:00:00 2001 From: brianandyt Date: Wed, 14 Apr 2021 23:52:28 -0400 Subject: [PATCH 18/35] fix --- selfdrive/car/toyota/values.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/selfdrive/car/toyota/values.py b/selfdrive/car/toyota/values.py index 35c11a65567cd4..a31f3e56c9c624 100644 --- a/selfdrive/car/toyota/values.py +++ b/selfdrive/car/toyota/values.py @@ -50,23 +50,23 @@ class CAR: # addr: (ecu, cars, bus, 1/freq*100, vl) STATIC_MSGS = [ (0x128, Ecu.dsu, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.LEXUS_NXH, CAR.LEXUS_NX, CAR.RAV4, CAR.COROLLA, CAR.AVALON, CAR.AVALON_2021), 1, 3, b'\xf4\x01\x90\x83\x00\x37'), - (0x128, Ecu.dsu, (CAR.HIGHLANDER, CAR.HIGHLANDERH, CAR.SIENNA, CAR.LEXUS_CTH), 1, 3, b'\x03\x00\x20\x00\x00\x52'), - (0x141, Ecu.dsu, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.LEXUS_NXH, CAR.LEXUS_NX, CAR.RAV4, CAR.COROLLA, CAR.HIGHLANDER, CAR.HIGHLANDERH, CAR.AVALON, CAR.AVALON_2021, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_RX), 1, 2, b'\x00\x00\x00\x46'), - (0x160, Ecu.dsu, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.LEXUS_NXH, CAR.LEXUS_NX, CAR.RAV4, CAR.COROLLA, CAR.HIGHLANDER, CAR.HIGHLANDERH, CAR.AVALON, CAR.AVALON_2021, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_RX), 1, 7, b'\x00\x00\x08\x12\x01\x31\x9c\x51'), + (0x128, Ecu.dsu, (CAR.HIGHLANDER, CAR.HIGHLANDERH, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_ESH), 1, 3, b'\x03\x00\x20\x00\x00\x52'), + (0x141, Ecu.dsu, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.LEXUS_NXH, CAR.LEXUS_NX, CAR.RAV4, CAR.COROLLA, CAR.HIGHLANDER, CAR.HIGHLANDERH, CAR.AVALON, CAR.AVALON_2021, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_RX, CAR.LEXUS_ESH ), 1, 2, b'\x00\x00\x00\x46'), + (0x160, Ecu.dsu, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.LEXUS_NXH, CAR.LEXUS_NX, CAR.RAV4, CAR.COROLLA, CAR.HIGHLANDER, CAR.HIGHLANDERH, CAR.AVALON, CAR.AVALON_2021, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_RX, CAR.LEXUS_ESH), 1, 7, b'\x00\x00\x08\x12\x01\x31\x9c\x51'), (0x161, Ecu.dsu, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.LEXUS_NXH, CAR.LEXUS_NX, CAR.RAV4, CAR.COROLLA, CAR.AVALON, CAR.AVALON_2021, CAR.LEXUS_RX), 1, 7, b'\x00\x1e\x00\x00\x00\x80\x07'), - (0X161, Ecu.dsu, (CAR.HIGHLANDERH, CAR.HIGHLANDER, CAR.SIENNA, CAR.LEXUS_CTH), 1, 7, b'\x00\x1e\x00\xd4\x00\x00\x5b'), - (0x283, Ecu.dsu, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.LEXUS_NXH, CAR.LEXUS_NX, CAR.RAV4, CAR.COROLLA, CAR.HIGHLANDER, CAR.HIGHLANDERH, CAR.AVALON, CAR.AVALON_2021, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_RX), 0, 3, b'\x00\x00\x00\x00\x00\x00\x8c'), + (0X161, Ecu.dsu, (CAR.HIGHLANDERH, CAR.HIGHLANDER, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_ESH), 1, 7, b'\x00\x1e\x00\xd4\x00\x00\x5b'), + (0x283, Ecu.dsu, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.LEXUS_NXH, CAR.LEXUS_NX, CAR.RAV4, CAR.COROLLA, CAR.HIGHLANDER, CAR.HIGHLANDERH, CAR.AVALON, CAR.AVALON_2021, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_RX, CAR.LEXUS_ESH), 0, 3, b'\x00\x00\x00\x00\x00\x00\x8c'), (0x2E6, Ecu.dsu, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH), 0, 3, b'\xff\xf8\x00\x08\x7f\xe0\x00\x4e'), (0x2E7, Ecu.dsu, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH), 0, 3, b'\xa8\x9c\x31\x9c\x00\x00\x00\x02'), (0x33E, Ecu.dsu, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH), 0, 20, b'\x0f\xff\x26\x40\x00\x1f\x00'), - (0x344, Ecu.dsu, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.LEXUS_NXH, CAR.LEXUS_NX, CAR.RAV4, CAR.COROLLA, CAR.HIGHLANDER, CAR.HIGHLANDERH, CAR.AVALON, CAR.AVALON_2021, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_RX), 0, 5, b'\x00\x00\x01\x00\x00\x00\x00\x50'), + (0x344, Ecu.dsu, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.LEXUS_NXH, CAR.LEXUS_NX, CAR.RAV4, CAR.COROLLA, CAR.HIGHLANDER, CAR.HIGHLANDERH, CAR.AVALON, CAR.AVALON_2021, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_RX, CAR.LEXUS_ES), 0, 5, b'\x00\x00\x01\x00\x00\x00\x00\x50'), (0x365, Ecu.dsu, (CAR.PRIUS, CAR.LEXUS_RXH, CAR.LEXUS_NXH, CAR.LEXUS_NX, CAR.HIGHLANDERH), 0, 20, b'\x00\x00\x00\x80\x03\x00\x08'), - (0x365, Ecu.dsu, (CAR.RAV4, CAR.RAV4H, CAR.COROLLA, CAR.HIGHLANDER, CAR.AVALON, CAR.AVALON_2021, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_RX), 0, 20, b'\x00\x00\x00\x80\xfc\x00\x08'), + (0x365, Ecu.dsu, (CAR.RAV4, CAR.RAV4H, CAR.COROLLA, CAR.HIGHLANDER, CAR.AVALON, CAR.AVALON_2021, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_RX, CAR.LEXUS_ES), 0, 20, b'\x00\x00\x00\x80\xfc\x00\x08'), (0x366, Ecu.dsu, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.LEXUS_NXH, CAR.LEXUS_NX, CAR.HIGHLANDERH), 0, 20, b'\x00\x00\x4d\x82\x40\x02\x00'), - (0x366, Ecu.dsu, (CAR.RAV4, CAR.COROLLA, CAR.HIGHLANDER, CAR.AVALON, CAR.AVALON_2021, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_RX), 0, 20, b'\x00\x72\x07\xff\x09\xfe\x00'), + (0x366, Ecu.dsu, (CAR.RAV4, CAR.COROLLA, CAR.HIGHLANDER, CAR.AVALON, CAR.AVALON_2021, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_RX, CAR.LEXUS_ES), 0, 20, b'\x00\x72\x07\xff\x09\xfe\x00'), (0x470, Ecu.dsu, (CAR.PRIUS, CAR.LEXUS_RXH), 1, 100, b'\x00\x00\x02\x7a'), - (0x470, Ecu.dsu, (CAR.HIGHLANDER, CAR.HIGHLANDERH, CAR.RAV4H, CAR.SIENNA, CAR.LEXUS_CTH), 1, 100, b'\x00\x00\x01\x79'), - (0x4CB, Ecu.dsu, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.LEXUS_NXH, CAR.LEXUS_NX, CAR.RAV4, CAR.COROLLA, CAR.HIGHLANDERH, CAR.HIGHLANDER, CAR.AVALON, CAR.AVALON_2021, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_RX), 0, 100, b'\x0c\x00\x00\x00\x00\x00\x00\x00'), + (0x470, Ecu.dsu, (CAR.HIGHLANDER, CAR.HIGHLANDERH, CAR.RAV4H, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_ES), 1, 100, b'\x00\x00\x01\x79'), + (0x4CB, Ecu.dsu, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.LEXUS_NXH, CAR.LEXUS_NX, CAR.RAV4, CAR.COROLLA, CAR.HIGHLANDERH, CAR.HIGHLANDER, CAR.AVALON, CAR.AVALON_2021, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_RX, CAR.LEXUS_ES), 0, 100, b'\x0c\x00\x00\x00\x00\x00\x00\x00'), ] ECU_FINGERPRINT = { From bf83b5781893c44aba232e5e029c75ba6ac6a39b Mon Sep 17 00:00:00 2001 From: Arne Schwarck Date: Thu, 15 Apr 2021 07:45:15 +0200 Subject: [PATCH 19/35] Add LEXUS_ESH to non tested cars --- selfdrive/test/test_car_models.py | 1 + 1 file changed, 1 insertion(+) diff --git a/selfdrive/test/test_car_models.py b/selfdrive/test/test_car_models.py index 0b80726ee2973d..9c3d68b7dd2cbc 100755 --- a/selfdrive/test/test_car_models.py +++ b/selfdrive/test/test_car_models.py @@ -519,6 +519,7 @@ def get_route_log(route_name): TOYOTA.LEXUS_NXT, TOYOTA.LEXUS_GSH, TOYOTA.LEXUS_ISH, + TOYOTA.LEXUS_ESH, VOLKSWAGEN.GENERICMQB, #VOLKSWAGEN.GENERICPQ, ] From 9c5fccacaa5b1121dddbe9d92bb451bf580b3c64 Mon Sep 17 00:00:00 2001 From: Arne Schwarck Date: Thu, 15 Apr 2021 08:05:36 +0200 Subject: [PATCH 20/35] Add LEXUS_ESH --- selfdrive/car/toyota/interface.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index 4d0b612483e741..e1a3e32d865d88 100755 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -362,6 +362,16 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), has_relay=False, ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.6], [0.1]] ret.lateralTuning.pid.kfV = [0.00007818594] + elif candidate == CAR.LEXUS_ESH: + stop_and_go = True + ret.safetyParam = 73 + ret.wheelbase = 2.8190 + ret.steerRatio = 16.06 + tire_stiffness_factor = 0.444 # not optimized yet + ret.mass = 3682. * 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 + elif candidate == CAR.SIENNA: stop_and_go = True ret.safetyParam = 73 From ca3160e5795e59f143c1634affa7526a902846dd Mon Sep 17 00:00:00 2001 From: Arne Schwarck Date: Thu, 15 Apr 2021 08:06:52 +0200 Subject: [PATCH 21/35] Fix name for test --- selfdrive/car/toyota/values.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/selfdrive/car/toyota/values.py b/selfdrive/car/toyota/values.py index a31f3e56c9c624..4e62453ca7f599 100644 --- a/selfdrive/car/toyota/values.py +++ b/selfdrive/car/toyota/values.py @@ -45,7 +45,7 @@ class CAR: LEXUS_ISH = "LEXUS IS300h 2017" LEXUS_GSH = "LEXUS GS450h 2017" LEXUS_NXT = "LEXUS NX200T 2015" - LEXUS_ESH = "LEXUS ES 300H 2017" + LEXUS_ESH = "LEXUS ES 300H 2018" # addr: (ecu, cars, bus, 1/freq*100, vl) STATIC_MSGS = [ @@ -334,7 +334,7 @@ class CAR: } # Don't use theses fingerprints for fingerprinting, they are still needed for ECU detection -IGNORED_FINGERPRINTS = [CAR.RAV4H_TSS2, CAR.HIGHLANDERH_TSS2, CAR.LEXUS_RXH_TSS2, CAR.LEXUS_NX] +IGNORED_FINGERPRINTS = [CAR.RAV4H_TSS2, CAR.HIGHLANDERH_TSS2, CAR.LEXUS_RXH_TSS2, CAR.LEXUS_NX, CAR.LEXUS_ESH] FW_VERSIONS = { CAR.AVALON: { From 8a20a249bf0fca980b97bff415ab67de19faa6f1 Mon Sep 17 00:00:00 2001 From: Arne Schwarck Date: Thu, 15 Apr 2021 08:07:37 +0200 Subject: [PATCH 22/35] Add Test for LEXUS_ESH --- selfdrive/test/test_car_models.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/selfdrive/test/test_car_models.py b/selfdrive/test/test_car_models.py index 9c3d68b7dd2cbc..221afb1e483aad 100755 --- a/selfdrive/test/test_car_models.py +++ b/selfdrive/test/test_car_models.py @@ -347,6 +347,11 @@ def get_route_log(route_name): 'enableCamera': True, 'enableDsu': False, }, + "37041c500fd30100|2020-12-30--12-17-24": { + 'carFingerprint': TOYOTA.LEXUS_ESH, + 'enableCamera': True, + 'enableDsu': True, + }, "886fcd8408d570e9|2020-01-29--05-11-22": { 'carFingerprint': TOYOTA.LEXUS_RX, 'enableCamera': True, @@ -519,7 +524,6 @@ def get_route_log(route_name): TOYOTA.LEXUS_NXT, TOYOTA.LEXUS_GSH, TOYOTA.LEXUS_ISH, - TOYOTA.LEXUS_ESH, VOLKSWAGEN.GENERICMQB, #VOLKSWAGEN.GENERICPQ, ] From 0baa50e2de9d1e6b458921bd1b635d8391a4f355 Mon Sep 17 00:00:00 2001 From: Arne Schwarck Date: Thu, 15 Apr 2021 08:10:22 +0200 Subject: [PATCH 23/35] LEXUS_ESH has NO_STOP_TIMER_CAR --- selfdrive/car/toyota/values.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/car/toyota/values.py b/selfdrive/car/toyota/values.py index 4e62453ca7f599..d6a94889afacda 100644 --- a/selfdrive/car/toyota/values.py +++ b/selfdrive/car/toyota/values.py @@ -1516,4 +1516,4 @@ class CAR: NO_DSU_CAR = set([CAR.CHR, CAR.CHRH, CAR.CAMRY, CAR.CAMRYH, CAR.RAV4_TSS2, CAR.COROLLA_TSS2, CAR.COROLLAH_TSS2, CAR.LEXUS_ES_TSS2, CAR.LEXUS_ESH_TSS2, CAR.RAV4H_TSS2, CAR.LEXUS_RX_TSS2, CAR.LEXUS_RXH_TSS2, CAR.HIGHLANDER_TSS2, CAR.HIGHLANDERH_TSS2, CAR.LEXUS_NXT, CAR.PRIUS_TSS2]) TSS2_CAR = set([CAR.RAV4_TSS2, CAR.COROLLA_TSS2, CAR.COROLLAH_TSS2, CAR.LEXUS_ES_TSS2, CAR.LEXUS_ESH_TSS2, CAR.RAV4H_TSS2, CAR.LEXUS_RX_TSS2, CAR.LEXUS_RXH_TSS2, CAR.HIGHLANDER_TSS2, CAR.HIGHLANDERH_TSS2, CAR.PRIUS_TSS2]) -NO_STOP_TIMER_CAR = set([CAR.RAV4H, CAR.HIGHLANDERH, CAR.HIGHLANDER, CAR.RAV4_TSS2, CAR.COROLLA_TSS2, CAR.COROLLAH_TSS2, CAR.LEXUS_ES_TSS2, CAR.LEXUS_ESH_TSS2, CAR.SIENNA, CAR.RAV4H_TSS2, CAR.LEXUS_RX_TSS2, CAR.LEXUS_RXH_TSS2, CAR.HIGHLANDER_TSS2, CAR.HIGHLANDERH_TSS2, CAR.LEXUS_NXT, CAR.PRIUS_TSS2]) # no resume button press required +NO_STOP_TIMER_CAR = set([CAR.RAV4H, CAR.HIGHLANDERH, CAR.HIGHLANDER, CAR.RAV4_TSS2, CAR.COROLLA_TSS2, CAR.COROLLAH_TSS2, CAR.LEXUS_ES_TSS2, CAR.LEXUS_ESH_TSS2, CAR.SIENNA, CAR.RAV4H_TSS2, CAR.LEXUS_RX_TSS2, CAR.LEXUS_RXH_TSS2, CAR.HIGHLANDER_TSS2, CAR.HIGHLANDERH_TSS2, CAR.LEXUS_NXT, CAR.PRIUS_TSS2, CAR.LEXUS_ESH]) # no resume button press required From e6133cffca4a30c90136f6a1ba94b00ca11d51e4 Mon Sep 17 00:00:00 2001 From: Arne Schwarck Date: Thu, 15 Apr 2021 08:14:04 +0200 Subject: [PATCH 24/35] Adjust for oversteer --- selfdrive/car/toyota/interface.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index e1a3e32d865d88..c01d92a97da78f 100755 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -366,7 +366,7 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), has_relay=False, stop_and_go = True ret.safetyParam = 73 ret.wheelbase = 2.8190 - ret.steerRatio = 16.06 + ret.steerRatio = 14.06 tire_stiffness_factor = 0.444 # not optimized yet ret.mass = 3682. * CV.LB_TO_KG + STD_CARGO_KG ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.6], [0.1]] From bd9bd529cbc16154289781416a87a140f8c134d5 Mon Sep 17 00:00:00 2001 From: Arne Schwarck Date: Thu, 15 Apr 2021 08:16:08 +0200 Subject: [PATCH 25/35] Fix typo --- selfdrive/car/toyota/values.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/selfdrive/car/toyota/values.py b/selfdrive/car/toyota/values.py index d6a94889afacda..062b2979acc9b4 100644 --- a/selfdrive/car/toyota/values.py +++ b/selfdrive/car/toyota/values.py @@ -59,14 +59,14 @@ class CAR: (0x2E6, Ecu.dsu, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH), 0, 3, b'\xff\xf8\x00\x08\x7f\xe0\x00\x4e'), (0x2E7, Ecu.dsu, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH), 0, 3, b'\xa8\x9c\x31\x9c\x00\x00\x00\x02'), (0x33E, Ecu.dsu, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH), 0, 20, b'\x0f\xff\x26\x40\x00\x1f\x00'), - (0x344, Ecu.dsu, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.LEXUS_NXH, CAR.LEXUS_NX, CAR.RAV4, CAR.COROLLA, CAR.HIGHLANDER, CAR.HIGHLANDERH, CAR.AVALON, CAR.AVALON_2021, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_RX, CAR.LEXUS_ES), 0, 5, b'\x00\x00\x01\x00\x00\x00\x00\x50'), + (0x344, Ecu.dsu, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.LEXUS_NXH, CAR.LEXUS_NX, CAR.RAV4, CAR.COROLLA, CAR.HIGHLANDER, CAR.HIGHLANDERH, CAR.AVALON, CAR.AVALON_2021, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_RX, CAR.LEXUS_ESH), 0, 5, b'\x00\x00\x01\x00\x00\x00\x00\x50'), (0x365, Ecu.dsu, (CAR.PRIUS, CAR.LEXUS_RXH, CAR.LEXUS_NXH, CAR.LEXUS_NX, CAR.HIGHLANDERH), 0, 20, b'\x00\x00\x00\x80\x03\x00\x08'), - (0x365, Ecu.dsu, (CAR.RAV4, CAR.RAV4H, CAR.COROLLA, CAR.HIGHLANDER, CAR.AVALON, CAR.AVALON_2021, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_RX, CAR.LEXUS_ES), 0, 20, b'\x00\x00\x00\x80\xfc\x00\x08'), + (0x365, Ecu.dsu, (CAR.RAV4, CAR.RAV4H, CAR.COROLLA, CAR.HIGHLANDER, CAR.AVALON, CAR.AVALON_2021, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_RX, CAR.LEXUS_ESH), 0, 20, b'\x00\x00\x00\x80\xfc\x00\x08'), (0x366, Ecu.dsu, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.LEXUS_NXH, CAR.LEXUS_NX, CAR.HIGHLANDERH), 0, 20, b'\x00\x00\x4d\x82\x40\x02\x00'), - (0x366, Ecu.dsu, (CAR.RAV4, CAR.COROLLA, CAR.HIGHLANDER, CAR.AVALON, CAR.AVALON_2021, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_RX, CAR.LEXUS_ES), 0, 20, b'\x00\x72\x07\xff\x09\xfe\x00'), + (0x366, Ecu.dsu, (CAR.RAV4, CAR.COROLLA, CAR.HIGHLANDER, CAR.AVALON, CAR.AVALON_2021, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_RX, CAR.LEXUS_ESH), 0, 20, b'\x00\x72\x07\xff\x09\xfe\x00'), (0x470, Ecu.dsu, (CAR.PRIUS, CAR.LEXUS_RXH), 1, 100, b'\x00\x00\x02\x7a'), - (0x470, Ecu.dsu, (CAR.HIGHLANDER, CAR.HIGHLANDERH, CAR.RAV4H, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_ES), 1, 100, b'\x00\x00\x01\x79'), - (0x4CB, Ecu.dsu, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.LEXUS_NXH, CAR.LEXUS_NX, CAR.RAV4, CAR.COROLLA, CAR.HIGHLANDERH, CAR.HIGHLANDER, CAR.AVALON, CAR.AVALON_2021, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_RX, CAR.LEXUS_ES), 0, 100, b'\x0c\x00\x00\x00\x00\x00\x00\x00'), + (0x470, Ecu.dsu, (CAR.HIGHLANDER, CAR.HIGHLANDERH, CAR.RAV4H, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_ESH), 1, 100, b'\x00\x00\x01\x79'), + (0x4CB, Ecu.dsu, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.LEXUS_NXH, CAR.LEXUS_NX, CAR.RAV4, CAR.COROLLA, CAR.HIGHLANDERH, CAR.HIGHLANDER, CAR.AVALON, CAR.AVALON_2021, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_RX, CAR.LEXUS_ESH), 0, 100, b'\x0c\x00\x00\x00\x00\x00\x00\x00'), ] ECU_FINGERPRINT = { From e6910ea00fb8fa3102f3af77b9027b9aba5b829e Mon Sep 17 00:00:00 2001 From: Arne Schwarck Date: Thu, 15 Apr 2021 21:37:33 +0200 Subject: [PATCH 26/35] Add LEXUS_ESH FPv1 --- selfdrive/car/toyota/values.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/selfdrive/car/toyota/values.py b/selfdrive/car/toyota/values.py index 062b2979acc9b4..207330f189b39a 100644 --- a/selfdrive/car/toyota/values.py +++ b/selfdrive/car/toyota/values.py @@ -277,6 +277,10 @@ class CAR: { 36: 8, 37: 8, 166: 8, 170: 8, 180: 8, 295: 8, 296: 8, 401: 8, 426: 6, 452: 8, 466: 8, 467: 8, 550: 8, 552: 4, 560: 7, 562: 6, 581: 5, 608: 8, 610: 8, 643: 7, 658: 8, 713: 8, 728: 8, 740: 5, 742: 8, 743: 8, 744: 8, 761: 8, 764: 8, 765: 8, 767: 4, 800: 8, 810: 2, 812: 8, 814: 8, 818: 8, 824: 8, 829: 2, 830: 7, 835: 8, 836: 8, 863: 8, 865: 8, 869: 7, 870: 7, 871: 2, 877: 8, 881: 8, 882: 8, 885: 8, 889: 8, 896: 8, 898: 8, 900: 6, 902: 6, 905: 8, 913: 8, 918: 8, 921: 8, 933: 8, 934: 8, 935: 8, 944: 8, 945: 8, 950: 8, 951: 8, 953: 8, 955: 8, 956: 8, 971: 7, 975: 5, 987: 8, 993: 8, 998: 5, 999: 7, 1000: 8, 1001: 8, 1002: 8, 1017: 8, 1020: 8, 1041: 8, 1042: 8, 1056: 8, 1057: 8, 1059: 1, 1071: 8, 1076: 8, 1077: 8, 1082: 8, 1084: 8, 1085: 8, 1086: 8, 1114: 8, 1132: 8, 1161: 8, 1162: 8, 1163: 8, 1164: 8, 1165: 8, 1166: 8, 1167: 8, 1172: 8, 1228: 8, 1235: 8, 1264: 8, 1279: 8, 1541: 8, 1552: 8, 1553: 8, 1556: 8, 1557: 8, 1568: 8, 1570: 8, 1571: 8, 1572: 8, 1575: 8, 1592: 8, 1594: 8, 1595: 8, 1649: 8, 1696: 8, 1775: 8, 1777: 8, 1779: 8, 1786: 8, 1787: 8, 1788: 8, 1789: 8, 1904: 8, 1912: 8, 1990: 8, 1998: 8 }], + CAR.LEXUS_ESH: [ + { + 36: 8, 37: 8, 170: 8, 180: 8, 296: 8, 426: 6, 452: 8, 466: 8, 467: 8, 548: 8, 552: 4, 560: 7, 581: 5, 608: 8, 610: 5, 643: 7, 710: 8, 713: 8, 740: 5, 800: 8, 832: 8, 835: 8, 836: 8, 845: 7, 849: 4, 869: 7, 870: 7, 871: 2, 896: 8, 897: 8, 900: 6, 902: 6, 905: 8, 911: 8, 913: 2, 916: 2, 918: 7, 921: 8, 933: 8, 944: 8, 945: 8, 950: 8, 951: 8, 953: 3, 955: 8, 956: 8, 979: 2, 998: 5, 999: 7, 1000: 8, 1001: 8, 1005: 2, 1014: 8, 1017: 8, 1041: 8, 1042: 8, 1043: 8, 1044: 8, 1056: 8, 1059: 1, 1114: 8, 1161: 8, 1162: 8, 1163: 8, 1164: 8, 1165: 8, 1166: 8, 1167: 8, 1176: 8, 1177: 8, 1178: 8, 1179: 8, 1180: 8, 1181: 8, 1184: 8, 1185: 8, 1186: 8, 1189: 8, 1190: 8, 1191: 8, 1192: 8, 1196: 8, 1197: 8, 1198: 8, 1199: 8, 1206: 8, 1208: 8, 1227: 8, 1232: 8, 1235: 8, 1237: 8, 1279: 8, 1408: 8, 1409: 8, 1410: 8, 1552: 8, 1553: 8, 1554: 8, 1555: 8, 1556: 8, 1557: 8, 1561: 8, 1568: 8, 1569: 8, 1570: 8, 1571: 8, 1572: 8, 1575: 8, 1584: 8, 1589: 8, 1592: 8, 1593: 8, 1595: 8, 1664: 8, 1728: 8, 1779: 8, 1904: 8, 1912: 8, 1990: 8, 1998: 8 + }], CAR.SIENNA: [ { 36: 8, 37: 8, 114: 5, 119: 6, 120: 4, 170: 8, 180: 8, 186: 4, 426: 6, 452: 8, 464: 8, 466: 8, 467: 8, 544: 4, 545: 5, 548: 8, 550: 8, 552: 4, 562: 4, 608: 8, 610: 5, 643: 7, 705: 8, 725: 2, 740: 5, 764: 8, 767: 4, 800: 8, 824: 8, 835: 8, 836: 8, 849: 4, 869: 7, 870: 7, 871: 2, 888: 8, 896: 8, 900: 6, 902: 6, 905: 8, 911: 8, 916: 1, 918: 7, 921: 8, 933: 8, 944: 6, 945: 8, 951: 8, 955: 8, 956: 8, 979: 2, 992: 8, 998: 5, 999: 7, 1000: 8, 1001: 8, 1002: 8, 1008: 2, 1014: 8, 1017: 8, 1041: 8, 1042: 8, 1043: 8, 1056: 8, 1059: 1, 1076: 8, 1077: 8, 1114: 8, 1160: 8, 1161: 8, 1162: 8, 1163: 8, 1164: 8, 1165: 8, 1166: 8, 1167: 8, 1176: 8, 1177: 8, 1178: 8, 1179: 8, 1180: 8, 1181: 8, 1182: 8, 1183: 8, 1191: 8, 1192: 8, 1196: 8, 1197: 8, 1198: 8, 1199: 8, 1200: 8, 1201: 8, 1202: 8, 1203: 8, 1212: 8, 1227: 8, 1228: 8, 1235: 8, 1237: 8, 1279: 8, 1552: 8, 1553: 8, 1555: 8, 1556: 8, 1557: 8, 1561: 8, 1562: 8, 1568: 8, 1569: 8, 1570: 8, 1571: 8, 1572: 8, 1584: 8, 1589: 8, 1592: 8, 1593: 8, 1595: 8, 1656: 8, 1664: 8, 1666: 8, 1667: 8, 1728: 8, 1745: 8, 1779: 8, 1904: 8, 1912: 8, 1990: 8, 1998: 8 From ffd7e598eafe88b23771d5b37cfab58d00042ca6 Mon Sep 17 00:00:00 2001 From: chicman Date: Fri, 16 Apr 2021 06:12:42 +0800 Subject: [PATCH 27/35] Toyota firmware update RAV4_TSS firmware update --- selfdrive/car/toyota/values.py | 1 + 1 file changed, 1 insertion(+) diff --git a/selfdrive/car/toyota/values.py b/selfdrive/car/toyota/values.py index 207330f189b39a..eed5f9dd2bf482 100644 --- a/selfdrive/car/toyota/values.py +++ b/selfdrive/car/toyota/values.py @@ -1080,6 +1080,7 @@ class CAR: b'\x018966342T9000\x00\x00\x00\x00', b'\x018966342U4000\x00\x00\x00\x00', b'\x018966342U4100\x00\x00\x00\x00', + b'\x018966342V3000\x00\x00\x00\x00', b'\x018966342V3100\x00\x00\x00\x00', b'\x018966342V3200\x00\x00\x00\x00', b'\x018966342X5000\x00\x00\x00\x00', From 7e35c938e6d79a827c589d6c79faee7ed90268d4 Mon Sep 17 00:00:00 2001 From: Arne Schwarck Date: Tue, 20 Apr 2021 18:40:01 +0200 Subject: [PATCH 28/35] More kp needed to stop for standing cars --- selfdrive/car/toyota/interface.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index c01d92a97da78f..ed7f5b3cc6b5ad 100755 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -497,8 +497,8 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), has_relay=False, else: ret.gasMaxBP = [0., 9., 55] ret.gasMaxV = [0.2, 0.5, 0.7] - ret.longitudinalTuning.kpV = [0.25, 0.2, 0.05] # braking tune from rav4h - ret.longitudinalTuning.kiV = [0.1, 0.010] + ret.longitudinalTuning.kpV = [0.35, 0.2, 0.05] # braking tune from rav4h + ret.longitudinalTuning.kiV = [0.15, 0.010] return ret From 21f34af17e353db14a79cca7e5dafbb45e22a014 Mon Sep 17 00:00:00 2001 From: Arne Schwarck Date: Tue, 20 Apr 2021 18:44:44 +0200 Subject: [PATCH 29/35] Adjust Lane departure --- selfdrive/controls/controlsd.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index b49f2c78c7ad44..437af46b2df533 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -30,7 +30,7 @@ distance_traveled = op_params.get('distance_traveled') LDW_MIN_SPEED = 31 * CV.MPH_TO_MS -LANE_DEPARTURE_THRESHOLD = 0.1 +LANE_DEPARTURE_THRESHOLD = 0.15 STEER_ANGLE_SATURATION_TIMEOUT = 1.0 / DT_CTRL STEER_ANGLE_SATURATION_THRESHOLD = 2.5 # Degrees @@ -547,8 +547,8 @@ def publish_logs(self, CS, start_time, actuators, v_acc, a_acc, lac_log): self.dp_camera_offset = self.sm['dragonConf'].dpCameraOffset * 0.01 if self.sm['dragonConf'].dpCameraOffset != 0 else 0 l_lane_change_prob = meta.desirePrediction[Desire.laneChangeLeft - 1] r_lane_change_prob = meta.desirePrediction[Desire.laneChangeRight - 1] - l_lane_close = left_lane_visible and (self.sm['pathPlan'].lPoly[3] < (1.08 - self.dp_camera_offset)) - r_lane_close = right_lane_visible and (self.sm['pathPlan'].rPoly[3] > -(1.08 + self.dp_camera_offset)) + l_lane_close = left_lane_visible and (self.sm['pathPlan'].lPoly[3] < (0.8 - self.dp_camera_offset)) + r_lane_close = right_lane_visible and (self.sm['pathPlan'].rPoly[3] > -(0.8 + self.dp_camera_offset)) CC.hudControl.leftLaneDepart = bool(l_lane_change_prob > LANE_DEPARTURE_THRESHOLD and l_lane_close) CC.hudControl.rightLaneDepart = bool(r_lane_change_prob > LANE_DEPARTURE_THRESHOLD and r_lane_close) From c8912ac0040390cdb9c074cf486c95c6a9310a78 Mon Sep 17 00:00:00 2001 From: Arne Schwarck Date: Sat, 24 Apr 2021 13:50:14 +0200 Subject: [PATCH 30/35] Add more LEXUS_NX support --- selfdrive/car/toyota/values.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/selfdrive/car/toyota/values.py b/selfdrive/car/toyota/values.py index eed5f9dd2bf482..fd6d199de904bb 100644 --- a/selfdrive/car/toyota/values.py +++ b/selfdrive/car/toyota/values.py @@ -316,10 +316,10 @@ class CAR: 36: 8, 37: 8, 170: 8, 180: 8, 288: 8, 426: 6, 452: 8, 466: 8, 467: 8, 548: 8, 552: 4, 560: 7, 581: 5, 608: 8, 610: 5, 643: 7, 713: 8, 740: 5, 800: 8, 810: 2, 832: 8, 835: 8, 836: 8, 849: 4, 869: 7, 870: 7, 871: 2, 900: 6, 902: 6, 905: 8, 911: 8, 916: 1, 918: 7, 921: 8, 933: 8, 944: 6, 945: 8, 950: 8, 951: 8, 953: 3, 955: 4, 956: 8, 979: 2, 992: 8, 998: 5, 999: 7, 1000: 8, 1001: 8, 1017: 8, 1041: 8, 1042: 8, 1043: 8, 1056: 8, 1057: 8, 1059: 1, 1076: 8, 1077: 8, 1112: 8, 1114: 8, 1116: 8, 1160: 8, 1161: 8, 1162: 8, 1163: 8, 1164: 8, 1165: 8, 1166: 8, 1167: 8, 1176: 8, 1177: 8, 1178: 8, 1179: 8, 1180: 8, 1181: 8, 1184: 8, 1185: 8, 1186: 8, 1190: 8, 1191: 8, 1192: 8, 1227: 8, 1235: 8, 1279: 8, 1552: 8, 1553: 8, 1554: 8, 1555: 8, 1556: 8, 1557: 8, 1558: 8, 1561: 8, 1562: 8, 1568: 8, 1569: 8, 1570: 8, 1571: 8, 1572: 8, 1575: 8, 1584: 8, 1589: 8, 1592: 8, 1593: 8, 1595: 8, 1664: 8, 1728: 8, 1779: 8 }], CAR.LEXUS_NXH: [{ - 36: 8, 37: 8, 170: 8, 180: 8, 295: 8, 296: 8, 426: 6, 452: 8, 466: 8, 467: 8, 550: 8, 552: 4, 560: 7, 562: 6, 581: 5, 608: 8, 610: 5, 643: 7, 713: 8, 740: 5, 742: 8, 743: 8, 764: 8, 800: 8, 810: 2, 812: 3, 818: 8, 822: 8, 824: 8, 835: 8, 836: 8, 845: 5, 849: 4, 869: 7, 870: 7, 871: 2, 889: 8, 891: 8, 896: 8, 897: 8, 900: 6, 902: 6, 905: 8, 911: 8, 913: 8, 916: 3, 918: 8, 921: 8, 933: 8, 944: 8, 945: 8, 950: 8, 951: 8, 953: 3, 955: 8, 956: 8, 979: 2, 987: 8, 992: 8, 998: 5, 999: 7, 1000: 8, 1001: 8, 1002: 8, 1006: 8, 1014: 8, 1017: 8, 1020: 8, 1041: 8, 1042: 8, 1043: 8, 1056: 8, 1057: 8, 1059: 1, 1076: 8, 1077: 8, 1082: 8, 1114: 8, 1161: 8, 1162: 8, 1163: 8, 1164: 8, 1165: 8, 1166: 8, 1167: 8, 1168: 1, 1176: 8, 1177: 8, 1178: 8, 1179: 8, 1180: 8, 1181: 8, 1184: 8, 1185: 8, 1186: 8, 1189: 8, 1190: 8, 1191: 8, 1192: 8, 1195: 8, 1196: 8, 1197: 8, 1198: 8, 1199: 8, 1206: 8, 1208: 8, 1212: 8, 1227: 8, 1228: 8, 1232: 8, 1235: 8, 1237: 8, 1263: 8, 1264: 8, 1279: 8, 1408: 8, 1409: 8, 1410: 8, 1552: 8, 1553: 8, 1554: 8, 1555: 8, 1556: 8, 1557: 8, 1561: 8, 1568: 8, 1569: 8, 1570: 8, 1571: 8, 1572: 8, 1575: 8, 1584: 8, 1589: 8, 1592: 8, 1593: 8, 1595: 8, 1599: 8, 1656: 8, 1728: 8, 1745: 8, 1777: 8, 1779: 8, 1904: 8, 1912: 8, 1990: 8, 1998: 8 + 36: 8, 37: 8, 170: 8, 180: 8, 295: 8, 296: 8, 355: 5, 426: 6, 452: 8, 466: 8, 467: 8, 550: 8, 552: 4, 560: 7, 562: 6, 581: 5, 608: 8, 610: 5, 643: 7, 713: 8, 740: 5, 742: 8, 743: 8, 764: 8, 767: 4, 800: 8, 810: 2, 812: 3, 818: 8, 822: 8, 824: 8, 835: 8, 836: 8, 845: 5, 849: 4, 869: 7, 870: 7, 871: 2, 889: 8, 891: 8, 896: 8, 897: 8, 900: 6, 902: 6, 905: 8, 911: 8, 913: 8, 916: 3, 918: 8, 921: 8, 933: 8, 944: 8, 945: 8, 950: 8, 951: 8, 953: 3, 955: 8, 956: 8, 979: 2, 987: 8, 992: 8, 998: 5, 999: 7, 1000: 8, 1001: 8, 1002: 8, 1006: 8, 1014: 8, 1017: 8, 1020: 8, 1041: 8, 1042: 8, 1043: 8, 1056: 8, 1057: 8, 1059: 1, 1076: 8, 1077: 8, 1082: 8, 1114: 8, 1161: 8, 1162: 8, 1163: 8, 1164: 8, 1165: 8, 1166: 8, 1167: 8, 1168: 1, 1176: 8, 1177: 8, 1178: 8, 1179: 8, 1180: 8, 1181: 8, 1184: 8, 1185: 8, 1186: 8, 1189: 8, 1190: 8, 1191: 8, 1192: 8, 1195: 8, 1196: 8, 1197: 8, 1198: 8, 1199: 8, 1206: 8, 1208: 8, 1212: 8, 1227: 8, 1228: 8, 1232: 8, 1235: 8, 1237: 8, 1263: 8, 1264: 8, 1279: 8, 1408: 8, 1409: 8, 1410: 8, 1552: 8, 1553: 8, 1554: 8, 1555: 8, 1556: 8, 1557: 8, 1561: 8, 1568: 8, 1569: 8, 1570: 8, 1571: 8, 1572: 8, 1575: 8, 1584: 8, 1589: 8, 1592: 8, 1593: 8, 1595: 8, 1599: 8, 1656: 8, 1728: 8, 1745: 8, 1777: 8, 1779: 8, 1904: 8, 1912: 8, 1990: 8, 1998: 8 }], CAR.LEXUS_NX: [{ - 36: 8, 37: 8, 114: 5, 119: 6, 120: 4, 170: 8, 180: 8, 186: 4, 238: 4, 426: 6, 452: 8, 464: 8, 466: 8, 467: 8, 544: 4, 550: 8, 552: 4, 562: 6, 608: 8, 610: 5, 643: 7, 658: 8, 705: 8, 725: 2, 740: 5, 764: 8, 800: 8, 810: 2, 812: 3, 818: 8, 824: 8, 835: 8, 836: 8, 849: 4, 869: 7, 870: 7, 871: 2, 888: 8, 889: 8, 896: 8, 897: 8, 900: 6, 902: 6, 905: 8, 911: 8, 916: 3, 918: 8, 921: 8, 933: 8, 944: 8, 945: 8, 951: 8, 955: 8, 956: 8, 979: 2, 992: 8, 998: 5, 999: 7, 1000: 8, 1001: 8, 1002: 8, 1006: 8, 1008: 2, 1014: 8, 1017: 8, 1020: 8, 1041: 8, 1042: 8, 1043: 8, 1044: 8, 1056: 8, 1059: 1, 1076: 8, 1077: 8, 1082: 8, 1114: 8, 1161: 8, 1162: 8, 1163: 8, 1164: 8, 1165: 8, 1166: 8, 1167: 8, 1168: 1, 1176: 8, 1177: 8, 1178: 8, 1179: 8, 1180: 8, 1181: 8, 1182: 8, 1183: 8, 1184: 8, 1185: 8, 1186: 8, 1189: 8, 1190: 8, 1191: 8, 1192: 8, 1195: 8, 1196: 8, 1197: 8, 1198: 8, 1199: 8, 1200: 8, 1201: 8, 1202: 8, 1203: 8, 1206: 8, 1208: 8, 1212: 8, 1227: 8, 1228: 8, 1235: 8, 1237: 8, 1264: 8, 1279: 8, 1408: 8, 1409: 8, 1410: 8, 1552: 8, 1553: 8, 1554: 8, 1555: 8, 1556: 8, 1557: 8, 1561: 8, 1568: 8, 1569: 8, 1570: 8, 1571: 8, 1572: 8, 1575: 8, 1584: 8, 1589: 8, 1592: 8, 1593: 8, 1595: 8, 1599: 8, 1656: 8, 1666: 8, 1667: 8, 1728: 8, 1745: 8, 1777: 8, 1779: 8, 1904: 8, 1912: 8, 1990: 8, 1998: 8 + 36: 8, 37: 8, 114: 5, 119: 6, 120: 4, 170: 8, 180: 8, 186: 4, 238: 4, 426: 6, 452: 8, 464: 8, 466: 8, 467: 8, 544: 4, 550: 8, 552: 4, 562: 6, 608: 8, 610: 5, 643: 7, 658: 8, 705: 8, 725: 2, 740: 5, 764: 8, 800: 8, 810: 2, 812: 3, 818: 8, 824: 8, 835: 8, 836: 8, 845: 5, 849: 4, 869: 7, 870: 7, 871: 2, 888: 8, 889: 8, 896: 8, 897: 8, 900: 6, 902: 6, 905: 8, 911: 8, 913: 8, 916: 3, 918: 8, 921: 8, 933: 8, 944: 8, 945: 8, 951: 8, 955: 8, 956: 8, 979: 2, 992: 8, 998: 5, 999: 7, 1000: 8, 1001: 8, 1002: 8, 1006: 8, 1008: 2, 1014: 8, 1017: 8, 1020: 8, 1041: 8, 1042: 8, 1043: 8, 1044: 8, 1056: 8, 1059: 1, 1076: 8, 1077: 8, 1082: 8, 1114: 8, 1161: 8, 1162: 8, 1163: 8, 1164: 8, 1165: 8, 1166: 8, 1167: 8, 1168: 1, 1176: 8, 1177: 8, 1178: 8, 1179: 8, 1180: 8, 1181: 8, 1182: 8, 1183: 8, 1184: 8, 1185: 8, 1186: 8, 1189: 8, 1190: 8, 1191: 8, 1192: 8, 1195: 8, 1196: 8, 1197: 8, 1198: 8, 1199: 8, 1200: 8, 1201: 8, 1202: 8, 1203: 8, 1206: 8, 1208: 8, 1212: 8, 1227: 8, 1228: 8, 1235: 8, 1237: 8, 1264: 8, 1279: 8, 1408: 8, 1409: 8, 1410: 8, 1552: 8, 1553: 8, 1554: 8, 1555: 8, 1556: 8, 1557: 8, 1561: 8, 1568: 8, 1569: 8, 1570: 8, 1571: 8, 1572: 8, 1575: 8, 1584: 8, 1589: 8, 1592: 8, 1593: 8, 1595: 8, 1599: 8, 1656: 8, 1666: 8, 1667: 8, 1728: 8, 1745: 8, 1777: 8, 1779: 8, 1904: 8, 1912: 8, 1990: 8, 1998: 8 }], CAR.PRIUS_TSS2: [{ 36: 8, 37: 8, 166: 8, 170: 8, 180: 8, 295: 8, 296: 8, 401: 8, 426: 6, 452: 8, 466: 8, 467: 8, 550: 8, 552: 4, 560: 7, 562: 6, 581: 5, 608: 8, 610: 8, 614: 8, 643: 7, 658: 8, 713: 8, 740: 5, 742: 8, 743: 8, 764: 8, 765: 8, 800: 8, 810: 2, 814: 8, 824: 8, 829: 2, 830: 7, 835: 8, 836: 8, 863: 8, 865: 8, 869: 7, 870: 7, 871: 2, 877: 8, 881: 8, 882: 8, 896: 8, 898: 8, 900: 6, 902: 6, 905: 8, 918: 8, 921: 8, 933: 8, 934: 8, 935: 8, 944: 8, 945: 8, 950: 8, 951: 8, 953: 8, 955: 8, 956: 8, 971: 7, 975: 5, 993: 8, 998: 5, 999: 7, 1000: 8, 1001: 8, 1002: 8, 1014: 8, 1017: 8, 1020: 8, 1041: 8, 1042: 8, 1044: 8, 1056: 8, 1057: 8, 1059: 1, 1071: 8, 1076: 8, 1077: 8, 1082: 8, 1083: 8, 1084: 8, 1085: 8, 1086: 8, 1114: 8, 1132: 8, 1161: 8, 1162: 8, 1163: 8, 1164: 8, 1165: 8, 1166: 8, 1167: 8, 1172: 8, 1175: 8, 1228: 8, 1235: 8, 1237: 8, 1279: 8, 1541: 8, 1552: 8, 1553: 8, 1556: 8, 1557: 8, 1568: 8, 1570: 8, 1571: 8, 1572: 8, 1592: 8, 1593: 8, 1595: 8, 1649: 8, 1653: 8, 1654: 8, 1655: 8, 1775: 8, 1777: 8, 1779: 8, 1786: 8, 1787: 8, 1788: 8, 1789: 8, 1904: 8, 1912: 8, 1990: 8, 1998: 8 @@ -1282,8 +1282,11 @@ class CAR: CAR.LEXUS_NX: { (Ecu.engine, 0x700, None): [ b'\x01896637851000\x00\x00\x00\x00', + b'\x01896637852000\x00\x00\x00\x00', + b'\x01896637854000\x00\x00\x00\x00', ], (Ecu.esp, 0x7b0, None): [ + b'F152678130\x00\x00\x00\x00\x00\x00', b'F152678140\x00\x00\x00\x00\x00\x00', ], (Ecu.dsu, 0x791, None): [ @@ -1291,6 +1294,7 @@ class CAR: ], (Ecu.eps, 0x7a1, None): [ b'8965B78060\x00\x00\x00\x00\x00\x00', + b'8965B78080\x00\x00\x00\x00\x00\x00', ], (Ecu.fwdRadar, 0x750, 0xf): [ b'8821F4702100\x00\x00\x00\x00', From a63f8321dc34d194d7d546f12c7158f23bc0b5a2 Mon Sep 17 00:00:00 2001 From: Arne Schwarck Date: Sat, 24 Apr 2021 13:51:50 +0200 Subject: [PATCH 31/35] fix LEXUS_NXH FP --- selfdrive/car/toyota/values.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/selfdrive/car/toyota/values.py b/selfdrive/car/toyota/values.py index fd6d199de904bb..b83372823b2fc1 100644 --- a/selfdrive/car/toyota/values.py +++ b/selfdrive/car/toyota/values.py @@ -316,10 +316,10 @@ class CAR: 36: 8, 37: 8, 170: 8, 180: 8, 288: 8, 426: 6, 452: 8, 466: 8, 467: 8, 548: 8, 552: 4, 560: 7, 581: 5, 608: 8, 610: 5, 643: 7, 713: 8, 740: 5, 800: 8, 810: 2, 832: 8, 835: 8, 836: 8, 849: 4, 869: 7, 870: 7, 871: 2, 900: 6, 902: 6, 905: 8, 911: 8, 916: 1, 918: 7, 921: 8, 933: 8, 944: 6, 945: 8, 950: 8, 951: 8, 953: 3, 955: 4, 956: 8, 979: 2, 992: 8, 998: 5, 999: 7, 1000: 8, 1001: 8, 1017: 8, 1041: 8, 1042: 8, 1043: 8, 1056: 8, 1057: 8, 1059: 1, 1076: 8, 1077: 8, 1112: 8, 1114: 8, 1116: 8, 1160: 8, 1161: 8, 1162: 8, 1163: 8, 1164: 8, 1165: 8, 1166: 8, 1167: 8, 1176: 8, 1177: 8, 1178: 8, 1179: 8, 1180: 8, 1181: 8, 1184: 8, 1185: 8, 1186: 8, 1190: 8, 1191: 8, 1192: 8, 1227: 8, 1235: 8, 1279: 8, 1552: 8, 1553: 8, 1554: 8, 1555: 8, 1556: 8, 1557: 8, 1558: 8, 1561: 8, 1562: 8, 1568: 8, 1569: 8, 1570: 8, 1571: 8, 1572: 8, 1575: 8, 1584: 8, 1589: 8, 1592: 8, 1593: 8, 1595: 8, 1664: 8, 1728: 8, 1779: 8 }], CAR.LEXUS_NXH: [{ - 36: 8, 37: 8, 170: 8, 180: 8, 295: 8, 296: 8, 355: 5, 426: 6, 452: 8, 466: 8, 467: 8, 550: 8, 552: 4, 560: 7, 562: 6, 581: 5, 608: 8, 610: 5, 643: 7, 713: 8, 740: 5, 742: 8, 743: 8, 764: 8, 767: 4, 800: 8, 810: 2, 812: 3, 818: 8, 822: 8, 824: 8, 835: 8, 836: 8, 845: 5, 849: 4, 869: 7, 870: 7, 871: 2, 889: 8, 891: 8, 896: 8, 897: 8, 900: 6, 902: 6, 905: 8, 911: 8, 913: 8, 916: 3, 918: 8, 921: 8, 933: 8, 944: 8, 945: 8, 950: 8, 951: 8, 953: 3, 955: 8, 956: 8, 979: 2, 987: 8, 992: 8, 998: 5, 999: 7, 1000: 8, 1001: 8, 1002: 8, 1006: 8, 1014: 8, 1017: 8, 1020: 8, 1041: 8, 1042: 8, 1043: 8, 1056: 8, 1057: 8, 1059: 1, 1076: 8, 1077: 8, 1082: 8, 1114: 8, 1161: 8, 1162: 8, 1163: 8, 1164: 8, 1165: 8, 1166: 8, 1167: 8, 1168: 1, 1176: 8, 1177: 8, 1178: 8, 1179: 8, 1180: 8, 1181: 8, 1184: 8, 1185: 8, 1186: 8, 1189: 8, 1190: 8, 1191: 8, 1192: 8, 1195: 8, 1196: 8, 1197: 8, 1198: 8, 1199: 8, 1206: 8, 1208: 8, 1212: 8, 1227: 8, 1228: 8, 1232: 8, 1235: 8, 1237: 8, 1263: 8, 1264: 8, 1279: 8, 1408: 8, 1409: 8, 1410: 8, 1552: 8, 1553: 8, 1554: 8, 1555: 8, 1556: 8, 1557: 8, 1561: 8, 1568: 8, 1569: 8, 1570: 8, 1571: 8, 1572: 8, 1575: 8, 1584: 8, 1589: 8, 1592: 8, 1593: 8, 1595: 8, 1599: 8, 1656: 8, 1728: 8, 1745: 8, 1777: 8, 1779: 8, 1904: 8, 1912: 8, 1990: 8, 1998: 8 + 36: 8, 37: 8, 170: 8, 180: 8, 295: 8, 296: 8, 426: 6, 452: 8, 466: 8, 467: 8, 550: 8, 552: 4, 560: 7, 562: 6, 581: 5, 608: 8, 610: 5, 643: 7, 713: 8, 740: 5, 742: 8, 743: 8, 764: 8, 800: 8, 810: 2, 812: 3, 818: 8, 822: 8, 824: 8, 835: 8, 836: 8, 845: 5, 849: 4, 869: 7, 870: 7, 871: 2, 889: 8, 891: 8, 896: 8, 897: 8, 900: 6, 902: 6, 905: 8, 911: 8, 913: 8, 916: 3, 918: 8, 921: 8, 933: 8, 944: 8, 945: 8, 950: 8, 951: 8, 953: 3, 955: 8, 956: 8, 979: 2, 987: 8, 992: 8, 998: 5, 999: 7, 1000: 8, 1001: 8, 1002: 8, 1006: 8, 1014: 8, 1017: 8, 1020: 8, 1041: 8, 1042: 8, 1043: 8, 1056: 8, 1057: 8, 1059: 1, 1076: 8, 1077: 8, 1082: 8, 1114: 8, 1161: 8, 1162: 8, 1163: 8, 1164: 8, 1165: 8, 1166: 8, 1167: 8, 1168: 1, 1176: 8, 1177: 8, 1178: 8, 1179: 8, 1180: 8, 1181: 8, 1184: 8, 1185: 8, 1186: 8, 1189: 8, 1190: 8, 1191: 8, 1192: 8, 1195: 8, 1196: 8, 1197: 8, 1198: 8, 1199: 8, 1206: 8, 1208: 8, 1212: 8, 1227: 8, 1228: 8, 1232: 8, 1235: 8, 1237: 8, 1263: 8, 1264: 8, 1279: 8, 1408: 8, 1409: 8, 1410: 8, 1552: 8, 1553: 8, 1554: 8, 1555: 8, 1556: 8, 1557: 8, 1561: 8, 1568: 8, 1569: 8, 1570: 8, 1571: 8, 1572: 8, 1575: 8, 1584: 8, 1589: 8, 1592: 8, 1593: 8, 1595: 8, 1599: 8, 1656: 8, 1728: 8, 1745: 8, 1777: 8, 1779: 8, 1904: 8, 1912: 8, 1990: 8, 1998: 8 }], CAR.LEXUS_NX: [{ - 36: 8, 37: 8, 114: 5, 119: 6, 120: 4, 170: 8, 180: 8, 186: 4, 238: 4, 426: 6, 452: 8, 464: 8, 466: 8, 467: 8, 544: 4, 550: 8, 552: 4, 562: 6, 608: 8, 610: 5, 643: 7, 658: 8, 705: 8, 725: 2, 740: 5, 764: 8, 800: 8, 810: 2, 812: 3, 818: 8, 824: 8, 835: 8, 836: 8, 845: 5, 849: 4, 869: 7, 870: 7, 871: 2, 888: 8, 889: 8, 896: 8, 897: 8, 900: 6, 902: 6, 905: 8, 911: 8, 913: 8, 916: 3, 918: 8, 921: 8, 933: 8, 944: 8, 945: 8, 951: 8, 955: 8, 956: 8, 979: 2, 992: 8, 998: 5, 999: 7, 1000: 8, 1001: 8, 1002: 8, 1006: 8, 1008: 2, 1014: 8, 1017: 8, 1020: 8, 1041: 8, 1042: 8, 1043: 8, 1044: 8, 1056: 8, 1059: 1, 1076: 8, 1077: 8, 1082: 8, 1114: 8, 1161: 8, 1162: 8, 1163: 8, 1164: 8, 1165: 8, 1166: 8, 1167: 8, 1168: 1, 1176: 8, 1177: 8, 1178: 8, 1179: 8, 1180: 8, 1181: 8, 1182: 8, 1183: 8, 1184: 8, 1185: 8, 1186: 8, 1189: 8, 1190: 8, 1191: 8, 1192: 8, 1195: 8, 1196: 8, 1197: 8, 1198: 8, 1199: 8, 1200: 8, 1201: 8, 1202: 8, 1203: 8, 1206: 8, 1208: 8, 1212: 8, 1227: 8, 1228: 8, 1235: 8, 1237: 8, 1264: 8, 1279: 8, 1408: 8, 1409: 8, 1410: 8, 1552: 8, 1553: 8, 1554: 8, 1555: 8, 1556: 8, 1557: 8, 1561: 8, 1568: 8, 1569: 8, 1570: 8, 1571: 8, 1572: 8, 1575: 8, 1584: 8, 1589: 8, 1592: 8, 1593: 8, 1595: 8, 1599: 8, 1656: 8, 1666: 8, 1667: 8, 1728: 8, 1745: 8, 1777: 8, 1779: 8, 1904: 8, 1912: 8, 1990: 8, 1998: 8 + 36: 8, 37: 8, 114: 5, 119: 6, 120: 4, 170: 8, 180: 8, 186: 4, 238: 4, 355: 5, 426: 6, 452: 8, 464: 8, 466: 8, 467: 8, 544: 4, 550: 8, 552: 4, 562: 6, 608: 8, 610: 5, 643: 7, 658: 8, 705: 8, 725: 2, 740: 5, 764: 8, 767: 4, 800: 8, 810: 2, 812: 3, 818: 8, 824: 8, 835: 8, 836: 8, 845: 5, 849: 4, 869: 7, 870: 7, 871: 2, 888: 8, 889: 8, 896: 8, 897: 8, 900: 6, 902: 6, 905: 8, 911: 8, 913: 8, 916: 3, 918: 8, 921: 8, 933: 8, 944: 8, 945: 8, 951: 8, 955: 8, 956: 8, 979: 2, 992: 8, 998: 5, 999: 7, 1000: 8, 1001: 8, 1002: 8, 1006: 8, 1008: 2, 1014: 8, 1017: 8, 1020: 8, 1041: 8, 1042: 8, 1043: 8, 1044: 8, 1056: 8, 1059: 1, 1076: 8, 1077: 8, 1082: 8, 1114: 8, 1161: 8, 1162: 8, 1163: 8, 1164: 8, 1165: 8, 1166: 8, 1167: 8, 1168: 1, 1176: 8, 1177: 8, 1178: 8, 1179: 8, 1180: 8, 1181: 8, 1182: 8, 1183: 8, 1184: 8, 1185: 8, 1186: 8, 1189: 8, 1190: 8, 1191: 8, 1192: 8, 1195: 8, 1196: 8, 1197: 8, 1198: 8, 1199: 8, 1200: 8, 1201: 8, 1202: 8, 1203: 8, 1206: 8, 1208: 8, 1212: 8, 1227: 8, 1228: 8, 1235: 8, 1237: 8, 1264: 8, 1279: 8, 1408: 8, 1409: 8, 1410: 8, 1552: 8, 1553: 8, 1554: 8, 1555: 8, 1556: 8, 1557: 8, 1561: 8, 1568: 8, 1569: 8, 1570: 8, 1571: 8, 1572: 8, 1575: 8, 1584: 8, 1589: 8, 1592: 8, 1593: 8, 1595: 8, 1599: 8, 1656: 8, 1666: 8, 1667: 8, 1728: 8, 1745: 8, 1777: 8, 1779: 8, 1904: 8, 1912: 8, 1990: 8, 1998: 8 }], CAR.PRIUS_TSS2: [{ 36: 8, 37: 8, 166: 8, 170: 8, 180: 8, 295: 8, 296: 8, 401: 8, 426: 6, 452: 8, 466: 8, 467: 8, 550: 8, 552: 4, 560: 7, 562: 6, 581: 5, 608: 8, 610: 8, 614: 8, 643: 7, 658: 8, 713: 8, 740: 5, 742: 8, 743: 8, 764: 8, 765: 8, 800: 8, 810: 2, 814: 8, 824: 8, 829: 2, 830: 7, 835: 8, 836: 8, 863: 8, 865: 8, 869: 7, 870: 7, 871: 2, 877: 8, 881: 8, 882: 8, 896: 8, 898: 8, 900: 6, 902: 6, 905: 8, 918: 8, 921: 8, 933: 8, 934: 8, 935: 8, 944: 8, 945: 8, 950: 8, 951: 8, 953: 8, 955: 8, 956: 8, 971: 7, 975: 5, 993: 8, 998: 5, 999: 7, 1000: 8, 1001: 8, 1002: 8, 1014: 8, 1017: 8, 1020: 8, 1041: 8, 1042: 8, 1044: 8, 1056: 8, 1057: 8, 1059: 1, 1071: 8, 1076: 8, 1077: 8, 1082: 8, 1083: 8, 1084: 8, 1085: 8, 1086: 8, 1114: 8, 1132: 8, 1161: 8, 1162: 8, 1163: 8, 1164: 8, 1165: 8, 1166: 8, 1167: 8, 1172: 8, 1175: 8, 1228: 8, 1235: 8, 1237: 8, 1279: 8, 1541: 8, 1552: 8, 1553: 8, 1556: 8, 1557: 8, 1568: 8, 1570: 8, 1571: 8, 1572: 8, 1592: 8, 1593: 8, 1595: 8, 1649: 8, 1653: 8, 1654: 8, 1655: 8, 1775: 8, 1777: 8, 1779: 8, 1786: 8, 1787: 8, 1788: 8, 1789: 8, 1904: 8, 1912: 8, 1990: 8, 1998: 8 From 28788007af51c54346fcae1cd8954fa92e9e2e56 Mon Sep 17 00:00:00 2001 From: rav4kumar <36933347+rav4kumar@users.noreply.github.com> Date: Sat, 24 Apr 2021 12:28:57 -0700 Subject: [PATCH 32/35] shanes tune . --- selfdrive/car/toyota/interface.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index ed7f5b3cc6b5ad..09b1ddb5933b41 100755 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -150,12 +150,14 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), has_relay=False, stop_and_go = False ret.safetyParam = 88 ret.wheelbase = 2.70 - ret.steerRatio = 18.27 + ret.steerRatio = 17.43 + ret.minSpeedCan = 0.1 * CV.KPH_TO_MS tire_stiffness_factor = 0.444 # not optimized yet ret.mass = 2860. * CV.LB_TO_KG + STD_CARGO_KG # mean between normal and hybrid - ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.2], [0.05]] - ret.lateralTuning.pid.kfV = [0.00006908923778520113] # full torque for 20 deg at 80mph means 0.00007818594 - ret.lateralTuning.pid.newKfTuned = True + ret.lateralTuning.pid.kpBP, ret.lateralTuning.pid.kpV = [[20, 31], [0.05, 0.12]] # 45 to 70 mph + ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kiV = [[20, 31], [0.001, 0.01]] + ret.lateralTuning.pid.kdBP, ret.lateralTuning.pid.kdV = [[20, 31], [0.0, 0.0]] + ret.lateralTuning.pid.kfV = [0.00003] # full torque for 20 deg at 80mph means 0.00007818594 elif candidate == CAR.LEXUS_RX: stop_and_go = True @@ -371,7 +373,7 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), has_relay=False, ret.mass = 3682. * 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 - + elif candidate == CAR.SIENNA: stop_and_go = True ret.safetyParam = 73 From 1366de81939fd2702646185880ab5e4de95832a1 Mon Sep 17 00:00:00 2001 From: chicman Date: Tue, 27 Apr 2021 19:28:50 +0800 Subject: [PATCH 33/35] RAV4 hybrid TSS2 tuning Weight correction. --- selfdrive/car/toyota/interface.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index 09b1ddb5933b41..7f170dad481723 100755 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -304,7 +304,7 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), has_relay=False, ret.steerRatio = 13.7 ret.steerRateCost = 0.3 tire_stiffness_factor = 0.7933 - ret.mass = 3370. * CV.LB_TO_KG + STD_CARGO_KG + ret.mass = 3800. * CV.LB_TO_KG + STD_CARGO_KG ret.longitudinalTuning.deadzoneBP = [0., 8.05] ret.longitudinalTuning.deadzoneV = [.0, .14] ret.longitudinalTuning.kpBP = [0., 5., 20.] From 4aa0874a1b6858db266704c8827001029d4b2ff2 Mon Sep 17 00:00:00 2001 From: Arne Schwarck Date: Tue, 27 Apr 2021 13:36:01 +0200 Subject: [PATCH 34/35] Correct weight --- selfdrive/car/toyota/interface.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index 7f170dad481723..17ffb561ebd0f5 100755 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -120,7 +120,7 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), has_relay=False, ret.wheelbase = 2.65 ret.steerRatio = 13.85 # 14.5 is spec end-to-end tire_stiffness_factor = 0.5533 - ret.mass = 3650. * CV.LB_TO_KG + STD_CARGO_KG # mean between normal and hybrid + ret.mass = 4100. * CV.LB_TO_KG + STD_CARGO_KG # mean between normal and hybrid if ret.enableGasInterceptor: ret.longitudinalTuning.kpV = [0.4, 0.36, 0.325] # arne's tune. ret.longitudinalTuning.kiV = [0.195, 0.10] From 3e531cac2852478d0324c6947fce886da9417d6a Mon Sep 17 00:00:00 2001 From: Arne Schwarck Date: Tue, 27 Apr 2021 13:57:29 +0200 Subject: [PATCH 35/35] Add LEXUS_ISH FPv2 --- selfdrive/car/toyota/values.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/selfdrive/car/toyota/values.py b/selfdrive/car/toyota/values.py index b83372823b2fc1..cb10ca1905a04e 100644 --- a/selfdrive/car/toyota/values.py +++ b/selfdrive/car/toyota/values.py @@ -915,6 +915,26 @@ class CAR: b'8646F5301200\x00\x00\x00\x00', ], }, + CAR.LEXUS_ISH: { + (Ecu.engine, 0x7e0, None): [ + b'\x0232480000\x00\x00\x00\x00\x00\x00\x00\x00A4701000\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.esp, 0x7b0, None): [ + b'F152653310\x00\x00\x00\x00\x00\x00', + ], + (Ecu.dsu, 0x791, None): [ + b'881515307400\x00\x00\x00\x00', + ], + (Ecu.eps, 0x7a1, None): [ + b'8965B53311\x00\x00\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x750, 0xf): [ + b'8821F4702300\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x750, 0x6d): [ + b'8646F5301400\x00\x00\x00\x00', + ], + }, CAR.PRIUS: { (Ecu.engine, 0x700, None): [ b'\x02896634761000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00',