فهرست منبع

lidar show erro & green line

lijinliang 4 سال پیش
والد
کامیت
f2af9a3716
2فایلهای تغییر یافته به همراه31 افزوده شده و 1 حذف شده
  1. 11 0
      src/detection/detection_lidar_cnntogrid/main.cpp
  2. 20 1
      src/ui/ui_ads_hmi/ADCIntelligentVehicle.cpp

+ 11 - 0
src/detection/detection_lidar_cnntogrid/main.cpp

@@ -106,6 +106,17 @@ static void cnntogird(iv::lidar::objectarray * pobjarray)
         }
 
     }
+
+    iv::ObstacleBasic * pobs = new iv::ObstacleBasic;
+    pobs->nomal_x = 300;
+    pobs->nomal_y = 300;
+    pobs->nomal_z = 1;
+
+    pobs->speed_x = 0;
+    pobs->speed_y = 0;
+
+    lidar_obs->push_back(*pobs);
+    delete pobs;
 //    if(lidar_obs->size() >0)glidar_obs->writemsg((char *)(lidar_obs->data()),lidar_obs->size()*sizeof(iv::ObstacleBasic));
 
     if(lidar_obs->size() >0)iv::modulecomm::ModuleSendMsg(glidar_obs,(char *)(lidar_obs->data()),lidar_obs->size()*sizeof(iv::ObstacleBasic));

+ 20 - 1
src/ui/ui_ads_hmi/ADCIntelligentVehicle.cpp

@@ -824,7 +824,26 @@ void ADCIntelligentVehicle::paintEvent(QPaintEvent *)
         painter->setRenderHint(QPainter::Antialiasing, true);//设置反锯齿模式,好看一点
 
         int pointx = 450, pointy = 700;//确定坐标轴起点坐标,这里定义(35,280)
-        double x0[22000], y0[22000], lng[22000], x1[22000], y1[22000], x2[22000], y2[22000];
+        //        double x0[22000], y0[22000], lng[22000], x1[22000], y1[22000], x2[22000], y2[22000];
+
+                double * x0, * y0, * lng, * x1, * y1, * x2, * y2;
+                std::shared_ptr<double> ptrx0,ptry0,ptrlng,ptrx1,ptry1,ptrx2,ptry2;
+                int nmapsize = navigation_data.size();
+                x0 = new double[nmapsize];
+                y0 = new double[nmapsize];
+                lng = new double[nmapsize];
+                x1 = new double[nmapsize];
+                y1 = new double[nmapsize];
+                x2 = new double[nmapsize];
+                y2 = new double[nmapsize];
+
+                ptrx0.reset(x0);
+                ptry0.reset(y0);
+                ptrlng.reset(lng);
+                ptrx1.reset(x1);
+                ptry1.reset(y1);
+                ptrx2.reset(x2);
+                ptry2.reset(y2);
         double xx = 0, yy = 0;
         double sumx = 0, sumy = 0;//, ave_x = 0, ave_y = 0;
         int sizeN = navigation_data.size();