ford: show "Radar Not Detected" when the radar bus is silent - #170
Open
ghbarker wants to merge 1 commit into
Open
ford: show "Radar Not Detected" when the radar bus is silent#170ghbarker wants to merge 1 commit into
ghbarker wants to merge 1 commit into
Conversation
Cars fingerprinted as a radar-equipped Ford but physically missing the radar/ACC module currently show a generic "Radar Error" or a confusing controls mismatch, which costs hours of support triage. RadarInterface returns None on a fully silent bus and never raises anything, so pure absence was invisible. This adds a small detector: after ~5s (500 frames at card's 100 Hz) with the radar trigger message never arriving, on a car that should have radar, it sets a new RadarData.errors flag (radarUnavailablePermanent). A radar_working latch means a radar that worked and then dropped out never trips it - that stays radarUnavailableTemporary's job. selfdrived maps the flag to a new radarIsNotDetected event: a permanent "Car may not have ACC" banner. Tested: a real Ford RadarInterface driven with a silent bus raises the flag at frame 500 and stays quiet before the grace period.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The evidence that motivated this
radarUnavailableis False), radard spins up expecting radar — and hears nothing.RadarInterface.update()returnsNonewhenever the trigger message hasn't arrived — so a completely silent radar bus never reaches thecanError/radarUnavailableTemporarypaths at all. Pure absence produced no signal.Why the fix is shaped this way
radar_interface.py, keyed on the trigger message.radar_working): a radar that worked and then dropped out can never trip this flag — that staysradarUnavailableTemporary's job. Permanent means never seen since startup.radarUnavailableis set (the constructor leavesrcp = None), so alpha-long cars can't false-positive.RadarData.Errorflag (radarUnavailablePermanent @4, sibling ofradarUnavailableTemporary), one newEventName.radarIsNotDetectedin the livelog.capnpenum, oneelifin selfdrived ahead of the generic radarFault catch-all, one alert entry ("Car may not have ACC"). No new process, no new UI surface.The evidence afterwards
RadarInterfacedriven with a fully silent bus raisesradarUnavailablePermanentat exactly frame 500 and stays quiet before the grace elapses; a radar that speaks first (even once, even late) never trips it.log.OnroadEvent.EventName, not the deprecated car.capnp copy).What each change is
opendbc/car/ford/radar_interface.py: the detector —RADAR_ABSENT_grace counter +radar_workinglatch in the silent branch ofupdate().opendbc/car/car.capnp:radarUnavailablePermanent @4inRadarData.Error.cereal/log.capnp:radarIsNotDetected @100in the liveOnroadEvent.EventNameenum.selfdrive/selfdrived/selfdrived.py: map the flag to the event, ahead of the generic catch-all.selfdrive/selfdrived/events.py: the permanent "Car may not have ACC" alert + no-entry.Test it yourself
Risks / limits