From 2b4bafe347153aab5b61a607b64878aaccba7d5f Mon Sep 17 00:00:00 2001 From: actuallylemoncurd Date: Tue, 1 Oct 2024 20:34:35 -0400 Subject: [PATCH] VW PQ: try clipping accel_diff to only negative. faster response? --- selfdrive/car/volkswagen/carcontroller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/car/volkswagen/carcontroller.py b/selfdrive/car/volkswagen/carcontroller.py index bc8f4f1a19f707..49d5fe2425e91f 100644 --- a/selfdrive/car/volkswagen/carcontroller.py +++ b/selfdrive/car/volkswagen/carcontroller.py @@ -152,7 +152,7 @@ def update(self, CC, CS, now_nanos): accel = clip(actuators.accel, self.CCP.ACCEL_MIN, self.CCP.ACCEL_MAX) if CC.longActive else 0 stopping = actuators.longControlState == LongCtrlState.stopping starting = actuators.longControlState == LongCtrlState.pid and (CS.esp_hold_confirmation or CS.out.vEgo < self.CP.vEgoStopping) - accel_diff = (accel - self.accel_last) * 50 + accel_diff = (accel - self.accel_last) * 50 if accel - self.accel_last <= 0 else 0 self.accel_diff_smoothed = (self.longSignalSmooth * accel_diff) + (1 - self.longSignalSmooth) * getattr(self, 'accel_diff_smoothed', 0) deviation_lookup = interp(self.accel_diff_smoothed, self.deviationBP, self.deviationV) ratelimit_lookup = interp(self.accel_diff_smoothed, self.rateLimitBP, self.ratelimitV)