Skip to content

Commit 29e2b3f

Browse files
controlsd: ensure all system malfunction events have the right types (#24635)
old-commit-hash: 71901c9
1 parent 00f7f96 commit 29e2b3f

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

selfdrive/controls/controlsd.py

+1
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ def update_events(self, CS):
294294

295295
# Handle HW and system malfunctions
296296
# Order is very intentional here. Be careful when modifying this.
297+
# All events here should at least have NO_ENTRY and SOFT_DISABLE.
297298
num_events = len(self.events)
298299

299300
not_running = {p.name for p in self.sm['managerState'].processes if not p.running and p.shouldBeRunning}

selfdrive/controls/lib/events.py

+5
Original file line numberDiff line numberDiff line change
@@ -558,10 +558,14 @@ def joystick_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubMaster,
558558
# Camera is not outputting frames
559559
EventName.cameraMalfunction: {
560560
ET.PERMANENT: camera_malfunction_alert,
561+
ET.SOFT_DISABLE: soft_disable_alert("Camera Malfunction"),
562+
ET.NO_ENTRY: NoEntryAlert("Camera Malfunction: Reboot Your Device"),
561563
},
562564
# Camera framerate too low
563565
EventName.cameraFrameRate: {
564566
ET.PERMANENT: NormalPermanentAlert("Camera Frame Rate Low", "Reboot your Device"),
567+
ET.SOFT_DISABLE: soft_disable_alert("Camera Frame Rate Low"),
568+
ET.NO_ENTRY: NoEntryAlert("Camera Frame Rate Low: Reboot Your Device"),
565569
},
566570

567571
# Unused
@@ -741,6 +745,7 @@ def joystick_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubMaster,
741745
# Thrown when manager detects a service exited unexpectedly while driving
742746
EventName.processNotRunning: {
743747
ET.NO_ENTRY: process_not_running_alert,
748+
ET.SOFT_DISABLE: soft_disable_alert("Process Not Running"),
744749
},
745750

746751
EventName.radarFault: {

0 commit comments

Comments
 (0)