Remove fuzzy fingerprint startup alert (#22328)

* deprecate fuzzy fingerprint startup alert

* bump cereal
old-commit-hash: 88d248a5af
commatwo_master
Willem Melching 4 years ago committed by GitHub
parent dd7e1bef52
commit b3601ce43b
  1. 2
      cereal
  2. 4
      selfdrive/car/car_helpers.py
  3. 3
      selfdrive/controls/controlsd.py
  4. 20
      selfdrive/controls/lib/events.py
  5. 4
      selfdrive/controls/tests/test_startup.py

@ -1 +1 @@
Subproject commit 0891fd758d77b616994e85a1a06b18ea3a48e3db Subproject commit bbcc8eea73fdf3d0cbb0cc925d47379dd33ba0b8

@ -13,7 +13,7 @@ from cereal import car
EventName = car.CarEvent.EventName EventName = car.CarEvent.EventName
def get_startup_event(car_recognized, controller_available, fuzzy_fingerprint, fw_seen): def get_startup_event(car_recognized, controller_available, fw_seen):
if comma_remote and tested_branch: if comma_remote and tested_branch:
event = EventName.startup event = EventName.startup
else: else:
@ -26,8 +26,6 @@ def get_startup_event(car_recognized, controller_available, fuzzy_fingerprint, f
event = EventName.startupNoFw event = EventName.startupNoFw
elif car_recognized and not controller_available: elif car_recognized and not controller_available:
event = EventName.startupNoControl event = EventName.startupNoControl
elif car_recognized and fuzzy_fingerprint:
event = EventName.startupFuzzyFingerprint
return event return event

@ -153,8 +153,7 @@ class Controls:
# TODO: no longer necessary, aside from process replay # TODO: no longer necessary, aside from process replay
self.sm['liveParameters'].valid = True self.sm['liveParameters'].valid = True
self.startup_event = get_startup_event(car_recognized, controller_available, self.CP.fuzzyFingerprint, self.startup_event = get_startup_event(car_recognized, controller_available, len(self.CP.carFw) > 0)
len(self.CP.carFw) > 0)
if not sounds_available: if not sounds_available:
self.events.add(EventName.soundsUnavailable, static=True) self.events.add(EventName.soundsUnavailable, static=True)

@ -219,14 +219,6 @@ def wrong_car_mode_alert(CP: car.CarParams, sm: messaging.SubMaster, metric: boo
return NoEntryAlert(text, duration_hud_alert=0.) return NoEntryAlert(text, duration_hud_alert=0.)
def startup_fuzzy_fingerprint_alert(CP: car.CarParams, sm: messaging.SubMaster, metric: bool) -> Alert:
return Alert(
"WARNING: No Exact Match on Car Model",
f"Closest Match: {CP.carFingerprint.title()[:40]}",
AlertStatus.userPrompt, AlertSize.mid,
Priority.LOWER, VisualAlert.none, AudibleAlert.none, 0., 0., 10.)
def joystick_alert(CP: car.CarParams, sm: messaging.SubMaster, metric: bool) -> Alert: def joystick_alert(CP: car.CarParams, sm: messaging.SubMaster, metric: bool) -> Alert:
axes = sm['testJoystick'].axes axes = sm['testJoystick'].axes
gb, steer = list(axes)[:2] if len(axes) else (0., 0.) gb, steer = list(axes)[:2] if len(axes) else (0., 0.)
@ -291,18 +283,6 @@ EVENTS: Dict[int, Dict[str, Union[Alert, Callable[[Any, messaging.SubMaster, boo
Priority.LOWER, VisualAlert.none, AudibleAlert.none, 0., 0., 10.), Priority.LOWER, VisualAlert.none, AudibleAlert.none, 0., 0., 10.),
}, },
# openpilot uses the version strings from various ECUs to detect the correct car model.
# Usually all ECUs are recognized and an exact match to a car model can be made. Sometimes
# one or two ECUs have unrecognized versions, but the others are present in the database.
# If openpilot is confident about the match to a car model, it fingerprints anyway.
# In this case an alert is thrown since there is a small chance the wrong car was detected
# and the user should pay extra attention.
# This alert can be prevented by adding all ECU firmware version to openpilot:
# https://github.com/commaai/openpilot/wiki/Fingerprinting
EventName.startupFuzzyFingerprint: {
ET.PERMANENT: startup_fuzzy_fingerprint_alert,
},
EventName.startupNoFw: { EventName.startupNoFw: {
ET.PERMANENT: Alert( ET.PERMANENT: Alert(
"Car Unrecognized", "Car Unrecognized",

@ -67,8 +67,8 @@ class TestStartup(unittest.TestCase):
(EventName.startupNoCar, None, False, COROLLA_FW_VERSIONS[:1]), (EventName.startupNoCar, None, False, COROLLA_FW_VERSIONS[:1]),
# fuzzy match # fuzzy match
(EventName.startupFuzzyFingerprint, TOYOTA.COROLLA, True, COROLLA_FW_VERSIONS_FUZZY), (EventName.startupMaster, TOYOTA.COROLLA, True, COROLLA_FW_VERSIONS_FUZZY),
(EventName.startupFuzzyFingerprint, TOYOTA.COROLLA, False, COROLLA_FW_VERSIONS_FUZZY), (EventName.startupMaster, TOYOTA.COROLLA, False, COROLLA_FW_VERSIONS_FUZZY),
]) ])
@with_processes(['controlsd']) @with_processes(['controlsd'])
def test_startup_alert(self, expected_event, car_model, toggle_enabled, fw_versions): def test_startup_alert(self, expected_event, car_model, toggle_enabled, fw_versions):

Loading…
Cancel
Save