mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-02-20 17:13:54 +08:00
* car stuff * thermal * Revert "car stuff" This reverts commit 77fd1c65ebd01abfa8493ae12c9e6b14f7ada976. * panda state * camera stuff * start deg * most is building * builds * planner + controls run * fix up paramsd * cleanup * process replay passes * fix webcam build * camerad * no more frame * thermald * ui * paramsd * camera replay * fix long tests * fix camerad tests * maxSteeringAngle * bump cereal * more frame * cereal master
28 lines
753 B
Python
Executable File
28 lines
753 B
Python
Executable File
#!/usr/bin/env python3
|
|
# type: ignore
|
|
import cereal.messaging as messaging
|
|
|
|
all_sockets = ['roadCameraState', 'driverCameraState', 'wideRoadCameraState']
|
|
prev_id = [None,None,None]
|
|
this_id = [None,None,None]
|
|
dt = [None,None,None]
|
|
num_skipped = [0,0,0]
|
|
|
|
if __name__ == "__main__":
|
|
sm = messaging.SubMaster(all_sockets)
|
|
while True:
|
|
sm.update()
|
|
|
|
for i in range(len(all_sockets)):
|
|
if not sm.updated[all_sockets[i]]:
|
|
continue
|
|
this_id[i] = sm[all_sockets[i]].frameId
|
|
if prev_id[i] is None:
|
|
prev_id[i] = this_id[i]
|
|
continue
|
|
dt[i] = this_id[i] - prev_id[i]
|
|
if dt[i] != 1:
|
|
num_skipped[i] += dt[i] - 1
|
|
print(all_sockets[i] ,dt[i] - 1, num_skipped[i])
|
|
prev_id[i] = this_id[i]
|