json bug fix
parent
eb4dd2cb6e
commit
1fee24c612
|
@ -94,7 +94,7 @@ void run_model(ModelState &model, VisionIpcClient &vipc_client_main, VisionIpcCl
|
||||||
//TODO: SET CONTEXT
|
//TODO: SET CONTEXT
|
||||||
//setenv("FRAME_ID", std::to_string(meta_main.frame_id).c_str(), 1);
|
//setenv("FRAME_ID", std::to_string(meta_main.frame_id).c_str(), 1);
|
||||||
set_frame_id(meta_main.frame_id);
|
set_frame_id(meta_main.frame_id);
|
||||||
LOGT("vicp read main")
|
LOGT("vicp read main");
|
||||||
if (use_extra_client) {
|
if (use_extra_client) {
|
||||||
// Keep receiving extra frames until frame id matches main camera
|
// Keep receiving extra frames until frame id matches main camera
|
||||||
do {
|
do {
|
||||||
|
@ -105,7 +105,7 @@ void run_model(ModelState &model, VisionIpcClient &vipc_client_main, VisionIpcCl
|
||||||
LOGE("vipc_client_extra no frame");
|
LOGE("vipc_client_extra no frame");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
LOGT("vicp read extra")
|
LOGT("vicp read extra");
|
||||||
|
|
||||||
if (std::abs((int64_t)meta_main.timestamp_sof - (int64_t)meta_extra.timestamp_sof) > 10000000ULL) {
|
if (std::abs((int64_t)meta_main.timestamp_sof - (int64_t)meta_extra.timestamp_sof) > 10000000ULL) {
|
||||||
LOGE("frames out of sync! main: %d (%.5f), extra: %d (%.5f)",
|
LOGE("frames out of sync! main: %d (%.5f), extra: %d (%.5f)",
|
||||||
|
|
|
@ -8,7 +8,6 @@ from tabulate import tabulate
|
||||||
json_file = open('timestamps.json')
|
json_file = open('timestamps.json')
|
||||||
timestamps = json.load(json_file)
|
timestamps = json.load(json_file)
|
||||||
|
|
||||||
|
|
||||||
for frame_id, services in timestamps.items():
|
for frame_id, services in timestamps.items():
|
||||||
t0 = min([min([min(times) for times in events.values()]) for events in services.values()])
|
t0 = min([min([min(times) for times in events.values()]) for events in services.values()])
|
||||||
print(frame_id)
|
print(frame_id)
|
||||||
|
|
|
@ -28,7 +28,7 @@ for msg in lr:
|
||||||
translationdict[logMonoTime] = frame_id
|
translationdict[logMonoTime] = frame_id
|
||||||
|
|
||||||
|
|
||||||
print(translationdict)
|
i = 0
|
||||||
for msg in lr:
|
for msg in lr:
|
||||||
if msg.which() == "logMessage" and "timestamp" in msg.logMessage:
|
if msg.which() == "logMessage" and "timestamp" in msg.logMessage:
|
||||||
msg = msg.logMessage.replace("'", '"').replace('"{', "{").replace('}"', "}")
|
msg = msg.logMessage.replace("'", '"').replace('"{', "{").replace('}"', "}")
|
||||||
|
@ -38,11 +38,14 @@ for msg in lr:
|
||||||
time = jmsg['msg']['timestamp']['time']
|
time = jmsg['msg']['timestamp']['time']
|
||||||
frame_id = jmsg['ctx']['frame_id']
|
frame_id = jmsg['ctx']['frame_id']
|
||||||
if jmsg['msg']['timestamp']['translate']:
|
if jmsg['msg']['timestamp']['translate']:
|
||||||
|
try:
|
||||||
frame_id = translationdict[int(frame_id)]
|
frame_id = translationdict[int(frame_id)]
|
||||||
timestamps[frame_id][service][event].append(time)
|
except:
|
||||||
|
i+=1
|
||||||
|
continue
|
||||||
|
timestamps[int(frame_id)][service][event].append(time)
|
||||||
|
|
||||||
|
print("Num failed translations:", i)
|
||||||
print(timestamps[1].keys())
|
|
||||||
|
|
||||||
with open('timestamps.json', 'w') as outfile:
|
with open('timestamps.json', 'w') as outfile:
|
||||||
json.dump(timestamps, outfile)
|
json.dump(timestamps, outfile)
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue