Skip to content

Commit

Permalink
VW: check cruise control (#32049)
Browse files Browse the repository at this point in the history
* VW: check cruise control!

* fix that

* fix that

* Update ref_commit
  • Loading branch information
sshane authored Mar 30, 2024
1 parent fb1cb01 commit 493c810
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions selfdrive/car/volkswagen/carstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,15 @@ def update(self, pt_cp, cam_cp, ext_cp, trans_type):
# currently regulating speed (3), driver accel override (4), brake only (5)
ret.cruiseState.available = pt_cp.vl["TSK_06"]["TSK_Status"] in (2, 3, 4, 5)
ret.cruiseState.enabled = pt_cp.vl["TSK_06"]["TSK_Status"] in (3, 4, 5)
# Speed limiter mode; ECM faults if we command ACC while not pcmCruise
ret.cruiseState.nonAdaptive = bool(pt_cp.vl["TSK_06"]["TSK_Limiter_ausgewaehlt"])

if self.CP.pcmCruise:
# Cruise Control mode; check for distance UI setting from the radar.
# ECM does not manage this, so do not need to check for openpilot longitudinal
ret.cruiseState.nonAdaptive = ext_cp.vl["ACC_02"]["ACC_Gesetzte_Zeitluecke"] == 0
else:
# Speed limiter mode; ECM faults if we command ACC while not pcmCruise
ret.cruiseState.nonAdaptive = bool(pt_cp.vl["TSK_06"]["TSK_Limiter_ausgewaehlt"])

ret.accFaulted = pt_cp.vl["TSK_06"]["TSK_Status"] in (6, 7)

self.esp_hold_confirmation = bool(pt_cp.vl["ESP_21"]["ESP_Haltebestaetigung"])
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/test/process_replay/ref_commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
f77699bfd783ab0c9a419f2af883b36aed20cc68
28001018eae89eb4906717bebf892345ad590b5a

0 comments on commit 493c810

Please sign in to comment.