test_fw_query_on_routes: use new LogReader (#31134)

a
pull/31136/head
Justin Newberry 1 year ago committed by GitHub
parent 780f1222ad
commit 998eb8cde2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 19
      selfdrive/debug/test_fw_query_on_routes.py

@ -6,8 +6,8 @@ import argparse
import os import os
import traceback import traceback
from tqdm import tqdm from tqdm import tqdm
from openpilot.tools.lib.logreader import LogReader from openpilot.tools.lib.logreader import LogReader, ReadMode
from openpilot.tools.lib.route import Route from openpilot.tools.lib.route import SegmentRange
from openpilot.selfdrive.car.car_helpers import interface_names from openpilot.selfdrive.car.car_helpers import interface_names
from openpilot.selfdrive.car.fw_versions import VERSIONS, match_fw_to_car from openpilot.selfdrive.car.fw_versions import VERSIONS, match_fw_to_car
@ -44,23 +44,14 @@ if __name__ == "__main__":
dongles = [] dongles = []
for route in tqdm(routes): for route in tqdm(routes):
route = route.rstrip() dongle_id = SegmentRange(route).dongle_id
dongle_id, time = route.split('|')
if dongle_id in dongles: if dongle_id in dongles:
continue continue
if NO_API: lr = LogReader(route, default_mode=ReadMode.QLOG)
qlog_path = f"cd:/{dongle_id}/{time}/0/qlog.bz2"
else:
route = Route(route)
qlog_path = next((p for p in route.qlog_paths() if p is not None), None)
if qlog_path is None:
continue
try: try:
lr = LogReader(qlog_path)
dongles.append(dongle_id) dongles.append(dongle_id)
CP = None CP = None
@ -98,13 +89,11 @@ if __name__ == "__main__":
if len(fuzzy_matches) == 1: if len(fuzzy_matches) == 1:
if list(fuzzy_matches)[0] != live_fingerprint: if list(fuzzy_matches)[0] != live_fingerprint:
wrong_fuzzy += 1 wrong_fuzzy += 1
print(f"{dongle_id}|{time}")
print("Fuzzy match wrong! Fuzzy:", fuzzy_matches, "Live:", live_fingerprint) print("Fuzzy match wrong! Fuzzy:", fuzzy_matches, "Live:", live_fingerprint)
else: else:
good_fuzzy += 1 good_fuzzy += 1
break break
print(f"{dongle_id}|{time}")
print("Old style:", live_fingerprint, "Vin", CP.carVin) print("Old style:", live_fingerprint, "Vin", CP.carVin)
print("New style (exact):", exact_matches) print("New style (exact):", exact_matches)
print("New style (fuzzy):", fuzzy_matches) print("New style (fuzzy):", fuzzy_matches)

Loading…
Cancel
Save