mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-18 20:03:53 +08:00
Remove fuzzy fingerprint startup alert (#22328)
* deprecate fuzzy fingerprint startup alert
* bump cereal
old-commit-hash: 88d248a5af
This commit is contained in:
2
cereal
2
cereal
Submodule cereal updated: 0891fd758d...bbcc8eea73
@@ -13,7 +13,7 @@ from cereal import car
|
||||
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:
|
||||
event = EventName.startup
|
||||
else:
|
||||
@@ -26,8 +26,6 @@ def get_startup_event(car_recognized, controller_available, fuzzy_fingerprint, f
|
||||
event = EventName.startupNoFw
|
||||
elif car_recognized and not controller_available:
|
||||
event = EventName.startupNoControl
|
||||
elif car_recognized and fuzzy_fingerprint:
|
||||
event = EventName.startupFuzzyFingerprint
|
||||
return event
|
||||
|
||||
|
||||
|
||||
@@ -153,8 +153,7 @@ class Controls:
|
||||
# TODO: no longer necessary, aside from process replay
|
||||
self.sm['liveParameters'].valid = True
|
||||
|
||||
self.startup_event = get_startup_event(car_recognized, controller_available, self.CP.fuzzyFingerprint,
|
||||
len(self.CP.carFw) > 0)
|
||||
self.startup_event = get_startup_event(car_recognized, controller_available, len(self.CP.carFw) > 0)
|
||||
|
||||
if not sounds_available:
|
||||
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.)
|
||||
|
||||
|
||||
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:
|
||||
axes = sm['testJoystick'].axes
|
||||
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.),
|
||||
},
|
||||
|
||||
# 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: {
|
||||
ET.PERMANENT: Alert(
|
||||
"Car Unrecognized",
|
||||
|
||||
@@ -67,8 +67,8 @@ class TestStartup(unittest.TestCase):
|
||||
(EventName.startupNoCar, None, False, COROLLA_FW_VERSIONS[:1]),
|
||||
|
||||
# fuzzy match
|
||||
(EventName.startupFuzzyFingerprint, TOYOTA.COROLLA, True, COROLLA_FW_VERSIONS_FUZZY),
|
||||
(EventName.startupFuzzyFingerprint, TOYOTA.COROLLA, False, COROLLA_FW_VERSIONS_FUZZY),
|
||||
(EventName.startupMaster, TOYOTA.COROLLA, True, COROLLA_FW_VERSIONS_FUZZY),
|
||||
(EventName.startupMaster, TOYOTA.COROLLA, False, COROLLA_FW_VERSIONS_FUZZY),
|
||||
])
|
||||
@with_processes(['controlsd'])
|
||||
def test_startup_alert(self, expected_event, car_model, toggle_enabled, fw_versions):
|
||||
|
||||
Reference in New Issue
Block a user