alerts: make soft disables an orange alert (#22925)

pull/22935/head
Adeeb Shihadeh 3 years ago committed by GitHub
parent 10bca095c2
commit 833399e941
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      selfdrive/controls/controlsd.py
  2. 2
      selfdrive/controls/lib/events.py

@ -404,7 +404,7 @@ class Controls:
elif self.CP.pcmCruise and CS.cruiseState.enabled: elif self.CP.pcmCruise and CS.cruiseState.enabled:
self.v_cruise_kph = CS.cruiseState.speed * CV.MS_TO_KPH self.v_cruise_kph = CS.cruiseState.speed * CV.MS_TO_KPH
# decrease the soft disable timer at every step, as it's reset on # decrement the soft disable timer at every step, as it's reset on
# entrance in SOFT_DISABLING state # entrance in SOFT_DISABLING state
self.soft_disable_timer = max(0, self.soft_disable_timer - 1) self.soft_disable_timer = max(0, self.soft_disable_timer - 1)
@ -426,7 +426,7 @@ class Controls:
if self.state == State.enabled: if self.state == State.enabled:
if self.events.any(ET.SOFT_DISABLE): if self.events.any(ET.SOFT_DISABLE):
self.state = State.softDisabling self.state = State.softDisabling
self.soft_disable_timer = 300 # 3s self.soft_disable_timer = int(3 / DT_CTRL)
self.current_alert_types.append(ET.SOFT_DISABLE) self.current_alert_types.append(ET.SOFT_DISABLE)
# SOFT DISABLING # SOFT DISABLING

@ -149,7 +149,7 @@ class NoEntryAlert(Alert):
class SoftDisableAlert(Alert): class SoftDisableAlert(Alert):
def __init__(self, alert_text_2): def __init__(self, alert_text_2):
super().__init__("TAKE CONTROL IMMEDIATELY", alert_text_2, super().__init__("TAKE CONTROL IMMEDIATELY", alert_text_2,
AlertStatus.critical, AlertSize.full, AlertStatus.userPrompt, AlertSize.full,
Priority.MID, VisualAlert.steerRequired, Priority.MID, VisualAlert.steerRequired,
AudibleAlert.chimeWarningRepeatInfinite, 2.), AudibleAlert.chimeWarningRepeatInfinite, 2.),

Loading…
Cancel
Save