فهرست منبع

change driver_map_xodrload.

yuchuli 2 سال پیش
والد
کامیت
77cb2c76f9

+ 12 - 6
src/driver/driver_cloud_grpc_client_h264/grpcclient.cpp

@@ -37,9 +37,12 @@ grpcclient::grpcclient(std::string stryamlpath)
     mstrpicmsgname[3] = "h264right";
 
     unsigned int i;
-    for(i=0;i<mvectormsgunit.size();i++)
+    if(mbFrameUpdate)
     {
-        mvectormsgunit[i].mpa = iv::modulecomm::RegisterRecv(mvectormsgunit[i].mstrmsgname,ListenData);
+        for(i=0;i<mvectormsgunit.size();i++)
+        {
+            mvectormsgunit[i].mpa = iv::modulecomm::RegisterRecv(mvectormsgunit[i].mstrmsgname,ListenData);
+        }
     }
 
     for(i=0;i<mvectorctrlmsgunit.size();i++)
@@ -54,12 +57,15 @@ grpcclient::grpcclient(std::string stryamlpath)
     }
 
 
-    for(i=0;i<NUM_CAM;i++)
+    if(mbFrameUpdate)
     {
-        unsigned int j;
-        for(j=0;j<NUM_THREAD_PERCAM;j++)
+        for(i=0;i<NUM_CAM;i++)
         {
-            mpThread[i*NUM_THREAD_PERCAM + j] = new std::thread(&grpcclient::threadpicupload,this,i);
+            unsigned int j;
+            for(j=0;j<NUM_THREAD_PERCAM;j++)
+            {
+                mpThread[i*NUM_THREAD_PERCAM + j] = new std::thread(&grpcclient::threadpicupload,this,i);
+            }
         }
     }
 

+ 2 - 0
src/driver/driver_cloud_grpc_client_h264/grpcclient.h

@@ -134,6 +134,8 @@ private:
 
     int mnskip = 2;
 
+    bool mbFrameUpdate = false;
+
 };
 
 #endif // GRPCCLIENT_H

+ 1 - 1
src/driver/driver_map_xodrload/main.cpp

@@ -378,7 +378,7 @@ void ShareMapGlobal(std::vector<PlanPoint> & xvectorPlan)
 
     }
 
-    int bytesize = static_cast<int>(xglobal.ByteSizeLong()) ;
+    int bytesize = static_cast<int>(xglobal.ByteSize()) ;
 
     std::shared_ptr<char> pstr_ptr = std::shared_ptr<char>(new char[bytesize]);
     if(xglobal.SerializePartialToArray(pstr_ptr.get(),bytesize))