Skip to content

Commit

Permalink
VW PQ: bugfixing AWV controls
Browse files Browse the repository at this point in the history
* make halten latch
* fix ramping?
  • Loading branch information
dkiiv committed Nov 2, 2024
1 parent 978d14b commit e980ccd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions selfdrive/car/volkswagen/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,17 @@ def update(self, CC, CS, now_nanos):
accel = clip(actuators.accel, self.CCP.ACCEL_MIN, 0)
self.AWV_enable = 1
if self.AWV_halten:
self.AWV_brake *= max(0, CS.out.vEgo / 1.5)
self.AWV_brake = min(self.AWV_brake + abs(self.AWV_brake) / 7, 0)
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
self.AWV_brake = 0
self.AWV_halten = 1 if CS.out.vEgoRaw <= 3 and self.AWV_enable else 0
if self.AWV_enable and CS.out.vEgoRaw <= 3:
self.AWV_halten = 1
elif CS.out.vEgoRaw >= 4 or not self.AWV_enable:
self.AWV_halten = 0
self.long_deviation = 0 # TODO: make dynamic again
self.long_ratelimit = 4 # TODO: make dynamic again

Expand Down

0 comments on commit e980ccd

Please sign in to comment.