Skip to content

Commit

Permalink
VW PQ: try clipping accel_diff to only negative. faster response?
Browse files Browse the repository at this point in the history
  • Loading branch information
dkiiv committed Oct 2, 2024
1 parent 53e3f52 commit 2b4bafe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion selfdrive/car/volkswagen/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2b4bafe

Please sign in to comment.