mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-18 23:33:58 +08:00
* add pyupgrade hook
* run pyupgrade (pre-commit run -a)
* ruff --fix
* Revert "add pyupgrade hook"
This reverts commit 56ec18bb6b8602a0b612f3803d96cdad14b52066.
* revert changes to third_party/
* manual type fixes
* explicit Optional wrapping capnp objects
old-commit-hash: 995250ae49
28 lines
534 B
Python
Executable File
28 lines
534 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
import cereal.messaging as messaging
|
|
from cereal.services import SERVICE_LIST
|
|
|
|
TO_CHECK = ['carState']
|
|
|
|
|
|
if __name__ == "__main__":
|
|
sm = messaging.SubMaster(TO_CHECK)
|
|
|
|
prev_t: dict[str, float] = {}
|
|
|
|
while True:
|
|
sm.update()
|
|
|
|
for s in TO_CHECK:
|
|
if sm.updated[s]:
|
|
t = sm.logMonoTime[s] / 1e9
|
|
|
|
if s in prev_t:
|
|
expected = 1.0 / (SERVICE_LIST[s].frequency)
|
|
dt = t - prev_t[s]
|
|
if dt > 10 * expected:
|
|
print(t, s, dt)
|
|
|
|
prev_t[s] = t
|