script to dump events from route

old-commit-hash: 3956adc6dfb8de1464b15ee40460020a37b0bda3
This commit is contained in:
Adeeb Shihadeh
2021-04-13 15:07:46 -07:00
parent 5cd4a9ba36
commit 96fce0bda5

20
selfdrive/debug/count_events.py Executable file
View File

@@ -0,0 +1,20 @@
#!/usr/bin/env python3
import sys
from collections import Counter
from pprint import pprint
from tqdm import tqdm
from tools.lib.route import Route
from tools.lib.logreader import LogReader
if __name__ == "__main__":
r = Route(sys.argv[1])
cnt: Counter = Counter()
for q in tqdm(r.qlog_paths()):
lr = LogReader(q)
car_events = [m for m in lr if m.which() == 'carEvents']
for car_event in car_events:
for e in car_event.carEvents:
cnt[e.name] += 1
pprint(cnt)