mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-08-20 18:03:46 +08:00
gc dead events (#38402)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user