Update selfdrived.py radar disable failure calls

This commit is contained in:
infiniteCable2
2025-12-13 10:00:32 +01:00
committed by GitHub
parent a32f88434c
commit bf3f7ee366
+8 -1
View File
@@ -45,6 +45,7 @@ LaneChangeDirection = log.LaneChangeDirection
EventName = log.OnroadEvent.EventName
ButtonType = car.CarState.ButtonEvent.Type
SafetyModel = car.CarParams.SafetyModel
DashcamOnlyReason = car.CarParams.DashcamOnlyReason
TurnDirection = custom.ModelDataV2SP.TurnDirection
IGNORED_SAFETY_MODES = (SafetyModel.silent, SafetyModel.noOutput)
@@ -161,7 +162,10 @@ class SelfdriveD(CruiseHelper):
self.events.add(EventName.carUnrecognized, static=True)
set_offroad_alert("Offroad_CarUnrecognized", True)
elif self.CP.passive:
self.events.add(EventName.dashcamMode, static=True)
if self.CP.dashcamOnlyReason == DashcamOnlyReason.radarDisableEngineOn:
self.events.add(EventName.dashcamModeRadDisEngOn, static=True)
else:
self.events.add(EventName.dashcamMode, static=True)
self.events_sp = EventsSP()
self.events_sp_prev = []
@@ -237,6 +241,9 @@ class SelfdriveD(CruiseHelper):
(CS.regenBraking and (not self.CS_prev.regenBraking or not CS.standstill)):
self.events.add(EventName.pedalPressed)
if CS.radarDisableFailed:
self.events.add(EventName.radarDisableFailed)
# Create events for temperature, disk space, and memory
if self.sm['deviceState'].thermalStatus >= ThermalStatus.red:
self.events.add(EventName.overheat)