From c9b9fd56ea3c55f7e439b155e8e292f628f4ceae Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Tue, 21 Jul 2026 18:49:47 -0700 Subject: [PATCH] gc dead events (#38402) --- openpilot/cereal/log.capnp | 6 ++--- openpilot/selfdrive/selfdrived/events.py | 24 +------------------- openpilot/selfdrive/selfdrived/selfdrived.py | 2 -- 3 files changed, 4 insertions(+), 28 deletions(-) diff --git a/openpilot/cereal/log.capnp b/openpilot/cereal/log.capnp index 60e0bb9010..9f0baf3594 100644 --- a/openpilot/cereal/log.capnp +++ b/openpilot/cereal/log.capnp @@ -75,7 +75,6 @@ struct OnroadEvent @0xc4fa6047f024e718 { driverUnresponsive2 @37; driverUnresponsive3 @38; belowSteerSpeed @39; - lowBattery @40; accFaulted @41; sensorDataInvalid @42; commIssue @43; @@ -107,14 +106,12 @@ struct OnroadEvent @0xc4fa6047f024e718 { noGps @68; wrongCruiseMode @69; modeldLagging @70; - deviceFalling @71; fanMalfunction @72; cameraMalfunction @73; cameraFrameRate @74; processNotRunning @75; dashcamMode @76; selfdriveInitializing @77; - usbError @78; cruiseMismatch @79; canBusMissing @80; selfdrivedLagging @81; @@ -132,7 +129,10 @@ struct OnroadEvent @0xc4fa6047f024e718 { userBookmark @95; excessiveActuation @96; + lowBatteryDEPRECATED @40; soundsUnavailableDEPRECATED @47; + deviceFallingDEPRECATED @71; + usbErrorDEPRECATED @78; audioFeedbackDEPRECATED @97; } } diff --git a/openpilot/selfdrive/selfdrived/events.py b/openpilot/selfdrive/selfdrived/events.py index ee9191fd1e..772b35f7cb 100755 --- a/openpilot/selfdrive/selfdrived/events.py +++ b/openpilot/selfdrive/selfdrived/events.py @@ -392,6 +392,7 @@ def invalid_lkas_setting_alert(CP: car.CarParams, CS: car.CarState, sm: messagin EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { # ********** events with no alerts ********** + EventName.noGps: {}, EventName.stockFcw: {}, EventName.actuatorsApiUnavailable: {}, @@ -779,9 +780,6 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { ET.SOFT_DISABLE: soft_disable_alert("Sensor Data Invalid"), }, - EventName.noGps: { - }, - EventName.tooDistracted: { ET.NO_ENTRY: too_distracted_alert, }, @@ -840,11 +838,6 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { ET.NO_ENTRY: NoEntryAlert("Electronic Stability Control Disabled"), }, - EventName.lowBattery: { - ET.SOFT_DISABLE: soft_disable_alert("Low Battery"), - ET.NO_ENTRY: NoEntryAlert("Low Battery"), - }, - # Different openpilot services communicate between each other at a certain # interval. If communication does not follow the regular schedule this alert # is thrown. This can mean a service crashed, did not broadcast a message for @@ -898,13 +891,6 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { ET.NO_ENTRY: posenet_invalid_alert, }, - # When the localizer detects an acceleration of more than 40 m/s^2 (~4G) we - # alert the driver the device might have fallen from the windshield. - EventName.deviceFalling: { - ET.SOFT_DISABLE: soft_disable_alert("Device Fell Off Mount"), - ET.NO_ENTRY: NoEntryAlert("Device Fell Off Mount"), - }, - EventName.lowMemory: { ET.SOFT_DISABLE: soft_disable_alert("Low Memory: Reboot Your Device"), ET.PERMANENT: low_memory_alert, @@ -927,14 +913,6 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { ET.NO_ENTRY: NoEntryAlert("Controls Mismatch"), }, - # Sometimes the USB stack on the device can get into a bad state - # causing the connection to the panda to be lost - EventName.usbError: { - ET.SOFT_DISABLE: soft_disable_alert("USB Error: Reboot Your Device"), - ET.PERMANENT: NormalPermanentAlert("USB Error: Reboot Your Device"), - ET.NO_ENTRY: NoEntryAlert("USB Error: Reboot Your Device"), - }, - # This alert can be thrown for the following reasons: # - No CAN data received at all # - CAN data is received, but some message are not received at the right frequency diff --git a/openpilot/selfdrive/selfdrived/selfdrived.py b/openpilot/selfdrive/selfdrived/selfdrived.py index 9fed889be3..dd94439b95 100755 --- a/openpilot/selfdrive/selfdrived/selfdrived.py +++ b/openpilot/selfdrive/selfdrived/selfdrived.py @@ -339,8 +339,6 @@ class SelfdriveD: self.events.add(EventName.radarTempUnavailable) elif any(self.sm['radarState'].radarErrors.to_dict().values()): self.events.add(EventName.radarFault) - if not self.sm.valid['pandaStates']: - self.events.add(EventName.usbError) if CS.canTimeout: self.events.add(EventName.canBusMissing) elif not CS.canValid: