From 4f9eff4db9a849041f62dea6afa94a9b6299a59b Mon Sep 17 00:00:00 2001 From: actuallylemoncurd Date: Mon, 23 Sep 2024 10:55:16 -0400 Subject: [PATCH] VW PQ: update carAPI rateLimit --- selfdrive/car/volkswagen/carcontroller.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/selfdrive/car/volkswagen/carcontroller.py b/selfdrive/car/volkswagen/carcontroller.py index bb98356ed7bc00..5a18afb7804f8a 100644 --- a/selfdrive/car/volkswagen/carcontroller.py +++ b/selfdrive/car/volkswagen/carcontroller.py @@ -31,11 +31,11 @@ def __init__(self, dbc_name, CP, VM): self.last_button_frame = 0 self.accel_last = 0 - self.deviationBP = [-1.25, -0.25, 0., 0.25, 1.25] # accel (m/s squared) - self.deviationV = [0., 0.075, 0.15, 0.075, 0.] # comfort-band (m/s squared) - self.rateLimitBP = [-3., -1.75, -0.25, 0., 0.25, 1.75, 3.] # accel (m/s squared) - self.ratelimitV = [3., 2.50, 0.50, 0.20, 0.50, 1.70, 3.] # jerk-limits (m/s squared) - self.smoothingFactor = 0.15 # closer to 0 = more smoothing, 1 = no smoothing + self.deviationBP = [-1.25, -0.25, 0., 0.25, 1.25] # accel (m/s squared) + self.deviationV = [0., 0.075, 0.15, 0.075, 0.] # comfort-band (m/s squared) + self.rateLimitBP = [-3., -1.75, -1.25, -0.25, 0., 0.25, 1.25, 1.75, 3.] # accel (m/s squared) + self.ratelimitV = [4., 2.50, 1.50, 0.50, 0.20, 0.50, 1.70, 2.3, 3.5] # jerk-limits (m/s squared) + self.smoothingFactor = 0.15 # closer to 0 = more smoothing, 1 = no smoothing self.longDeviation = 0 self.longRateLimit = 0 @@ -157,7 +157,7 @@ def update(self, CC, CS, now_nanos): self.longDeviation = interp(self.smoothed_accel_diff, self.deviationBP, self.deviationV) self.longRateLimit = interp(self.smoothed_accel_diff, self.rateLimitBP, self.ratelimitV) clip(self.longDeviation, self.deviationV[0], self.deviationV[2]) - clip(self.longRateLimit, self.ratelimitV[3], self.ratelimitV[0]) + clip(self.longRateLimit, self.ratelimitV[4], self.ratelimitV[0]) self.accel_last = accel can_sends.extend(self.CCS.create_acc_accel_control(self.packer_pt, CANBUS.pt, CS.acc_type, accel,