Skip to content

Commit

Permalink
alerts: make soft disables an orange alert (#22925)
Browse files Browse the repository at this point in the history
  • Loading branch information
adeebshihadeh authored Nov 16, 2021
1 parent 10bca09 commit 833399e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions selfdrive/controls/controlsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ def state_transition(self, CS):
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)

Expand All @@ -426,7 +426,7 @@ def state_transition(self, CS):
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
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/controls/lib/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def __init__(self, alert_text_2, audible_alert=AudibleAlert.chimeError,
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.),

Expand Down

0 comments on commit 833399e

Please sign in to comment.