From 8590969c1b453a9eeb63f1ac02de915b694b1631 Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Wed, 22 Apr 2020 14:29:36 -0700 Subject: [PATCH] Load all segments --- selfdrive/debug/internal/replay_drive_can.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/selfdrive/debug/internal/replay_drive_can.py b/selfdrive/debug/internal/replay_drive_can.py index 3acc0895eca7f0..7fc5dceeb02166 100755 --- a/selfdrive/debug/internal/replay_drive_can.py +++ b/selfdrive/debug/internal/replay_drive_can.py @@ -1,6 +1,7 @@ #!/usr/bin/env python3 import time +from tqdm import tqdm from tools.lib.logreader import LogReader import cereal.messaging as messaging @@ -8,16 +9,18 @@ NUM_SEGS = 82 # Get can messages from logs +print("Loading...") can_msgs = [] -for i in range(2): +for i in tqdm(list(range(NUM_SEGS))): log_url = f"https://commadataci.blob.core.windows.net/openpilotci/{ROUTE}/{i}/rlog.bz2" lr = LogReader(log_url) can_msgs += [m for m in lr if m.which() == 'can'] # Replay +print("Replay...") can = messaging.pub_sock('can') while True: - for m in can_msgs: + for m in tqdm(can_msgs): can.send(m.as_builder().to_bytes()) time.sleep(0.01) # 100 Hz