diff reduction

mqb-long
Jason Young 3 years ago
parent 45d9a43b1d
commit f88dba5b20
  1. 6
      selfdrive/car/volkswagen/carstate.py

@ -107,12 +107,11 @@ class CarState(CarStateBase):
# Update ACC radar status.
self.acc_type = ext_cp.vl["ACC_06"]["ACC_Typ"]
self.tsk_status = pt_cp.vl["TSK_06"]["TSK_Status"]
if self.tsk_status == 2:
if pt_cp.vl["TSK_06"]["TSK_Status"] == 2:
# ACC okay and enabled, but not currently engaged
ret.cruiseState.available = True
ret.cruiseState.enabled = False
elif self.tsk_status in (3, 4, 5):
elif pt_cp.vl["TSK_06"]["TSK_Status"] in (3, 4, 5):
# ACC okay and enabled, currently regulating speed (3) or driver accel override (4) or brake only (5)
ret.cruiseState.available = True
ret.cruiseState.enabled = True
@ -120,6 +119,7 @@ class CarState(CarStateBase):
# ACC okay but disabled (1), or a radar visibility or other fault/disruption (6 or 7)
ret.cruiseState.available = False
ret.cruiseState.enabled = False
ret.accFaulted = True
ret.cruiseState.standstill = bool(pt_cp.vl["ESP_21"]["ESP_Haltebestaetigung"])
ret.accFaulted = pt_cp.vl["TSK_06"]["TSK_Status"] in (6, 7)

Loading…
Cancel
Save