type hints for messaging (#2061)

* bump cereal

* fix bugs found by mypy

* bump cereal
pull/2064/head
Adeeb Shihadeh 5 years ago committed by GitHub
parent 8c4c8e6bbe
commit 520c2676b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      cereal
  2. 3
      selfdrive/debug/get_fingerprint.py
  3. 3
      selfdrive/debug/internal/measure_modeld_packet_drop.py
  4. 2
      tools/replay/sensorium.py

@ -1 +1 @@
Subproject commit 50d37514897c07ae605691ee602ad6a01b51b890 Subproject commit b9a54adaf4c825bf2b44d9d60d8e6105eb78e9b1

@ -17,6 +17,9 @@ logcan = messaging.sub_sock('can')
msgs = {} msgs = {}
while True: while True:
lc = messaging.recv_sock(logcan, True) lc = messaging.recv_sock(logcan, True)
if lc is None:
continue
for c in lc.can: for c in lc.can:
# read also msgs sent by EON on CAN bus 0x80 and filter out the # read also msgs sent by EON on CAN bus 0x80 and filter out the
# addr with more than 11 bits # addr with more than 11 bits

@ -11,6 +11,9 @@ if __name__ == "__main__":
while True: while True:
m = messaging.recv_one(modeld_sock) m = messaging.recv_one(modeld_sock)
if m is None:
continue
frame_id = m.model.frameId frame_id = m.model.frameId
t = m.logMonoTime / 1e9 t = m.logMonoTime / 1e9
frame_cnt += 1 frame_cnt += 1

@ -26,7 +26,7 @@ if __name__ == "__main__":
while 1: while 1:
fpkt = messaging.recv_one(frame) fpkt = messaging.recv_one(frame)
if len(fpkt.frame.image) == 0: if fpkt is None or len(fpkt.frame.image) == 0:
continue continue
sm.update(timeout=1) sm.update(timeout=1)
rgb_img_raw = fpkt.frame.image rgb_img_raw = fpkt.frame.image

Loading…
Cancel
Save