From 36e935c9dca787d652b539eab8ba69951bf95b01 Mon Sep 17 00:00:00 2001 From: firestar5683 <168790843+firestar5683@users.noreply.github.com> Date: Sat, 27 Jun 2026 00:18:18 -0500 Subject: [PATCH] nah --- opendbc_repo/opendbc/car/car_helpers.py | 6 +----- opendbc_repo/opendbc/car/fingerprints.py | 7 ------- opendbc_repo/opendbc/car/tests/test_can_fingerprint.py | 6 ------ 3 files changed, 1 insertion(+), 18 deletions(-) diff --git a/opendbc_repo/opendbc/car/car_helpers.py b/opendbc_repo/opendbc/car/car_helpers.py index 7ce598ace..e6526b0ba 100644 --- a/opendbc_repo/opendbc/car/car_helpers.py +++ b/opendbc_repo/opendbc/car/car_helpers.py @@ -8,7 +8,7 @@ from opendbc.car import gen_empty_fingerprint from opendbc.car.can_definitions import CanRecvCallable, CanSendCallable from opendbc.car.carlog import carlog from opendbc.car.structs import CarParams, CarParamsT -from opendbc.car.fingerprints import eliminate_incompatible_cars, exact_fingerprint_matches, all_legacy_fingerprint_cars +from opendbc.car.fingerprints import eliminate_incompatible_cars, all_legacy_fingerprint_cars from opendbc.car.fw_versions import ObdCallback, get_fw_versions_ordered, get_present_ecus, match_fw_to_car from opendbc.car.mock.values import CAR as MOCK from opendbc.car.toyota.values import ToyotaSafetyFlags @@ -192,10 +192,6 @@ def can_fingerprint(can_recv: CanRecvCallable) -> tuple[str | None, dict[int, di if len(candidate_cars[b]) == 1 and frame > FRAME_FINGERPRINT: # fingerprint done car_fingerprint = candidate_cars[b][0] - elif len(candidate_cars[b]) > 1 and frame > FRAME_FINGERPRINT * 2: - exact_matches = exact_fingerprint_matches(finger.get(b, {}), candidate_cars[b]) - if len(exact_matches) == 1: - car_fingerprint = exact_matches[0] # bail if no cars left or we've been waiting for more than 2s failed = (all(len(cc) == 0 for cc in candidate_cars.values()) and frame > FRAME_FINGERPRINT) or frame > 200 diff --git a/opendbc_repo/opendbc/car/fingerprints.py b/opendbc_repo/opendbc/car/fingerprints.py index f384511dd..25150d1c3 100644 --- a/opendbc_repo/opendbc/car/fingerprints.py +++ b/opendbc_repo/opendbc/car/fingerprints.py @@ -48,13 +48,6 @@ def eliminate_incompatible_cars(msg, candidate_cars): return compatible_cars -def exact_fingerprint_matches(car_fingerprint: dict[int, int], candidate_cars): - return [ - car_name for car_name in candidate_cars - if any(car_fingerprint == fingerprint for fingerprint in _FINGERPRINTS[car_name]) - ] - - def all_legacy_fingerprint_cars(): """Returns a list of all known car strings, FPv1 only.""" return list(_FINGERPRINTS.keys()) diff --git a/opendbc_repo/opendbc/car/tests/test_can_fingerprint.py b/opendbc_repo/opendbc/car/tests/test_can_fingerprint.py index 3f31f9b47..b73a5b5e6 100644 --- a/opendbc_repo/opendbc/car/tests/test_can_fingerprint.py +++ b/opendbc_repo/opendbc/car/tests/test_can_fingerprint.py @@ -31,12 +31,6 @@ class TestCanFingerprint: assert finger[1] == fingerprint assert finger[2] == {} - def test_exact_fingerprint_preferred_over_gm_sascm_superset(self): - car_fingerprint, finger = self._fingerprint_from_can(FINGERPRINTS[GM.CADILLAC_ESCALADE_ESV_2019][0]) - - assert car_fingerprint == GM.CADILLAC_ESCALADE_ESV_2019 - assert 0x2FF not in finger[0] - def test_gm_sascm_superset_fingerprint_matches_ascm_variant(self): car_fingerprint, finger = self._fingerprint_from_can(FINGERPRINTS[GM.CADILLAC_ESCALADE_ESV_2019_ASCM][0])