Browse Source

change pointcloudviewer. for fix 22.04 show, must need pcl > 1.12.

yuchuli 1 year ago
parent
commit
5aed979f83

+ 2 - 1
src/common/common/xodr/OpenDrive/Road.cpp

@@ -2432,7 +2432,7 @@ double Road::GetDis(const double x,const double y, const double hdg, double & fR
             else
             {
                 double ratio = (y1-y0)/(x1-x0);
-                double hdgpoint = atan(ratio);
+                hdgpoint = atan(ratio);
                 if(ratio > 0)
                 {
                     if(y1 > y0)
@@ -2523,6 +2523,7 @@ short int Road::GetLaneCoords(double s_check, double t_check,double &retX, doubl
     nrtn = GetGeometryCoords(s_check,fRefX,fRefY,fRefHDG);
     if(nrtn<0)
     {
+        std::cout<<" s_check error. GetGeometryCoords fail. "<<" s_check: "<<s_check<<" roadlen: "<<this->GetRoadLength()<<" road id: "<<this->GetRoadId().data()<<std::endl;
         return nrtn;
     }
 

+ 4 - 0
src/map/odtolanelet/odtolanelet.cpp

@@ -321,6 +321,10 @@ void odtolanelet::LanePointToPoint3D(std::vector<iv::LanePoint> & xvectorLanePoi
     unsigned int nLPsize = static_cast<unsigned int>(xvectorLanePoint.size());
     for(i=0;i<nLPsize;i++)
     {
+//        if((fabs(xvectorLanePoint[i].mx)<0.001)&&(fabs(xvectorLanePoint[i].my)<0.001))
+//        {
+//            std::cout<<" zero point. "<<" i:"<<i<<std::endl;
+//        }
         lanelet::Point3d xPoint(mid,xvectorLanePoint[i].mx,xvectorLanePoint[i].my,xvectorLanePoint[i].mz);
         std::string strmgrscode;
         Getmgrscode(xvectorLanePoint[i].mx,xvectorLanePoint[i].my,strmgrscode);

+ 1 - 1
src/map/odtolanelet/roadsample.cpp

@@ -305,7 +305,7 @@ int RoadSample::SampleLanePoint(Road * pRoad,LaneSection * pLS, double fS,std::v
 
     iv::LanePoint xLanePoint;
     for(i=0;i<nLeftLaneCount;i++)
-    {      
+    {
         pRoad->GetLaneCoords(fS,xvectorLeftLaneT[i],xLanePoint.mx,xLanePoint.my,xLanePoint.mz,xLanePoint.mhdg);
         LaneRoadMark xRoadMark = pRoad->GetLaneRoadMarkValue(fS,static_cast<int>(i+1));
         xLanePoint.mfmarkwidth = xRoadMark.GetWidth();

+ 14 - 3
src/tool/pointcloudviewer/main.cpp

@@ -158,6 +158,10 @@ void ListenPointCloud(const char * strdata,const unsigned int nSize,const unsign
 
 void viewerOneOff (pcl::visualization::PCLVisualizer& viewer)
 {
+    std::cout<<" PCL_VERSION : "<<PCL_VERSION<<std::endl;
+    if(PCL_VERSION > 101200) viewer.getRenderWindow()->GlobalWarningDisplayOff(); // Add This Line
+
+    std::cout<<" run hear."<<std::endl;
     //设置背景颜色
     viewer.setBackgroundColor(0.0,0.0,0.0);
 
@@ -211,6 +215,7 @@ void viewerOneOff (pcl::visualization::PCLVisualizer& viewer)
 
 void viewerPsycho (pcl::visualization::PCLVisualizer& viewer)
 {
+//    viewer.getRenderWindow()->GlobalWarningDisplayOff(); // Add This Line
 //    static unsigned count = 0;
     std::stringstream ss;
  //   ss << "Once per viewer loop: " << count++;
@@ -228,6 +233,8 @@ void viewerPsycho (pcl::visualization::PCLVisualizer& viewer)
         viewer.setCameraPosition(0,0,100,0,0,0,0,1,0);
     }
 
+
+
 //    std::vector<pcl::visualization::Camera> xvectorcam;
 //    viewer.getCameras(xvectorcam);
 //    std::cout<<"camera size: "<<xvectorcam.size()<<std::endl;
@@ -263,6 +270,8 @@ int main(int argc, char *argv[])
     showversion("pointcloudviewer");
     QCoreApplication a(argc, argv);
 
+
+
     snprintf(gstr_memname,255,"lidar_pc");
 //    snprintf(gstr_memname,255,"lidar_pc_filter");
 //    snprintf(gstr_memname,255,"lidarpc_center");
@@ -277,8 +286,6 @@ int main(int argc, char *argv[])
     LoadParam("pointcloudviewer.xml");
 
 
-
-
     //This will only get called once
     viewer1.runOnVisualizationThreadOnce (viewerOneOff);
 
@@ -294,15 +301,19 @@ int main(int argc, char *argv[])
 
 //    viewer1.showCloud(point_cloud);
 
+
     while(!viewer1.wasStopped())
     {
         std::this_thread::sleep_for(std::chrono::milliseconds(10));
 
+
     }
     return 0;
 
-
     return a.exec();
 
+
+
+
 }
 

+ 27 - 19
src/tool/pointcloudviewer/pointcloudviewer.pro

@@ -1,6 +1,6 @@
 QT -= gui
 
-CONFIG += c++14 #console
+CONFIG += c++1z #console
 CONFIG -= app_bundle
 
 QMAKE_LFLAGS += -no-pie
@@ -31,24 +31,31 @@ INCLUDEPATH += /usr/include/pcl-1.10
 
 unix:INCLUDEPATH += /usr/include/pcl-1.12
 
-unix:LIBS +=  -lpcl_common\
-        -lpcl_features\
-        -lpcl_filters\
-        -lpcl_io\
-        -lpcl_io_ply\
-        -lpcl_kdtree\
-        -lpcl_keypoints\
-        -lpcl_octree\
-        -lpcl_outofcore\
-        -lpcl_people\
-        -lpcl_recognition\
-        -lpcl_registration\
-        -lpcl_sample_consensus\
-        -lpcl_search\
-        -lpcl_segmentation\
-        -lpcl_surface\
-        -lpcl_tracking\
-        -lpcl_visualization
+#unix:LIBS +=  -lpcl_common\
+#        -lpcl_features\
+#        -lpcl_filters\
+#        -lpcl_io\
+#        -lpcl_io_ply\
+#        -lpcl_kdtree\
+#        -lpcl_keypoints\
+#        -lpcl_octree\
+#        -lpcl_outofcore\
+#        -lpcl_people\
+#        -lpcl_recognition\
+#        -lpcl_registration\
+#        -lpcl_sample_consensus\
+#        -lpcl_search\
+#        -lpcl_segmentation\
+#        -lpcl_surface\
+#        -lpcl_tracking\
+#        -lpcl_visualization
+
+
+LIBS += -lpcl_visualization
+
+LIBS += -L/home/yuchuli/git/pcl/build/lib
+
+
 
 INCLUDEPATH += $$PWD/../../../include/
 LIBS += -L$$PWD/../../../bin/ -lxmlparam -lmodulecomm -livlog -livfault
@@ -60,6 +67,7 @@ LIBS += -L$$PWD/../../../bin/ -lxmlparam -lmodulecomm -livlog -livfault
 
 LIBS += -lboost_system
 
+#LIBS += /home/yuchuli/git/pcl/build/lib/libpcl_visualization.so.1.14
 #LIBS += -lvtkCommonExecutionModel-9.1 -lvtkCommonCore-9.1 -lvtkRenderingLOD-9.1 -lvtkRenderingCore-9.1 \
 #       -lvtkFiltersSources-9.1