From a47666d1fd7d0babb0ba39ec986d0b7a04d82984 Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Wed, 6 Apr 2022 17:11:39 -0700 Subject: [PATCH] add cameraFrameRate alert (#24152) * add cameraFrameRate alert * bump cereal old-commit-hash: 1848050fd980a04dfc70454547ab7b52affe2917 --- cereal | 2 +- selfdrive/controls/controlsd.py | 3 +-- selfdrive/controls/lib/events.py | 6 +++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/cereal b/cereal index 1620ce54ee..24c34d7bc0 160000 --- a/cereal +++ b/cereal @@ -1 +1 @@ -Subproject commit 1620ce54ee878069f68a023ee12c6a9a7d7e29c7 +Subproject commit 24c34d7bc037d01da254a9b423f246a950bec317 diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index 198ee08b3e..d15626d3c3 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -356,11 +356,10 @@ class Controls: # Not show in first 1 km to allow for driving out of garage. This event shows after 5 minutes self.events.add(EventName.noGps) - # TODO: split into separate alerts if not self.sm.all_alive(self.camera_packets): self.events.add(EventName.cameraMalfunction) elif not self.sm.all_freq_ok(self.camera_packets): - self.events.add(EventName.cameraMalfunction) + self.events.add(EventName.cameraFrameRate) if self.sm['modelV2'].frameDropPerc > 20: self.events.add(EventName.modeldLagging) diff --git a/selfdrive/controls/lib/events.py b/selfdrive/controls/lib/events.py index 54ca53d7ec..625fc32a33 100644 --- a/selfdrive/controls/lib/events.py +++ b/selfdrive/controls/lib/events.py @@ -491,10 +491,14 @@ EVENTS: Dict[int, Dict[str, Union[Alert, AlertCallbackType]]] = { ET.PERMANENT: NormalPermanentAlert("Fan Malfunction", "Likely Hardware Issue"), }, - # Camera is not outputting frames at a constant framerate + # Camera is not outputting frames EventName.cameraMalfunction: { ET.PERMANENT: NormalPermanentAlert("Camera Malfunction", "Likely Hardware Issue"), }, + # Camera framerate too low + EventName.cameraFrameRate: { + ET.PERMANENT: NormalPermanentAlert("Camera Frame Rate Low", "Reboot your Device"), + }, # Unused EventName.gpsMalfunction: {