Browse Source

modify mobileye bug, no data report when 0 obs detected

lijinliang 3 years ago
parent
commit
83a909e645
1 changed files with 7 additions and 1 deletions
  1. 7 1
      src/detection/detection_mobileye/main.cpp

+ 7 - 1
src/detection/detection_mobileye/main.cpp

@@ -158,6 +158,12 @@ void ProcCANMsg(iv::can::canraw xmsg)
         //std::cout << ServiceCarStatus.obstacleStatus.num_obstacles<< std::endl;
         gnum_obstacles = num_obstacles;
 
+        gobs_count = 0;
+        gmobileye.clear_xobj();
+        gmobileye.clear_xmsgtime();
+        gmobileye.clear_numobstacles();
+        glane_sig = 0;
+
         //timestamp
         msgtime = xdata[1];
 
@@ -355,7 +361,7 @@ void ProcCANMsg(iv::can::canraw xmsg)
 
             iv::mobileye::obs * pxobs = gmobileye.add_xobj();
             pxobs->CopyFrom(gobs);
-            gobs_count++;
+            gobs_count=(xmsg.id()-0x73b)/3+1;
             gMobEyeIvlog->verbose("mobileyeobs", "nums:%d cur_count:%d, obs_id:%d, pos_x:%f, pos_y:%f \n",\
                                   gnum_obstacles, gobs_count, gobs.id(), gobs.pos_x(), gobs.pos_y());
         }