From 3f76785dd48ab9484b387dd207296d509b588b8e Mon Sep 17 00:00:00 2001 From: Rick Lan Date: Tue, 25 Jun 2024 22:04:04 +0800 Subject: [PATCH] Toyota PCM Compensation tune and bugfixes * Do not reset long mpc weight (perform better) * Lower stopAccel for quicker response for TSS2. --- selfdrive/car/toyota/interface.py | 13 ++++++------- selfdrive/controls/lib/longitudinal_planner.py | 4 ---- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index 8fe247638..d9d7541fa 100644 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -148,15 +148,14 @@ class CarInterface(CarInterfaceBase): # dp if Params().get_bool("dp_toyota_pcm_compensation"): # on stock Toyota this is -2.5 - ret.stopAccel = -2.5 + if candidate in TSS2_CAR: + ret.stopAccel = -1.2 + else: + ret.stopAccel = -2.5 - tune.deadzoneBP = [0., 16., 20., 30.] - tune.deadzoneV = [.04, .05, .08, .15] ret.stoppingDecelRate = 0.17 - tune.kpBP = [0., 5.] - tune.kpV = [0.8, 1.] - tune.kiBP = [0., 5.] - tune.kiV = [0.3, 1.] + tune.kpV = [0.] + tune.kiV = [0.5] elif candidate in TSS2_CAR: tune.kpV = [0.0] tune.kiV = [0.5] diff --git a/selfdrive/controls/lib/longitudinal_planner.py b/selfdrive/controls/lib/longitudinal_planner.py index 00d526139..9a9a4370f 100755 --- a/selfdrive/controls/lib/longitudinal_planner.py +++ b/selfdrive/controls/lib/longitudinal_planner.py @@ -136,10 +136,6 @@ class LongitudinalPlanner: # Reset current state when not engaged, or user is controlling the speed reset_state = long_control_off if self.CP.openpilotLongitudinalControl else not sm['controlsState'].enabled - # dp - if not reset_state: - reset_state = self._dynamic_endtoend_controller.has_changed() - # No change cost when user is controlling the speed, or when standstill prev_accel_constraint = not (reset_state or sm['carState'].standstill)