From acb894a678e4207d5ab3eeb1a8d69a36e719a407 Mon Sep 17 00:00:00 2001 From: rav4kumar Date: Mon, 2 Sep 2024 20:03:09 -0700 Subject: [PATCH] reset --- selfdrive/car/toyota/carcontroller.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/selfdrive/car/toyota/carcontroller.py b/selfdrive/car/toyota/carcontroller.py index 1a32c31bd6..d5ea3a6d3e 100644 --- a/selfdrive/car/toyota/carcontroller.py +++ b/selfdrive/car/toyota/carcontroller.py @@ -172,7 +172,7 @@ class CarController(CarControllerBase): self.pcm_accel_comp = 0.0 # You can uncomment these lines as needed - # pcm_accel_cmd = actuators.accel + self.pcm_accel_comp # + offset + pcm_accel_cmd = actuators.accel + self.pcm_accel_comp # + offset # pcm_accel_cmd = actuators.accel - pitch_offset # In case CC.longActive is False @@ -198,7 +198,10 @@ class CarController(CarControllerBase): interceptor_gas_cmd = clip(pedal_command, 0., MAX_INTERCEPTOR_GAS) else: interceptor_gas_cmd = 0. - pcm_accel_cmd = clip(actuators.accel + self.pcm_accel_comp, self.params.ACCEL_MIN, self.params.ACCEL_MAX) + if not sp_tss2_long_tune: + pcm_accel_cmd = clip(pcm_accel_cmd, self.params.ACCEL_MIN, self.params.ACCEL_MAX) + else: + pcm_accel_cmd = clip(actuators.accel, self.params.ACCEL_MIN, self.params.ACCEL_MAX) # TODO: probably can delete this. CS.pcm_acc_status uses a different signal # than CS.cruiseState.enabled. confirm they're not meaningfully different