|
|
|
|
@ -504,9 +504,9 @@ class Controls: |
|
|
|
|
self.soft_disable_timer = int(SOFT_DISABLE_TIME / DT_CTRL) |
|
|
|
|
self.current_alert_types.append(ET.SOFT_DISABLE) |
|
|
|
|
|
|
|
|
|
elif self.events.any(ET.OVERRIDE): |
|
|
|
|
elif self.events.any(ET.OVERRIDE_LAT) or self.events.any(ET.OVERRIDE_LONG): |
|
|
|
|
self.state = State.overriding |
|
|
|
|
self.current_alert_types.append(ET.OVERRIDE) |
|
|
|
|
self.current_alert_types += [ET.OVERRIDE_LAT, ET.OVERRIDE_LONG] |
|
|
|
|
|
|
|
|
|
# SOFT DISABLING |
|
|
|
|
elif self.state == State.softDisabling: |
|
|
|
|
@ -536,10 +536,10 @@ class Controls: |
|
|
|
|
self.state = State.softDisabling |
|
|
|
|
self.soft_disable_timer = int(SOFT_DISABLE_TIME / DT_CTRL) |
|
|
|
|
self.current_alert_types.append(ET.SOFT_DISABLE) |
|
|
|
|
elif not self.events.any(ET.OVERRIDE): |
|
|
|
|
elif not (self.events.any(ET.OVERRIDE_LAT) or self.events.any(ET.OVERRIDE_LONG)): |
|
|
|
|
self.state = State.enabled |
|
|
|
|
else: |
|
|
|
|
self.current_alert_types.append(ET.OVERRIDE) |
|
|
|
|
self.current_alert_types += [ET.OVERRIDE_LAT, ET.OVERRIDE_LONG] |
|
|
|
|
|
|
|
|
|
# DISABLED |
|
|
|
|
elif self.state == State.disabled: |
|
|
|
|
@ -550,7 +550,7 @@ class Controls: |
|
|
|
|
else: |
|
|
|
|
if self.events.any(ET.PRE_ENABLE): |
|
|
|
|
self.state = State.preEnabled |
|
|
|
|
elif self.events.any(ET.OVERRIDE): |
|
|
|
|
elif self.events.any(ET.OVERRIDE_LAT) or self.events.any(ET.OVERRIDE_LONG): |
|
|
|
|
self.state = State.overriding |
|
|
|
|
else: |
|
|
|
|
self.state = State.enabled |
|
|
|
|
@ -582,7 +582,7 @@ class Controls: |
|
|
|
|
# Check which actuators can be enabled |
|
|
|
|
CC.latActive = self.active and not CS.steerFaultTemporary and not CS.steerFaultPermanent and \ |
|
|
|
|
CS.vEgo > self.CP.minSteerSpeed and not CS.standstill |
|
|
|
|
CC.longActive = self.active and not self.events.any(ET.OVERRIDE) and self.CP.openpilotLongitudinalControl |
|
|
|
|
CC.longActive = self.active and not self.events.any(ET.OVERRIDE_LONG) and self.CP.openpilotLongitudinalControl |
|
|
|
|
|
|
|
|
|
actuators = CC.actuators |
|
|
|
|
actuators.longControlState = self.LoC.long_control_state |
|
|
|
|
|