quick repo garbage collection (#35274)
* start gc * lil more * debug * no sound * add backpull/35278/head
parent
d7bf309eca
commit
f1ba6c389b
17 changed files with 8 additions and 128 deletions
@ -1,8 +0,0 @@ |
|||||||
import platform |
|
||||||
|
|
||||||
|
|
||||||
def suffix(): |
|
||||||
if platform.system() == "Darwin": |
|
||||||
return ".dylib" |
|
||||||
else: |
|
||||||
return ".so" |
|
@ -1,33 +0,0 @@ |
|||||||
#!/usr/bin/env python3 |
|
||||||
import cereal.messaging as messaging |
|
||||||
|
|
||||||
if __name__ == "__main__": |
|
||||||
modeld_sock = messaging.sub_sock("modelV2") |
|
||||||
|
|
||||||
last_frame_id = None |
|
||||||
start_t: int | None = None |
|
||||||
frame_cnt = 0 |
|
||||||
dropped = 0 |
|
||||||
|
|
||||||
while True: |
|
||||||
m = messaging.recv_one(modeld_sock) |
|
||||||
if m is None: |
|
||||||
continue |
|
||||||
|
|
||||||
frame_id = m.modelV2.frameId |
|
||||||
t = m.logMonoTime / 1e9 |
|
||||||
frame_cnt += 1 |
|
||||||
|
|
||||||
if start_t is None: |
|
||||||
start_t = t |
|
||||||
last_frame_id = frame_id |
|
||||||
continue |
|
||||||
|
|
||||||
d_frame = frame_id - last_frame_id |
|
||||||
dropped += d_frame - 1 |
|
||||||
|
|
||||||
expected_num_frames = int((t - start_t) * 20) |
|
||||||
frame_drop = 100 * (1 - (expected_num_frames / frame_cnt)) |
|
||||||
print(f"Num dropped {dropped}, Drop compared to 20Hz: {frame_drop:.2f}%") |
|
||||||
|
|
||||||
last_frame_id = frame_id |
|
@ -1,20 +0,0 @@ |
|||||||
#!/usr/bin/env python3 |
|
||||||
from opendbc.car.fingerprints import eliminate_incompatible_cars, all_legacy_fingerprint_cars |
|
||||||
import cereal.messaging as messaging |
|
||||||
|
|
||||||
|
|
||||||
# rav4 2019 and corolla tss2 |
|
||||||
fingerprint = {896: 8, 898: 8, 900: 6, 976: 1, 1541: 8, 902: 6, 905: 8, 810: 2, 1164: 8, 1165: 8, 1166: 8, 1167: 8, 1552: 8, 1553: 8, 1556: 8, 1571: 8, 921: 8, 1056: 8, 544: 4, 1570: 8, 1059: 1, 36: 8, 37: 8, 550: 8, 935: 8, 552: 4, 170: 8, 812: 8, 944: 8, 945: 8, 562: 6, 180: 8, 1077: 8, 951: 8, 1592: 8, 1076: 8, 186: 4, 955: 8, 956: 8, 1001: 8, 705: 8, 452: 8, 1788: 8, 464: 8, 824: 8, 466: 8, 467: 8, 761: 8, 728: 8, 1572: 8, 1114: 8, 933: 8, 800: 8, 608: 8, 865: 8, 610: 8, 1595: 8, 934: 8, 998: 5, 1745: 8, 1000: 8, 764: 8, 1002: 8, 999: 7, 1789: 8, 1649: 8, 1779: 8, 1568: 8, 1017: 8, 1786: 8, 1787: 8, 1020: 8, 426: 6, 1279: 8} # noqa: E501 |
|
||||||
|
|
||||||
candidate_cars = all_legacy_fingerprint_cars() |
|
||||||
|
|
||||||
|
|
||||||
for addr, l in fingerprint.items(): |
|
||||||
dat = messaging.new_message('can', 1) |
|
||||||
|
|
||||||
msg = dat.can[0] |
|
||||||
msg.address = addr |
|
||||||
msg.dat = " " * l |
|
||||||
|
|
||||||
candidate_cars = eliminate_incompatible_cars(msg, candidate_cars) |
|
||||||
print(candidate_cars) |
|
@ -1,27 +0,0 @@ |
|||||||
#!/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] |
|
@ -1,24 +0,0 @@ |
|||||||
#!/usr/bin/env python3 |
|
||||||
import argparse |
|
||||||
import os |
|
||||||
from tqdm import tqdm |
|
||||||
|
|
||||||
from openpilot.tools.lib.logreader import LogReader |
|
||||||
|
|
||||||
if __name__ == "__main__": |
|
||||||
parser = argparse.ArgumentParser() |
|
||||||
parser.add_argument("route", help="The route name") |
|
||||||
args = parser.parse_args() |
|
||||||
|
|
||||||
out_path = os.path.join("jpegs", f"{args.route.replace('|', '_').replace('/', '_')}") |
|
||||||
os.makedirs(out_path, exist_ok=True) |
|
||||||
|
|
||||||
lr = LogReader(args.route) |
|
||||||
|
|
||||||
for msg in tqdm(lr): |
|
||||||
if msg.which() == 'thumbnail': |
|
||||||
with open(os.path.join(out_path, f"{msg.thumbnail.frameId}.jpg"), 'wb') as f: |
|
||||||
f.write(msg.thumbnail.thumbnail) |
|
||||||
elif msg.which() == 'navThumbnail': |
|
||||||
with open(os.path.join(out_path, f"nav_{msg.navThumbnail.frameId}.jpg"), 'wb') as f: |
|
||||||
f.write(msg.navThumbnail.thumbnail) |
|
Loading…
Reference in new issue