modeld: read frame_id if sm.update(0)>0 (#1947)

* read frameid if sm.update(0)>0

* move postion

same line
pull/1961/head
Dean Lee 5 years ago committed by GitHub
parent 80acb32825
commit f80acad519
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      selfdrive/modeld/modeld.cc

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

Loading…
Cancel
Save