Skip to content

Commit

Permalink
VW PQ: bugfix AWV ramp
Browse files Browse the repository at this point in the history
* AWV_brake was reset every frame, no ramp occured. bug fix?
  • Loading branch information
dkiiv committed Nov 2, 2024
1 parent ac2d0ed commit 227d448
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion selfdrive/car/volkswagen/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,10 @@ def update(self, CC, CS, now_nanos):
if self.CCS == pqcan and CC.longActive and actuators.accel <= 0 and CS.out.vEgoRaw <= 6:
accel = clip(actuators.accel, self.CCP.ACCEL_MIN, 0)
self.AWV_enable = 1
self.AWV_brake = clip(actuators.accel, self.CCP.ACCEL_MIN, 0) * (max(0, (CS.out.vEgo - 0.14) / 3) if self.AWV_halten else 1)
if self.AWV_halten:
self.AWV_brake *= max(0, CS.out.vEgo / 1.5)
else:
self.AWV_brake = clip(actuators.accel, self.CCP.ACCEL_MIN, 0)
else:
accel = clip(actuators.accel, self.CCP.ACCEL_MIN, self.CCP.ACCEL_MAX) if CC.longActive else 0
self.AWV_enable = 0 if CS.out.vEgoRaw >= 6 else self.AWV_enable
Expand Down

0 comments on commit 227d448

Please sign in to comment.