From fcf879d783c345ccbf80252de23f649427c35fbd Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Thu, 21 May 2020 16:08:05 -0700 Subject: [PATCH] Add permanent CAN error alert (#1549) * Add permanent CAN error alert * canValid needs some time to initialize * update ref --- selfdrive/controls/controlsd.py | 4 ++-- selfdrive/controls/lib/events.py | 5 +++++ selfdrive/test/process_replay/ref_commit | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index cb7bca7f53..c8ea55088c 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -210,8 +210,8 @@ class Controls: self.events.add(EventName.radarFault) if self.sm['plan'].radarCanError: self.events.add(EventName.radarCanError) - if not CS.canValid: - self.events.add(EventName.canError) + if not CS.canValid and self.sm.frame > 5 / DT_CTRL: + self.events.add(EventName.canError) if log.HealthData.FaultType.relayMalfunction in self.sm['health'].faults: self.events.add(EventName.relayMalfunction) if self.sm['plan'].fcw: diff --git a/selfdrive/controls/lib/events.py b/selfdrive/controls/lib/events.py index 4693f0c9cc..0202119337 100644 --- a/selfdrive/controls/lib/events.py +++ b/selfdrive/controls/lib/events.py @@ -607,6 +607,11 @@ EVENTS = { EventName.canError: { ET.IMMEDIATE_DISABLE: ImmediateDisableAlert("CAN Error: Check Connections"), ET.NO_ENTRY: NoEntryAlert("CAN Error: Check Connections"), + ET.PERMANENT: Alert( + "CAN Error: Check Connections", + "", + AlertStatus.normal, AlertSize.small, + Priority.LOW, VisualAlert.none, AudibleAlert.none, 0., 0., .2), }, EventName.steerUnavailable: { diff --git a/selfdrive/test/process_replay/ref_commit b/selfdrive/test/process_replay/ref_commit index baaafb0f8d..012e6ca16c 100644 --- a/selfdrive/test/process_replay/ref_commit +++ b/selfdrive/test/process_replay/ref_commit @@ -1 +1 @@ -59bd32350139796784708f51c233d37c18f33e6e \ No newline at end of file +dadb4f96017c4f6b36fd829c41315b0a7f31c8e5 \ No newline at end of file