pull/28386/head
Shane Smiskol 2 years ago
parent cd73c30c89
commit 07574deae9
  1. 1
      selfdrive/car/fw_query_definitions.py
  2. 4
      selfdrive/car/fw_versions.py
  3. 1
      selfdrive/car/hyundai/values.py

@ -81,6 +81,7 @@ class FwQueryConfig:
# A function to get uniquely identifiable codes for a version
# TODO: take list of versions and return set of platform codes
fuzzy_get_platform_codes: Optional[Callable] = None
fuzzy_ecus: List[capnp.lib.capnp._EnumModule] = field(default_factory=set)
# TODO: below func is to be replaced by above two
# A function that each make can provide to fuzzy fingerprint reliably on that make

@ -59,7 +59,7 @@ def match_fw_to_car_fuzzy(fw_versions_dict, config, log=True, exclude=None):
# Getting this exactly right isn't crucial, but excluding camera and radar makes it almost
# impossible to get 3 matching versions, even if two models with shared parts are released at the same
# time and only one is in our database.
# exclude_types = [Ecu.fwdCamera, Ecu.fwdRadar, Ecu.eps, Ecu.debug]
exclude_types = [Ecu.fwdCamera, Ecu.fwdRadar, Ecu.eps, Ecu.debug]
# Build lookup table from (addr, sub_addr, fw) to list of candidate cars
all_fw_versions = defaultdict(set)
@ -77,10 +77,12 @@ def match_fw_to_car_fuzzy(fw_versions_dict, config, log=True, exclude=None):
if addr[0] not in [Ecu.fwdCamera, Ecu.fwdRadar]:
continue
for f in fws:
if addr[0] not in exclude_types:
all_fw_versions[(addr[1], addr[2], f)].add(candidate)
# Add platform codes to lookup dict if config specifies a function
if config.fuzzy_get_platform_codes is not None:
if addr[0] in config.fuzzy_ecus:
platform_codes = config.fuzzy_get_platform_codes([f])
assert len(platform_codes) < 2 # TODO: remove and test?
if len(platform_codes) == 1:

@ -451,6 +451,7 @@ FW_QUERY_CONFIG = FwQueryConfig(
# Just one platform code match from radar or camera is enough
fuzzy_min_match_count=1,
fuzzy_get_platform_codes=get_platform_codes,
fuzzy_ecus=[Ecu.fwdRadar, Ecu.fwdCamera],
# TODO: old, remove
match_fw_to_car_fuzzy=match_fw_to_hyundai_fuzzy,

Loading…
Cancel
Save