diff --git a/selfdrive/car/volkswagen/carstate.py b/selfdrive/car/volkswagen/carstate.py index 9107d41eb3c085..8139fbbf217961 100644 --- a/selfdrive/car/volkswagen/carstate.py +++ b/selfdrive/car/volkswagen/carstate.py @@ -114,21 +114,15 @@ def update(self, pt_cp, cam_cp, ext_cp, trans_type): # Update ACC radar status. self.acc_type = ext_cp.vl["ACC_06"]["ACC_Typ"] - 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 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 - else: - # ACC okay but disabled (1), or a radar visibility or other fault/disruption (6 or 7) - ret.cruiseState.available = False - ret.cruiseState.enabled = False + + # ACC okay but disabled (1), ACC ready (2), a radar visibility or other fault/disruption (6 or 7) + # 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) + ret.accFaulted = pt_cp.vl["TSK_06"]["TSK_Status"] in (6, 7) + self.esp_hold_confirmation = bool(pt_cp.vl["ESP_21"]["ESP_Haltebestaetigung"]) ret.cruiseState.standstill = self.CP.pcmCruise and self.esp_hold_confirmation - ret.accFaulted = pt_cp.vl["TSK_06"]["TSK_Status"] in (6, 7) # Update ACC setpoint. When the setpoint is zero or there's an error, the # radar sends a set-speed of ~90.69 m/s / 203mph.