From 8485cd20135236002cfe45b7ab403bc9b34381b8 Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Tue, 12 Nov 2024 22:00:44 -0500 Subject: [PATCH] make sure it's either or --- selfdrive/controls/controlsd.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index af5953bb23..32e78d4e49 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -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