mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-07-12 22:22:07 +08:00
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
This commit is contained in:
@@ -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;
|
||||
|
||||
+1
-1
Submodule opendbc_repo updated: 5d74dd6e73...96896d3509
@@ -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):
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user