lateral overriding is overriding

pull/25617/head
Shane Smiskol 3 years ago
parent c6b749fb96
commit 7346bda6f0
  1. 2
      cereal
  2. 2
      selfdrive/car/interfaces.py
  3. 12
      selfdrive/controls/controlsd.py
  4. 13
      selfdrive/controls/lib/events.py

@ -1 +1 @@
Subproject commit c4cc38c4689b5e06be1cbfbb26c0463c377c0a6d
Subproject commit 8f9885b9726cd2784db6886dd4ce01688b5ba732

@ -212,6 +212,8 @@ class CarInterfaceBase(ABC):
events.add(EventName.parkBrake)
if cs_out.accFaulted:
events.add(EventName.accFaulted)
if cs_out.steeringPressed:
events.add(EventName.steerOverride)
# Handle button presses
events.events.extend(create_button_enable_events(cs_out.buttonEvents, pcm_cruise=self.CP.pcmCruise))

@ -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

@ -31,7 +31,8 @@ class Priority(IntEnum):
class ET:
ENABLE = 'enable'
PRE_ENABLE = 'preEnable'
OVERRIDE = 'override'
OVERRIDE_LAT = 'overrideLat'
OVERRIDE_LONG = 'overrideLong'
NO_ENTRY = 'noEntry'
WARNING = 'warning'
USER_DISABLE = 'userDisable'
@ -623,7 +624,15 @@ EVENTS: Dict[int, Dict[str, Union[Alert, AlertCallbackType]]] = {
},
EventName.gasPressedOverride: {
ET.OVERRIDE: Alert(
ET.OVERRIDE_LONG: Alert(
"",
"",
AlertStatus.normal, AlertSize.none,
Priority.LOWEST, VisualAlert.none, AudibleAlert.none, .1),
},
EventName.steerOverride: {
ET.OVERRIDE_LAT: Alert(
"",
"",
AlertStatus.normal, AlertSize.none,

Loading…
Cancel
Save