diff --git a/selfdrive/modeld/modeld.cc b/selfdrive/modeld/modeld.cc index ebfed713c2..f367c99097 100644 --- a/selfdrive/modeld/modeld.cc +++ b/selfdrive/modeld/modeld.cc @@ -181,7 +181,7 @@ int main(int argc, char **argv) { cl_mem yuv_cl; VisionBuf yuv_ion = visionbuf_allocate_cl(buf_info.buf_len, device_id, context, &yuv_cl); - uint32_t last_vipc_frame_id = 0; + uint32_t frame_id = 0, last_vipc_frame_id = 0; double last = 0; int desire = -1; while (!do_exit) { @@ -202,6 +202,7 @@ int main(int argc, char **argv) { if (sm.update(0) > 0){ // TODO: path planner timeout? desire = ((int)sm["pathPlan"].getPathPlan().getDesire()) - 1; + frame_id = sm["frame"].getFrame().getFrameId(); } double mt1 = 0, mt2 = 0; @@ -212,8 +213,7 @@ int main(int argc, char **argv) { } mat3 model_transform = matmul3(yuv_transform, transform); - uint32_t frame_id = sm["frame"].getFrame().getFrameId(); - + mt1 = millis_since_boot(); // TODO: don't make copies!