Skip to content

Commit 9dabf0f

Browse files
adeebshihadehpull[bot]
authored andcommitted
debug: improve count_events.py output
1 parent 10fce63 commit 9dabf0f

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

selfdrive/debug/count_events.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from openpilot.tools.lib.logreader import LogReader, ReadMode
1111

1212
if __name__ == "__main__":
13-
cnt_valid: Counter = Counter()
1413
cnt_events: Counter = Counter()
1514

1615
cams = [s for s in SERVICE_LIST if s.endswith('CameraState')]
@@ -48,17 +47,15 @@
4847
elif msg.which() in cams:
4948
cnt_cameras[msg.which()] += 1
5049

51-
if not msg.valid:
52-
cnt_valid[msg.which()] += 1
53-
5450
duration = (end_time - start_time) / 1e9
5551

5652
print("Events")
5753
pprint(cnt_events)
5854

5955
print("\n")
60-
print("Not valid")
61-
pprint(cnt_valid)
56+
print("Events")
57+
for t, evt in events:
58+
print(f"{t:8.2f} {evt}")
6259

6360
print("\n")
6461
print("Cameras")
@@ -72,11 +69,6 @@
7269
for t, a in alerts:
7370
print(f"{t:8.2f} {a}")
7471

75-
print("\n")
76-
print("Events")
77-
for t, evt in events:
78-
print(f"{t:8.2f} {evt}")
79-
8072
print("\n")
8173
if ignition_off is not None:
8274
ignition_off = round((ignition_off - start_time) / 1e9, 2)

0 commit comments

Comments
 (0)