From 17fc7e2bece1adb177428e42a70e739773ea53f8 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh <8762862+adeebshihadeh@users.noreply.github.com> Date: Sun, 28 Jun 2020 20:29:42 -0700 Subject: [PATCH] Add alert while in preEnabled state (#1791) old-commit-hash: ce80684f7ec6a61d8e4f08471611a30562707154 --- selfdrive/controls/controlsd.py | 2 ++ selfdrive/controls/lib/events.py | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index 86f6ff0f56..731e8968d1 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -316,6 +316,8 @@ class Controls: elif self.state == State.preEnabled: if not self.events.any(ET.PRE_ENABLE): self.state = State.enabled + else: + self.current_alert_types.append(ET.PRE_ENABLE) # DISABLED elif self.state == State.disabled: diff --git a/selfdrive/controls/lib/events.py b/selfdrive/controls/lib/events.py index f49a0c2fdd..cffff8b7c1 100644 --- a/selfdrive/controls/lib/events.py +++ b/selfdrive/controls/lib/events.py @@ -204,8 +204,6 @@ def wrong_car_mode_alert(CP, sm, metric): EVENTS = { # ********** events with no alerts ********** - EventName.gasPressed: {ET.PRE_ENABLE: None}, - # ********** events only containing alerts displayed in all states ********** EventName.debugAlert: { @@ -333,6 +331,14 @@ EVENTS = { # ********** events only containing alerts that display while engaged ********** + EventName.gasPressed: { + ET.PRE_ENABLE: Alert( + "openpilot will not brake while gas pressed", + "", + AlertStatus.normal, AlertSize.small, + Priority.LOWEST, VisualAlert.none, AudibleAlert.none, .0, .0, .1), + }, + EventName.vehicleModelInvalid: { ET.WARNING: Alert( "Vehicle Parameter Identification Failed",