ICBM: allow button commands at all speeds (#1271)

* ICBM: allow button commands at all speeds

* use openpilot state
This commit is contained in:
Jason Wen
2025-09-20 17:48:13 -04:00
committed by GitHub
parent 569a9216db
commit 2efe78a4ef

View File

@@ -108,9 +108,7 @@ class IntelligentCruiseButtonManagement:
def update_readiness(self, CS: car.CarState, CC: car.CarControl) -> None:
update_manual_button_timers(CS, self.cruise_button_timers)
allowed_speed = CS.vEgo > ALLOWED_SPEED_THRESHOLD
ready = CS.cruiseState.enabled and allowed_speed and not CC.cruiseControl.override and not CC.cruiseControl.cancel and \
not CC.cruiseControl.resume
ready = CC.enabled and not CC.cruiseControl.override and not CC.cruiseControl.cancel and not CC.cruiseControl.resume
button_pressed = any(self.cruise_button_timers[k] > 0 for k in self.cruise_button_timers)
self.is_ready = ready and not button_pressed