FCR: Reset cached param to sync with upstream conflicts

This commit is contained in:
Jason Wen
2023-11-07 20:05:37 +00:00
parent 5d2de35fc4
commit 741237f6e2
2 changed files with 22 additions and 13 deletions
+20 -11
View File
@@ -1,3 +1,4 @@
import json
import os
import requests
import threading
@@ -233,19 +234,27 @@ 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)
params = Params()
if params.get("CarModel") is not None:
car_model = params.get("CarModel")
candidate = car_model.decode("utf-8")
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()
params = Params()
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()
x = threading.Thread(target=crash_log, args=(candidate,))
x.start()
if candidate != "mock":
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)
+2 -2
View File
@@ -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("Dashcam Mode",
"Car Unrecognized",
ET.PERMANENT: NormalPermanentAlert("Car Unrecognized",
"Vehicle Settings, Select, and Restart the Car",
priority=Priority.LOWEST),
},