From 833399e9418db26df70169d37c2dff90051d89c7 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Tue, 16 Nov 2021 13:11:32 -0800 Subject: [PATCH] alerts: make soft disables an orange alert (#22925) --- selfdrive/controls/controlsd.py | 4 ++-- selfdrive/controls/lib/events.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index 07b68c941a..bd184f200f 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -404,7 +404,7 @@ class Controls: elif self.CP.pcmCruise and CS.cruiseState.enabled: 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 self.soft_disable_timer = max(0, self.soft_disable_timer - 1) @@ -426,7 +426,7 @@ class Controls: if self.state == State.enabled: if self.events.any(ET.SOFT_DISABLE): 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) # SOFT DISABLING diff --git a/selfdrive/controls/lib/events.py b/selfdrive/controls/lib/events.py index ce30ea7230..e7aa1a470a 100644 --- a/selfdrive/controls/lib/events.py +++ b/selfdrive/controls/lib/events.py @@ -149,7 +149,7 @@ class NoEntryAlert(Alert): class SoftDisableAlert(Alert): def __init__(self, alert_text_2): super().__init__("TAKE CONTROL IMMEDIATELY", alert_text_2, - AlertStatus.critical, AlertSize.full, + AlertStatus.userPrompt, AlertSize.full, Priority.MID, VisualAlert.steerRequired, AudibleAlert.chimeWarningRepeatInfinite, 2.),