mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-07 06:32:08 +08:00
type hints for messaging (#2061)
* bump cereal * fix bugs found by mypy * bump cereal old-commit-hash: 520c2676b682903d2be8f661ce98ac85fa50c439
This commit is contained in:
+1
-1
Submodule cereal updated: 50d3751489...b9a54adaf4
@@ -17,6 +17,9 @@ logcan = messaging.sub_sock('can')
|
||||
msgs = {}
|
||||
while True:
|
||||
lc = messaging.recv_sock(logcan, True)
|
||||
if lc is None:
|
||||
continue
|
||||
|
||||
for c in lc.can:
|
||||
# read also msgs sent by EON on CAN bus 0x80 and filter out the
|
||||
# addr with more than 11 bits
|
||||
|
||||
@@ -11,6 +11,9 @@ if __name__ == "__main__":
|
||||
|
||||
while True:
|
||||
m = messaging.recv_one(modeld_sock)
|
||||
if m is None:
|
||||
continue
|
||||
|
||||
frame_id = m.model.frameId
|
||||
t = m.logMonoTime / 1e9
|
||||
frame_cnt += 1
|
||||
|
||||
@@ -26,7 +26,7 @@ if __name__ == "__main__":
|
||||
|
||||
while 1:
|
||||
fpkt = messaging.recv_one(frame)
|
||||
if len(fpkt.frame.image) == 0:
|
||||
if fpkt is None or len(fpkt.frame.image) == 0:
|
||||
continue
|
||||
sm.update(timeout=1)
|
||||
rgb_img_raw = fpkt.frame.image
|
||||
|
||||
Reference in New Issue
Block a user