Load all segments

old-commit-hash: 8590969c1b
commatwo_master
Willem Melching 5 years ago
parent e11eaf7fa9
commit 3ae0cc1cd6
  1. 7
      selfdrive/debug/internal/replay_drive_can.py

@ -1,6 +1,7 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import time import time
from tqdm import tqdm
from tools.lib.logreader import LogReader from tools.lib.logreader import LogReader
import cereal.messaging as messaging import cereal.messaging as messaging
@ -8,16 +9,18 @@ ROUTE = "77611a1fac303767/2020-03-24--09-50-38"
NUM_SEGS = 82 NUM_SEGS = 82
# Get can messages from logs # Get can messages from logs
print("Loading...")
can_msgs = [] 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" log_url = f"https://commadataci.blob.core.windows.net/openpilotci/{ROUTE}/{i}/rlog.bz2"
lr = LogReader(log_url) lr = LogReader(log_url)
can_msgs += [m for m in lr if m.which() == 'can'] can_msgs += [m for m in lr if m.which() == 'can']
# Replay # Replay
print("Replay...")
can = messaging.pub_sock('can') can = messaging.pub_sock('can')
while True: while True:
for m in can_msgs: for m in tqdm(can_msgs):
can.send(m.as_builder().to_bytes()) can.send(m.as_builder().to_bytes())
time.sleep(0.01) # 100 Hz time.sleep(0.01) # 100 Hz

Loading…
Cancel
Save