From b34089693f1ed299ca1ff0f978e2b2f2350c95a8 Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Mon, 13 Nov 2023 10:53:42 +0000 Subject: [PATCH] Revert "FCR: Reset cached param to sync with upstream conflicts" --- selfdrive/car/car_helpers.py | 31 +++++++++++-------------------- selfdrive/controls/lib/events.py | 4 ++-- 2 files changed, 13 insertions(+), 22 deletions(-) diff --git a/selfdrive/car/car_helpers.py b/selfdrive/car/car_helpers.py index ef53cb0c19..376b7b48d8 100644 --- a/selfdrive/car/car_helpers.py +++ b/selfdrive/car/car_helpers.py @@ -1,4 +1,3 @@ -import json import os import requests import threading @@ -234,27 +233,19 @@ def crash_log2(fingerprints, fw): def get_car(logcan, sendcan, experimental_long_allowed, num_pandas=1): candidate, fingerprints, vin, car_fw, source, exact_match = fingerprint(logcan, sendcan, num_pandas) - if candidate is None: - params = Params() + params = Params() + if params.get("CarModel") is not None: car_model = params.get("CarModel") - if car_model is not None: - car_model = car_model.decode("utf-8").rstrip() - with open(os.path.join(BASEDIR, "selfdrive/car/sunnypilot_carname.json")) as f: - car_models = json.load(f) - if car_model in car_models.values(): - candidate = car_model - else: - params.put("CarModel", "") - params.put("CarModelText", "") - if candidate is None: - cloudlog.event("car doesn't match any fingerprints", fingerprints=fingerprints, error=True) - candidate = "mock" - y = threading.Thread(target=crash_log2, args=(fingerprints, car_fw,)) - y.start() + candidate = car_model.decode("utf-8") - if candidate != "mock": - x = threading.Thread(target=crash_log, args=(candidate,)) - x.start() + if candidate is None: + cloudlog.event("car doesn't match any fingerprints", fingerprints=fingerprints, error=True) + candidate = "mock" + y = threading.Thread(target=crash_log2, args=(fingerprints, car_fw,)) + y.start() + + x = threading.Thread(target=crash_log, args=(candidate,)) + x.start() CarInterface, CarController, CarState = interfaces[candidate] CP = CarInterface.get_params(candidate, fingerprints, car_fw, experimental_long_allowed, docs=False) diff --git a/selfdrive/controls/lib/events.py b/selfdrive/controls/lib/events.py index 9a7dff6a78..5dde23e2c3 100755 --- a/selfdrive/controls/lib/events.py +++ b/selfdrive/controls/lib/events.py @@ -402,8 +402,8 @@ EVENTS: Dict[int, Dict[str, Union[Alert, AlertCallbackType]]] = { # read-only mode. This can be solved by adding your fingerprint. # See https://github.com/commaai/openpilot/wiki/Fingerprinting for more information EventName.carUnrecognized: { - ET.PERMANENT: NormalPermanentAlert("Car Unrecognized", - "Vehicle Settings, Select, and Restart the Car", + ET.PERMANENT: NormalPermanentAlert("Dashcam Mode", + "Car Unrecognized", priority=Priority.LOWEST), },