make sure it's either or

This commit is contained in:
Jason Wen
2024-11-12 22:00:44 -05:00
parent 0fa1ff07f5
commit 8485cd2013
+3 -2
View File
@@ -91,8 +91,9 @@ class Controls:
# Check which actuators can be enabled
standstill = abs(CS.vEgo) <= max(self.CP.minSteerSpeed, MIN_LATERAL_CONTROL_SPEED) or CS.standstill
CC.latActive = self.sm['selfdriveState'].active and not CS.steerFaultTemporary and not CS.steerFaultPermanent and not standstill
CC.latActive = CC.latActive or (self.sm['selfdriveStateSP'].mads.enabled and self.sm['selfdriveStateSP'].mads.available)
_lat_active = self.sm['selfdriveState'].active or (self.sm['selfdriveStateSP'].mads.available and self.sm['selfdriveStateSP'].mads.enabled)
CC.latActive = _lat_active and not CS.steerFaultTemporary and not CS.steerFaultPermanent and not standstill
CC.longActive = CC.enabled and not any(e.overrideLongitudinal for e in self.sm['onroadEvents']) and self.CP.openpilotLongitudinalControl
actuators = CC.actuators