From 4e7c605a7948ec4928f79beb37fb6dc0638e7bf2 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Fri, 14 Mar 2025 21:08:30 -0700 Subject: [PATCH] Ford: radar is invalid while in reverse (#34866) * temp unavailable * fix * replay multiple * clean up * bump * rename * reason is in liveTracks * more rename * bump * fix * bump * fix * need to totally ignore it, or it will throw commIssues for radarErrors or not alive * this is just simpler -- good thing kept struct * rm --- cereal/log.capnp | 2 ++ opendbc_repo | 2 +- selfdrive/controls/radard.py | 1 + selfdrive/selfdrived/events.py | 5 +++++ selfdrive/selfdrived/selfdrived.py | 4 ++++ 5 files changed, 13 insertions(+), 1 deletion(-) diff --git a/cereal/log.capnp b/cereal/log.capnp index 1cc37cf642..7b6076311f 100644 --- a/cereal/log.capnp +++ b/cereal/log.capnp @@ -59,6 +59,7 @@ struct OnroadEvent @0xc4fa6047f024e718 { pcmEnable @23; pcmDisable @24; radarFault @25; + radarTempUnavailable @93; brakeHold @26; parkBrake @27; manualRestart @28; @@ -728,6 +729,7 @@ struct PeripheralState { struct RadarState @0x9a185389d6fdd05f { mdMonoTime @6 :UInt64; carStateMonoTime @11 :UInt64; + radarErrors @13 :Car.RadarData.Error; leadOne @3 :LeadData; leadTwo @4 :LeadData; diff --git a/opendbc_repo b/opendbc_repo index 5d74dd6e73..96896d3509 160000 --- a/opendbc_repo +++ b/opendbc_repo @@ -1 +1 @@ -Subproject commit 5d74dd6e7344900805c58eb2fb2b5a8d52e83050 +Subproject commit 96896d35098464661de5c96f075bf5053eeefede diff --git a/selfdrive/controls/radard.py b/selfdrive/controls/radard.py index f91c53431d..84420e3584 100755 --- a/selfdrive/controls/radard.py +++ b/selfdrive/controls/radard.py @@ -234,6 +234,7 @@ class RadarD: self.radar_state_valid = sm.all_checks() self.radar_state = log.RadarState.new_message() self.radar_state.mdMonoTime = sm.logMonoTime['modelV2'] + self.radar_state.radarErrors = rr.errors self.radar_state.carStateMonoTime = sm.logMonoTime['carState'] if len(sm['modelV2'].velocity.x): diff --git a/selfdrive/selfdrived/events.py b/selfdrive/selfdrived/events.py index d89418e177..ee2c418b6e 100755 --- a/selfdrive/selfdrived/events.py +++ b/selfdrive/selfdrived/events.py @@ -832,6 +832,11 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { ET.NO_ENTRY: NoEntryAlert("Radar Error: Restart the Car"), }, + EventName.radarTempUnavailable: { + ET.SOFT_DISABLE: soft_disable_alert("Radar Temporarily Unavailable"), + ET.NO_ENTRY: NoEntryAlert("Radar Temporarily Unavailable"), + }, + # Every frame from the camera should be processed by the model. If modeld # is not processing frames fast enough they have to be dropped. This alert is # thrown when over 20% of frames are dropped. diff --git a/selfdrive/selfdrived/selfdrived.py b/selfdrive/selfdrived/selfdrived.py index 93f8f59133..fdf1b77871 100755 --- a/selfdrive/selfdrived/selfdrived.py +++ b/selfdrive/selfdrived/selfdrived.py @@ -270,6 +270,10 @@ class SelfdriveD: if not REPLAY and self.rk.lagging: self.events.add(EventName.selfdrivedLagging) if not self.sm.valid['radarState']: + if self.sm['radarState'].radarErrors.radarUnavailableTemporary: + self.events.add(EventName.radarTempUnavailable) + else: + self.events.add(EventName.radarFault) self.events.add(EventName.radarFault) if not self.sm.valid['pandaStates']: self.events.add(EventName.usbError)