RTabmap 编译和运行中跳过的坑

1、编译环境介绍及说明

Ubuntu 14.04
ros-indigo
CUDA 8.0 nvidia gtx 1070

遇到的主要问题
1. librtabmap_gui.so.0.15: cannot open shared object file https://github.com/introlab/rtabmap_ros/issues/222
2. /usr/bin/ld: cannot find -lopencv_dep_cudart https://github.com/introlab/rtabmap/issues/269

2、安装vtk6.3.0

参考教程
(1)下载qt5.6 http://download.qt.io/official_releases/qt/5.6/5.6.0/

$ chmod +x qt-opensource-linux-x64-5.6.0.run
$ ./qt-opensource-linux-x64-5.6.0.run

qtcreator的配置
(2)编译vtk6.3.0

$ cd VTK-6.3.0/build
$ cmake -DVTK_QT_VERSION:STRING=5 -DQT_QMAKE_EXECUTABLE:PATH=/home/turtlebot/Qt5.6.0/5.6/gcc_64/bin/qmake -DVTK_Group_Qt:BOOL=ON -DCMAKE_PREFIX_PATH:PATH=/home/turtlebot/Qt5.6.0/5.6/gcc_64/lib/cmake -DBUILD_SHARED_LIBS:BOOL=ON ..

但是出现错误:

CMake Error at /home/turtlebot/Qt5.6.0/5.6/gcc_64/lib/cmake/Qt5/Qt5Config.cmake:26 (find_package):
  Could not find a package configuration file provided by "Qt5WebKitWidgets"
  with any of the following names:

    Qt5WebKitWidgetsConfig.cmake
    qt5webkitwidgets-config.cmake

  Add the installation prefix of "Qt5WebKitWidgets" to CMAKE_PREFIX_PATH or
  set "Qt5WebKitWidgets_DIR" to a directory containing one of the above
  files.  If "Qt5WebKitWidgets" provides a separate development package or
  SDK, be sure it has been installed.
Call Stack (most recent call first):
  GUISupport/QtWebkit/CMakeLists.txt:10 (find_package)


-- Configuring incomplete, errors occurred!

所以,重新下载了VTK7.1.1, 地址

$ cd VTK-7.1.1 & mkdir build & cd build
$ cmake -DVTK_QT_VERSION:STRING=5 -DQT_QMAKE_EXECUTABLE:PATH=/home/turtlebot/Qt5.6.0/5.6/gcc_64/bin/qmake -DVTK_Group_Qt:BOOL=ON -DCMAKE_PREFIX_PATH:PATH=/home/turtlebot/Qt5.6.0/5.6/gcc_64/lib/cmake -DBUILD_SHARED_LIBS:BOOL=ON ..
$ make

3、编译pcl

选择版本为1.8

$ cd pcl
$ mkdir build & cd build
$ cmake ..
$ make
$ sudo make install

使用pcl_viewer测试,点云显示正常

4、编译Rtabmap

$ cd rtabmap
$ mkdir build & cd build
$ cmake ..

cmake没有问题,当make时出现错误

[  6%] Linking CXX executable ../../../bin/rtabmap-imagesJoiner
/usr/bin/ld: cannot find -lopencv_dep_cudart
collect2: error: ld returned 1 exit status
make[2]: *** [../bin/rtabmap-imagesJoiner] Error 1

解决方法(https://github.com/opencv/opencv/issues/6542):

$ cmake -D CUDA_USE_STATIC_CUDA_RUNTIME=OFF ..
$ make

测试rtabmap:

$ cd ../bin
$ ./rtabmap

可以显示窗口,测试通过!

$ cd ../build
$ sudo make install

5、编译rtabmap_ros
使用catkin_make编译时,出现错误/usr/bin/ld: cannot find -lopencv_dep_cudart。这个问题主要是opencv安装的问题,所以重新编译安装OpenCV
下载opencv-2.4.13, 安装教程

$ cd opencv-2.4.13
$ mkdir build & cd build
$ cmake -D CMAKE_BUILD_TYPE=RELEASE ..

出现警告

CMake Warning at cmake/OpenCVPackaging.cmake:23 (message):
  CPACK_PACKAGE_VERSION does not match version provided by version.hpp
  header!
Call Stack (most recent call first):
  CMakeLists.txt:1105 (include)

请打开opencv-2.4.13\CMakeLists.txt,修改set(OPENCV_VCSVERSION “unknown”)为set(OPENCV_VCSVERSION “2.4.13”)

if(GIT_EXECUTABLE)
  execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags --always --dirty --match "2.[0-9].[0-9]*"
    WORKING_DIRECTORY "${OpenCV_SOURCE_DIR}"
    OUTPUT_VARIABLE OPENCV_VCSVERSION
    RESULT_VARIABLE GIT_RESULT
    ERROR_QUIET
    OUTPUT_STRIP_TRAILING_WHITESPACE
  )
  if(NOT GIT_RESULT EQUAL 0)
    set(OPENCV_VCSVERSION "2.4.13")
  endif()
else()
  # We don't have git:
  set(OPENCV_VCSVERSION "2.4.13")
endif()

各种尝试想使用cuda在opencv中,但是最后都失败,所以决定不适用cuda了。关于cmake cannot find -lopencv_dep_cudart的讨论

$ sudo make uninstall
$ rm -rf *
$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D WITH_OPENCL=OFF -D WITH_CUDA=OFF ..
$ make
$ sudo make install

之后先卸载rtabmap,之后在重新编译安装,最后编译rtabmap_ros

$ cd rtabmap/build
$ sudo make uninstall
$ cmake ..  [<---double dots included]
$ make
$ sudo make install

$ cd ~/catkin_ws
$ git clone https://github.com/introlab/rtabmap_ros.git src/rtabmap_ros
$ catkin_make

当编译rtabmap_ros时初夏下面错误

/usr/bin/ld: warning: libpcl_visualization.so.1.8, needed by /usr/local/lib/librtabmap_gui.so, may conflict with libpcl_visualization.so.1.7
/usr/local/lib/librtabmap_gui.so: undefined reference to `QGraphicsEllipseItem::contains(QPointF const&) const@Qt_5'
/usr/local/lib/libvtkGUISupportQt-7.1.so.1: undefined reference to `QPainter::drawPath(QPainterPath const&)@Qt_5'
/usr/local/lib/librtabmap_gui.so: undefined reference to `QGridLayout::addWidget(QWidget*, int, int, QFlags<Qt::AlignmentFlag>)@Qt_5'
/usr/local/lib/librtabmap_gui.so: undefined reference to `QLayout::setSpacing(int)@Qt_5'
/usr/local/lib/libvtkGUISupportQt-7.1.so.1: undefined reference to `QTouchEvent::TouchPoint::state() const@Qt_5'
/usr/local/lib/librtabmap_gui.so: undefined reference to `QMenu::clear()@Qt_5'
/usr/local/lib/librtabmap_gui.so: undefined reference to `QMutex::lock()@Qt_5'

应该是pcl版本不对,所以改成1.7.0编译安装

$ cd pcl/build
$ sudo make uninstall
$ rm -rf *
$ cmake ..
$ make

还是关于vtk的问题

/home/turtlebot/ThridPKG/pcl/io/src/vtk_lib_io.cpp: In functionint pcl::io::savePolygonFileVTK(const string&, const pcl::PolygonMesh&)’:
/home/turtlebot/ThridPKG/pcl/io/src/vtk_lib_io.cpp:181:16: error: ‘class vtkPolyDataWriter’ has no member named ‘SetInput’
   poly_writer->SetInput (poly_data);
                ^
/home/turtlebot/ThridPKG/pcl/io/src/vtk_lib_io.cpp: In functionint pcl::io::savePolygonFilePLY(const string&, const pcl::PolygonMesh&)’:
/home/turtlebot/ThridPKG/pcl/io/src/vtk_lib_io.cpp:197:16: error: ‘class vtkPLYWriter’ has no member named ‘SetInput’
   poly_writer->SetInput (poly_data);
                ^
/home/turtlebot/ThridPKG/pcl/io/src/vtk_lib_io.cpp: In functionint pcl::io::savePolygonFileSTL(const string&, const pcl::PolygonMesh&)’:
/home/turtlebot/ThridPKG/pcl/io/src/vtk_lib_io.cpp:212:14: error: ‘class vtkPolyData’ has no member named ‘Update’
   poly_data->Update ();
              ^
/home/turtlebot/ThridPKG/pcl/io/src/vtk_lib_io.cpp:214:16: error: ‘class vtkSTLWriter’ has no member named ‘SetInput’
   poly_writer->SetInput (poly_data);
                ^
/home/turtlebot/ThridPKG/pcl/io/src/vtk_lib_io.cpp: In functionint pcl::io::vtk2mesh(const vtkSmartPointer<vtkPolyData>&, pcl::PolygonMesh&)’:
/home/turtlebot/ThridPKG/pcl/io/src/vtk_lib_io.cpp:280:53: warning: ‘void vtkAOSDataArrayTemplate<ValueTypeT>::GetTupleValue(vtkIdType, vtkAOSDataArrayTemplate<ValueTypeT>::ValueType*) [with ValueTypeT = unsigned char; vtkIdType = long long int; vtkAOSDataArrayTemplate<ValueTypeT>::ValueType = unsigned char]’ is deprecated (declared at /usr/local/include/vtk-7.1/vtkAOSDataArrayTemplate.h:218) [-Wdeprecated-declarations]
       poly_colors->GetTupleValue (i, &point_color[0]);
                                                     ^
/home/turtlebot/ThridPKG/pcl/io/src/vtk_lib_io.cpp:309:40: warning: ‘void vtkAOSDataArrayTemplate<ValueTypeT>::GetTupleValue(vtkIdType, vtkAOSDataArrayTemplate<ValueTypeT>::ValueType*) [with ValueTypeT = float; vtkIdType = long long int; vtkAOSDataArrayTemplate<ValueTypeT>::ValueType = float]’ is deprecated (declared at /usr/local/include/vtk-7.1/vtkAOSDataArrayTemplate.h:218) [-Wdeprecated-declarations]
       normals->GetTupleValue (i, normal);
                                        ^
/home/turtlebot/ThridPKG/pcl/io/src/vtk_lib_io.cpp: In functionint pcl::io::vtk2mesh(const vtkSmartPointer<vtkPolyData>&, pcl::TextureMesh&)’:
/home/turtlebot/ThridPKG/pcl/io/src/vtk_lib_io.cpp:373:44: warning: ‘void vtkAOSDataArrayTemplate<ValueTypeT>::GetTupleValue(vtkIdType, vtkAOSDataArrayTemplate<ValueTypeT>::ValueType*) [with ValueTypeT = float; vtkIdType = long long int; vtkAOSDataArrayTemplate<ValueTypeT>::ValueType = float]’ is deprecated (declared at /usr/local/include/vtk-7.1/vtkAOSDataArrayTemplate.h:218) [-Wdeprecated-declarations]
       texture_coords->GetTupleValue (i, tex);
                                            ^
/home/turtlebot/ThridPKG/pcl/io/src/vtk_lib_io.cpp: In functionint pcl::io::mesh2vtk(const pcl::PolygonMesh&, vtkSmartPointer<vtkPolyData>&)’:
/home/turtlebot/ThridPKG/pcl/io/src/vtk_lib_io.cpp:452:42: warning: ‘vtkIdType vtkAOSDataArrayTemplate<ValueTypeT>::InsertNextTupleValue(const ValueType*) [with ValueTypeT = unsigned char; vtkIdType = long long int; vtkAOSDataArrayTemplate<ValueTypeT>::ValueType = unsigned char]’ is deprecated (declared at /usr/local/include/vtk-7.1/vtkAOSDataArrayTemplate.h:221) [-Wdeprecated-declarations]
       colors->InsertNextTupleValue (color);
                                          ^
/home/turtlebot/ThridPKG/pcl/io/src/vtk_lib_io.cpp:469:44: warning: ‘vtkIdType vtkAOSDataArrayTemplate<ValueTypeT>::InsertNextTupleValue(const ValueType*) [with ValueTypeT = float; vtkIdType = long long int; vtkAOSDataArrayTemplate<ValueTypeT>::ValueType = float]’ is deprecated (declared at /usr/local/include/vtk-7.1/vtkAOSDataArrayTemplate.h:221) [-Wdeprecated-declarations]
       normals->InsertNextTupleValue (normal);
                                            ^
/home/turtlebot/ThridPKG/pcl/io/src/vtk_lib_io.cpp: In functionvoid pcl::io::saveRangeImagePlanarFilePNG(const string&, const pcl::RangeImagePlanar&)’:
/home/turtlebot/ThridPKG/pcl/io/src/vtk_lib_io.cpp:486:39: error: no matching function for call to ‘vtkImageData::SetNumberOfScalarComponents(int)’
   image->SetNumberOfScalarComponents(1);
                                       ^
/home/turtlebot/ThridPKG/pcl/io/src/vtk_lib_io.cpp:486:39: note: candidate is:
In file included from /home/turtlebot/ThridPKG/pcl/io/include/pcl/io/vtk_lib_io.h:72:0,
                 from /home/turtlebot/ThridPKG/pcl/io/src/vtk_lib_io.cpp:38:
/usr/local/include/vtk-7.1/vtkImageData.h:361:15: note: static void vtkImageData::SetNumberOfScalarComponents(int, vtkInformation*)
   static void SetNumberOfScalarComponents( int n, vtkInformation* meta_data);
               ^
/usr/local/include/vtk-7.1/vtkImageData.h:361:15: note:   candidate expects 2 arguments, 1 provided
/home/turtlebot/ThridPKG/pcl/io/src/vtk_lib_io.cpp:487:10: error: ‘class vtkImageData’ has no member named ‘SetScalarTypeToFloat’
   image->SetScalarTypeToFloat();
          ^
/home/turtlebot/ThridPKG/pcl/io/src/vtk_lib_io.cpp:488:26: error: no matching function for call to ‘vtkImageData::AllocateScalars()’
   image->AllocateScalars();
                          ^
/home/turtlebot/ThridPKG/pcl/io/src/vtk_lib_io.cpp:488:26: note: candidates are:
In file included from /home/turtlebot/ThridPKG/pcl/io/include/pcl/io/vtk_lib_io.h:72:0,
                 from /home/turtlebot/ThridPKG/pcl/io/src/vtk_lib_io.cpp:38:
/usr/local/include/vtk-7.1/vtkImageData.h:286:16: note: virtual void vtkImageData::AllocateScalars(int, int)
   virtual void AllocateScalars(int dataType, int numComponents);
                ^
/usr/local/include/vtk-7.1/vtkImageData.h:286:16: note:   candidate expects 2 arguments, 0 provided
/usr/local/include/vtk-7.1/vtkImageData.h:294:16: note: virtual void vtkImageData::AllocateScalars(vtkInformation*)
   virtual void AllocateScalars(vtkInformation* pipeline_info);
                ^
/usr/local/include/vtk-7.1/vtkImageData.h:294:16: note:   candidate expects 1 argument, 0 provided
/home/turtlebot/ThridPKG/pcl/io/src/vtk_lib_io.cpp:507:47: error: ‘class vtkImageData’ has no member named ‘GetProducerPort’
   shiftScaleFilter->SetInputConnection(image->GetProducerPort());

我发现pcl 1.7.0是2013提交的,可能版本有点老,所以改成1.7.2试试,它是2014提交的。

$ git checkout pcl-1.7.2
$ cd build
$ rm -rf *
$ cmake ..
$ make

还是编译失败

pcl/visualization/src/pcl_visualizer.cpp:59:36: fatal error: vtkVisibleCellSelector.h: No such file or directory
 #include <vtkVisibleCellSelector.h>

所以,现在想把vtk降回6.0版本,所以qt也应该降回4.0。参考教程

首先下载qt4.8.6,编译安装

$ wget http://download.qt-project.org/official_releases/qt/4.8/4.8.6/qt-everywhere-opensource-src-4.8.6.tar.gz
$ tar xzf qt-everywhere-opensource-src-4.8.6.tar.gz
$ cd qt-everywhere-opensource-src-4.8.6
$ ./configure # go through the dialogue 
$ make -j<# of cores>
$ sudo make install  # install in /usr/local/Trolltech

再编译vtk-6.3.0

$ cd vtk-6.3.0/build
$ cmake -DQT_QMAKE_EXECUTABLE:PATH=/home/turtlebot/ThridPKG/qt-everywhere-opensource-src-4.8.6/bin/qmake -DVTK_Group_Qt:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON ..
$ make -j8
$ sudo make install

继续重新编译pcl。
卸载rtabmap,重新编译。但是测试时出现错误:

$ ./rtabmap-databaseViewer ~/.ros/rtabmap.db 
*** Error in `./rtabmap-databaseViewer': realloc(): invalid pointer: 0x00007fdf23ab6840 ***
Aborted (core dumped)

其实在cmake的时候就会爆出关于qt5的警告

CMake Warning at /usr/lib/x86_64-linux-gnu/cmake/Qt5/Qt5Config.cmake:26 (find_package):
  Could not find a package configuration file provided by "Qt5Svg" with any
  of the following names:

    Qt5SvgConfig.cmake
    qt5svg-config.cmake

  Add the installation prefix of "Qt5Svg" to CMAKE_PREFIX_PATH or set
  "Qt5Svg_DIR" to a directory containing one of the above files.  If "Qt5Svg"
  provides a separate development package or SDK, be sure it has been
  installed.
Call Stack (most recent call first):
  CMakeLists.txt:223 (FIND_PACKAGE)


CMake Warning at /usr/lib/x86_64-linux-gnu/cmake/Qt5/Qt5Config.cmake:35 (message):
  Failed to find Qt5 component "Svg" config file at
  "/usr/lib/x86_64-linux-gnu/cmake/Qt5Svg/Qt5SvgConfig.cmake"
Call Stack (most recent call first):
  CMakeLists.txt:223 (FIND_PACKAGE)


-- Found Freenect: /opt/ros/indigo/include/libfreenect
CMake Warning at cmake_modules/FindKinectSDK2.cmake:71 (message):
  Directory "" not found.
Call Stack (most recent call first):
  cmake_modules/FindKinectSDK2.cmake:119 (check_dir)
  CMakeLists.txt:270 (FIND_PACKAGE)


-- KinectSDK2_FOUND : FALSE
-- Found OpenNI2: /usr/include/openni2
-- Found DC1394: /usr/include/dc1394
-- Found g2o: /usr/local/include;/usr/include/suitesparse;/usr/include/suitesparse
-- GTSAM include directory:  /usr/local/lib/cmake/GTSAM/../../../include;/usr/include;/usr/local/include/gtsam/3rdparty/Eigen/
-- Found cvsba: /usr/local/include
-- Found RealSense: /opt/ros/indigo/include
-- Found octomap: /opt/ros/indigo/include
-- Found Pthreads
CMake Warning (dev) at /usr/lib/x86_64-linux-gnu/cmake/Qt5Core/Qt5CoreMacros.cmake:224 (configure_file):
  configure_file called with unknown argument(s):

   COPY_ONLY

Call Stack (most recent call first):
  guilib/src/CMakeLists.txt:68 (QT5_ADD_RESOURCES)

我的vtk6.3.0和pcl1.7.2都使用的是qt4.8.6,但是rtabmap优先查找qt5。所以删除到查找qt5的语句(git diff):

 # ANDROID_PREBUILD (early exit if true)
@@ -217,18 +217,10 @@ IF(WITH_QT)

     # If Qt is here, the GUI will be built
     # look for Qt5 (if vtk>5 is installed) before Qt4
-    IF("${VTK_MAJOR_VERSION}" GREATER 5)
-        FIND_PACKAGE(Qt5 COMPONENTS Widgets Core Gui QUIET)
-        IF(Qt5_FOUND)
-             FIND_PACKAGE(Qt5 COMPONENTS Widgets Core Gui OPTIONAL_COMPONENTS Svg)
-        ENDIF(Qt5_FOUND)
-    ENDIF("${VTK_MAJOR_VERSION}" GREATER 5)
-
-    IF(NOT Qt5_FOUND)
-        FIND_PACKAGE(Qt4 COMPONENTS QtCore QtGui OPTIONAL_COMPONENTS QtSvg)
-    ENDIF(NOT Qt5_FOUND)
-        
-    IF(QT4_FOUND OR Qt5_FOUND)
+
+    FIND_PACKAGE(Qt4 COMPONENTS QtCore QtGui OPTIONAL_COMPONENTS QtSvg)
+
+    IF(QT4_FOUND)
         IF("${VTK_MAJOR_VERSION}" EQUAL 5)
             FIND_PACKAGE(QVTK REQUIRED) # only for VTK 5
         ELSE()
@@ -238,7 +230,7 @@ IF(WITH_QT)
                 SET(ADD_VTK_GUI_SUPPORT_QT_TO_CONF TRUE)
             ENDIF(value EQUAL -1)
         ENDIF()
-    ENDIF(QT4_FOUND OR Qt5_FOUND)
+    ENDIF(QT4_FOUND)

编译通过

第一次编译rtabmap遇到的错误

Could not find a configuration file for package “RTABMap” that is compatible with requested version “0.11.10”.
博客地址

——————– 分割线 ———————

新问题

编译rtabmap:

$ cmake ..
-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Checking for module 'eigen3'
--   Found eigen3, version 3.3.4
-- Found eigen: /usr/local/include/eigen3  
-- Checking for module 'openni-dev'
--   No package 'openni-dev' found
-- Found openni: /usr/lib/libOpenNI.so  
-- Checking for module 'openni2-dev'
--   No package 'openni2-dev' found
-- Found OpenNI2: /usr/lib/libOpenNI2.so  
-- Found libusb-1.0: /usr/include  
-- Checking for module 'flann'
--   Found flann, version 1.8.4
-- Found Flann: /usr/lib/x86_64-linux-gnu/libflann_cpp_s.a  
-- Found qhull: /usr/lib/x86_64-linux-gnu/libqhull.so  
-- Checking for module 'openni-dev'
--   No package 'openni-dev' found
-- Checking for module 'openni2-dev'
--   No package 'openni2-dev' found
-- Found PCL_COMMON: /usr/local/lib/libpcl_common.so  
-- Found PCL_OCTREE: /usr/local/lib/libpcl_octree.so  
-- Found PCL_IO: /usr/local/lib/libpcl_io.so  
-- Found PCL_KDTREE: /usr/local/lib/libpcl_kdtree.so  
-- Found PCL_SEARCH: /usr/local/lib/libpcl_search.so  
-- Found PCL_SURFACE: /usr/local/lib/libpcl_surface.so  
-- Found PCL_FILTERS: /usr/local/lib/libpcl_filters.so  
-- Found PCL_FEATURES: /usr/local/lib/libpcl_features.so  
-- Found PCL_REGISTRATION: /usr/local/lib/libpcl_registration.so  
-- Found PCL_SAMPLE_CONSENSUS: /usr/local/lib/libpcl_sample_consensus.so  
-- Found PCL_GEOMETRY: /usr/local/include/pcl-1.7  
-- Found PCL_SEGMENTATION: /usr/local/lib/libpcl_segmentation.so  
-- Found PCL_VISUALIZATION: /usr/local/lib/libpcl_visualization.so  
-- Try OpenMP C flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Try OpenMP CXX flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Found OpenMP: -fopenmp  
-- Found OpenMP
-- Found OpenCV: /usr/local/include/opencv;/usr/local/include
-- Found PCL: /usr/local/include/pcl-1.7;/usr/local/include/eigen3;/usr/include;/usr/include/ni;/usr/include/openni2;/usr/local/include/vtk-6.3
-- Found ZLIB: /usr/include
CMake Warning at /usr/lib/x86_64-linux-gnu/cmake/Qt5/Qt5Config.cmake:26 (find_package):
  Could not find a package configuration file provided by "Qt5Svg" with any
  of the following names:

    Qt5SvgConfig.cmake
    qt5svg-config.cmake

  Add the installation prefix of "Qt5Svg" to CMAKE_PREFIX_PATH or set
  "Qt5Svg_DIR" to a directory containing one of the above files.  If "Qt5Svg"
  provides a separate development package or SDK, be sure it has been
  installed.
Call Stack (most recent call first):
  CMakeLists.txt:224 (FIND_PACKAGE)


CMake Warning at /usr/lib/x86_64-linux-gnu/cmake/Qt5/Qt5Config.cmake:35 (message):
  Failed to find Qt5 component "Svg" config file at
  "/usr/lib/x86_64-linux-gnu/cmake/Qt5Svg/Qt5SvgConfig.cmake"
Call Stack (most recent call first):
  CMakeLists.txt:224 (FIND_PACKAGE)


-- Found Freenect: /opt/ros/indigo/include/libfreenect
CMake Warning at cmake_modules/FindKinectSDK2.cmake:71 (message):
  Directory "" not found.
Call Stack (most recent call first):
  cmake_modules/FindKinectSDK2.cmake:119 (check_dir)
  CMakeLists.txt:271 (FIND_PACKAGE)


-- KinectSDK2_FOUND : FALSE
-- Found OpenNI2: /usr/include/openni2
-- Found DC1394: /usr/include/dc1394
-- Found CSPARSE: /usr/include/suitesparse  
-- Old g2o version detected with c++03 interface (config file: /usr/local/include/g2o/config.h).
-- Found g2o: /usr/local/include;/usr/include/suitesparse;/usr/include/suitesparse
-- GTSAM include directory:  /usr/local/lib/cmake/GTSAM/../../../include;/usr/include;/usr/local/include/gtsam/3rdparty/Eigen/
-- Found cvsba: /usr/local/include
-- Found RealSense: /opt/ros/indigo/include
-- Found octomap 1.6.9: /opt/ros/indigo/include
-- Performing Test COMPILER_SUPPORTS_CXX11
-- Performing Test COMPILER_SUPPORTS_CXX11 - Success
-- Performing Test COMPILER_SUPPORTS_CXX0X
-- Performing Test COMPILER_SUPPORTS_CXX0X - Success
-- Found Pthreads
CMake Warning (dev) at /usr/lib/x86_64-linux-gnu/cmake/Qt5Core/Qt5CoreMacros.cmake:224 (configure_file):
  configure_file called with unknown argument(s):

   COPY_ONLY

Call Stack (most recent call first):
  guilib/src/CMakeLists.txt:68 (QT5_ADD_RESOURCES)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- yaml-cpp not found, euroc_dataset tool won't be built...
-- --------------------------------------------
-- Info :
--   Version : 0.16.3
--   CMAKE_INSTALL_PREFIX = /usr/local
--   CMAKE_BUILD_TYPE =     Release
--   CMAKE_INSTALL_LIBDIR = lib
--   BUILD_APP =            ON
--   BUILD_TOOLS =          ON
--   BUILD_EXAMPLES =       ON
--   BUILD_SHARED_LIBS =    ON
--   CMAKE_CXX_FLAGS =  -fmessage-length=0  -fopenmp -std=c++11
--   With OpenCV 2 nonfree module (SIFT/SURF) = YES (License: Non commercial)
--   With Freenect             = YES (License: Apache v2 and/or GPLv2)
--   With OpenNI2              = YES (License: Apache v2)
--   With Freenect2            = NO (libfreenect2 not found)
--   With Kinect for Windows 2 = NO (Kinect for Windows 2 SDK not found)
--   With dc1394               = YES (License: LGPL)
--   With FlyCapture2/Triclops = NO (Point Grey SDK not found)
--   With TORO                 = YES (License: Creative Commons [Attribution-NonCommercial-ShareAlike])
--   With g2o                  = YES (License: BSD)
--   With GTSAM                = YES (License: BSD)
--   With VERTIGO              = YES (License: GPLv3)
--   With cvsba                = YES (License: GPLv2)
--   With libpointmatcher      = NO (libpointmatcher not found)
--   With ZED                  = NO (ZED sdk not found)
--   With RealSense            = YES (License: Apache-2)
--   With RealSenseSlam        = NO (WITH_REALSENSE_SLAM=OFF)
--   With OCTOMAP              = YES (License: BSD)
--   With CPUTSDF              = NO (CPUTSDF not found)
--   With libfovis             = NO (libfovis not found)
--   With libviso2             = NO (libviso2 not found)
--   With dvo_core             = NO (dvo_core not found)
--   With okvis                = NO (okvis not found)
--   With ORB_SLAM2            = NO (WITH_G2O should be OFF as ORB_SLAM2 uses its own g2o version)
--   With Qt5                  = YES (License: Open Source or Commercial)
-- --------------------------------------------
-- Configuring done
-- Generating done
-- Build files have been written to: /home/turtlebot/ThridPKG/rtabmap/build

依然有QT5的问题,和前面处理方式一样。测试没有问题,然后sudo make install
下来编译rtabmap_ros,出现了undefined reference类型的错误。
我也在github上问了这个问题

/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointNormal, pcl::KdTreeFLANN<pcl::PointNormal, flann::L2_Simple<float> > >::KdTree(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZ, pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> > >::setPointRepresentation(boost::shared_ptr<pcl::PointRepresentation<pcl::PointXYZ> const> const&)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointNormal, pcl::KdTreeFLANN<pcl::PointNormal, flann::L2_Simple<float> > >::setPointRepresentation(boost::shared_ptr<pcl::PointRepresentation<pcl::PointNormal> const> const&)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGB, pcl::KdTreeFLANN<pcl::PointXYZRGB, flann::L2_Simple<float> > >::nearestKSearch(pcl::PointXYZRGB const&, int, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&) const'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGB, pcl::KdTreeFLANN<pcl::PointXYZRGB, flann::L2_Simple<float> > >::KdTree(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGB, pcl::KdTreeFLANN<pcl::PointXYZRGB, flann::L2_Simple<float> > >::radiusSearch(pcl::PointXYZRGB const&, double, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&, unsigned int) const'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZI, pcl::KdTreeFLANN<pcl::PointXYZI, flann::L2_Simple<float> > >::KdTree(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGBNormal, pcl::KdTreeFLANN<pcl::PointXYZRGBNormal, flann::L2_Simple<float> > >::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGBNormal> const> const&, boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZ, pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> > >::KdTree(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGB, pcl::KdTreeFLANN<pcl::PointXYZRGB, flann::L2_Simple<float> > >::setSortedResults(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGBNormal, pcl::KdTreeFLANN<pcl::PointXYZRGBNormal, flann::L2_Simple<float> > >::setSortedResults(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGBNormal, pcl::KdTreeFLANN<pcl::PointXYZRGBNormal, flann::L2_Simple<float> > >::nearestKSearch(pcl::PointXYZRGBNormal const&, int, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&) const'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGB, pcl::KdTreeFLANN<pcl::PointXYZRGB, flann::L2_Simple<float> > >::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB> const> const&, boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGBNormal, pcl::KdTreeFLANN<pcl::PointXYZRGBNormal, flann::L2_Simple<float> > >::KdTree(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGBNormal, pcl::KdTreeFLANN<pcl::PointXYZRGBNormal, flann::L2_Simple<float> > >::radiusSearch(pcl::PointXYZRGBNormal const&, double, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&, unsigned int) const'
collect2: error: ld returned 1 exit status
make[2]: *** [/home/turtlebot/catkin_ws_rtabmap/devel/lib/rtabmap_ros/rgbd_odometry] Error 1
make[1]: *** [rtabmap_ros/CMakeFiles/rgbd_odometry.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointNormal, pcl::KdTreeFLANN<pcl::PointNormal, flann::L2_Simple<float> > >::KdTree(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZ, pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> > >::setPointRepresentation(boost::shared_ptr<pcl::PointRepresentation<pcl::PointXYZ> const> const&)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointNormal, pcl::KdTreeFLANN<pcl::PointNormal, flann::L2_Simple<float> > >::setPointRepresentation(boost::shared_ptr<pcl::PointRepresentation<pcl::PointNormal> const> const&)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGB, pcl::KdTreeFLANN<pcl::PointXYZRGB, flann::L2_Simple<float> > >::nearestKSearch(pcl::PointXYZRGB const&, int, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&) const'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGB, pcl::KdTreeFLANN<pcl::PointXYZRGB, flann::L2_Simple<float> > >::KdTree(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGB, pcl::KdTreeFLANN<pcl::PointXYZRGB, flann::L2_Simple<float> > >::radiusSearch(pcl::PointXYZRGB const&, double, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&, unsigned int) const'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZI, pcl::KdTreeFLANN<pcl::PointXYZI, flann::L2_Simple<float> > >::KdTree(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGBNormal, pcl::KdTreeFLANN<pcl::PointXYZRGBNormal, flann::L2_Simple<float> > >::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGBNormal> const> const&, boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZ, pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> > >::KdTree(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGB, pcl::KdTreeFLANN<pcl::PointXYZRGB, flann::L2_Simple<float> > >::setSortedResults(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGBNormal, pcl::KdTreeFLANN<pcl::PointXYZRGBNormal, flann::L2_Simple<float> > >::setSortedResults(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGBNormal, pcl::KdTreeFLANN<pcl::PointXYZRGBNormal, flann::L2_Simple<float> > >::nearestKSearch(pcl::PointXYZRGBNormal const&, int, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&) const'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGB, pcl::KdTreeFLANN<pcl::PointXYZRGB, flann::L2_Simple<float> > >::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB> const> const&, boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGBNormal, pcl::KdTreeFLANN<pcl::PointXYZRGBNormal, flann::L2_Simple<float> > >::KdTree(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGBNormal, pcl::KdTreeFLANN<pcl::PointXYZRGBNormal, flann::L2_Simple<float> > >::radiusSearch(pcl::PointXYZRGBNormal const&, double, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&, unsigned int) const'
collect2: error: ld returned 1 exit status
make[2]: *** [/home/turtlebot/catkin_ws_rtabmap/devel/lib/rtabmap_ros/icp_odometry] Error 1
make[1]: *** [rtabmap_ros/CMakeFiles/icp_odometry.dir/all] Error 2
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointNormal, pcl::KdTreeFLANN<pcl::PointNormal, flann::L2_Simple<float> > >::KdTree(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZ, pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> > >::setPointRepresentation(boost::shared_ptr<pcl::PointRepresentation<pcl::PointXYZ> const> const&)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointNormal, pcl::KdTreeFLANN<pcl::PointNormal, flann::L2_Simple<float> > >::setPointRepresentation(boost::shared_ptr<pcl::PointRepresentation<pcl::PointNormal> const> const&)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGB, pcl::KdTreeFLANN<pcl::PointXYZRGB, flann::L2_Simple<float> > >::nearestKSearch(pcl::PointXYZRGB const&, int, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&) const'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGB, pcl::KdTreeFLANN<pcl::PointXYZRGB, flann::L2_Simple<float> > >::KdTree(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGB, pcl::KdTreeFLANN<pcl::PointXYZRGB, flann::L2_Simple<float> > >::radiusSearch(pcl::PointXYZRGB const&, double, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&, unsigned int) const'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZI, pcl::KdTreeFLANN<pcl::PointXYZI, flann::L2_Simple<float> > >::KdTree(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGBNormal, pcl::KdTreeFLANN<pcl::PointXYZRGBNormal, flann::L2_Simple<float> > >::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGBNormal> const> const&, boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&)'
/usr/local/lib/librtabmap_core.so: undefined reference to/ `pclusr::/search:local/:KdTreelib/<pcllibrtabmap_core.so::: undefinedPointXYZ, reference pcl to:: `KdTreeFLANN<pcl:pcl::search:PointXYZ::, KdTree<flann:pcl::L2_Simple:PointNormal<float, > pcl:> :KdTreeFLANN>:<pcl:KdTree::(boolPointNormal,)' flann
/::usr/L2_Simplelocal<float/lib> /librtabmap_core.so> : >:undefined :KdTreereference (boolto )'`pcl
/::usr/search:local/:KdTreelib/<pcllibrtabmap_core.so::: undefinedPointXYZRGB, reference pcl to:: `KdTreeFLANN<pcl:pcl::search:PointXYZRGB::, KdTree<flann:pcl::L2_Simple:PointXYZ<float, > pcl:> :KdTreeFLANN>:<pcl:setSortedResults::(boolPointXYZ,)' flann
/::usr/L2_Simple<local/floatlib> /librtabmap_core.so> : >:undefined :setPointRepresentationreference (boostto ::`pclshared_ptr<::pcl:search::PointRepresentation:KdTree<pcl<pcl::::PointXYZ>PointXYZRGBNormal, const pcl> ::const&KdTreeFLANN)'<pcl
/::usr/PointXYZRGBNormal,local/ flannlib/::librtabmap_core.so:L2_Simple< undefinedfloat> reference > to > `::pcl:setSortedResults(:searchbool)::'
KdTree</usrpcl:/local:PointNormal/lib, /librtabmap_core.sopcl:: :KdTreeFLANNundefined <pclreference ::to PointNormal,`pcl flann::::search:L2_Simple<:KdTreefloat><pcl >:: >PointXYZRGBNormal::, setPointRepresentation(pcl:boost::KdTreeFLANN:shared_ptr<pcl<pcl::::PointXYZRGBNormal,PointRepresentation< flannpcl::::PointNormalL2_Simple<> float>const> > const >&)::'
nearestKSearch(/usrpcl:/local:PointXYZRGBNormal/lib const/librtabmap_core.so&,:  intundefined , reference std:to :vector`pcl<int::, search:std::KdTree:allocator<pcl<int::> PointXYZRGB,>& pcl, ::std:KdTreeFLANN<:vectorpcl:<float:PointXYZRGB, , std:flann::allocator:L2_Simple<float<float> > >&> ) >:const':nearestKSearch
/(pclusr/::local/PointXYZRGB lib/const&librtabmap_core.so:,  undefinedint, reference std to:: `vector<pcl:int,:search std::::KdTree<allocator<pcl:int>:PointXYZRGB >, &,pcl: std:KdTreeFLANN::<pclvector<::float,PointXYZRGB , std:flann::allocator:L2_Simple<float<float> > >&> ) >:const:'setInputCloud
/(boostusr/::local/shared_ptr<lib/pcllibrtabmap_core.so::: PointCloud<undefined pcl:reference :PointXYZRGBto > `pclconst>:: constsearch:&,:KdTree boost<pcl::::shared_ptr<PointXYZRGB,std: pcl:vector::<intKdTreeFLANN<, pcl:std::PointXYZRGB:allocator, <intflann:> :L2_Simple> <floatconst>>  const> &)>:'
:KdTree/usr(bool/local)'/lib
//librtabmap_core.sousr/: local/undefined lib/reference librtabmap_core.so:to  undefined`pcl reference:: tosearch: `:KdTreepcl:<pcl:search::::PointXYZRGBNormal,KdTree< pclpcl::::PointXYZRGBKdTreeFLANN<, pcl:pcl::PointXYZRGBNormal:KdTreeFLANN, <pclflann::::L2_SimplePointXYZRGB,<float flann> ::> L2_Simple<>:float>:KdTree >(bool >)'::
/radiusSearch(usr/pcl:local/:PointXYZRGBlib/ constlibrtabmap_core.so:&, undefined double reference,  tostd: `:vectorpcl:<int:search, ::std:KdTree<:allocatorpcl:<int:PointXYZRGBNormal> , >&pcl:, :KdTreeFLANNstd:<pcl:vector::<floatPointXYZRGBNormal,,  flannstd::::allocatorL2_Simple<<floatfloat>>  >>& >, ::unsigned radiusSearch(int)pcl: const:PointXYZRGBNormal'
 const/usr&,/local double/lib, /librtabmap_core.sostd:: :vectorundefined <intreference , to std:`pcl:allocator::<intsearch:> :KdTree>&<pcl, ::std:PointXYZI,:vector pcl<float::, KdTreeFLANN<std:pcl::allocator:PointXYZI<float, > flann:>&:L2_Simple, <floatunsigned > int)>  const>:'
:KdTree(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search:collect2: error: ld returned 1 exit status
:KdTree<pcl::PointXYZRGBNormal, pcl::KdTreeFLANN<pcl::PointXYZRGBNormal, flann::L2_Simple<float> > >::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGBNormal> const> const&, boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZ, pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> > >::KdTree(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGB, pcl::KdTreeFLANN<pcl::PointXYZRGB, flann::L2_Simple<float> > >::setSortedResults(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGBNormal, pcl::KdTreeFLANN<pcl::PointXYZRGBNormal, flann::L2_Simple<float> > >::setSortedResults(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGBNormal, pcl::KdTreeFLANN<pcl::PointXYZRGBNormal, flann::L2_Simple<float> > >::nearestKSearch(pcl::PointXYZRGBNormal const&, int, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&) const'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGB, pcl::KdTreeFLANN<pcl::PointXYZRGB, flann::L2_Simple<float> > >::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB> const> const&, boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGBNormal, pcl::KdTreeFLANN<pcl::PointXYZRGBNormal, flann::L2_Simple<float> > >::KdTree(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGBNormal, pcl::KdTreeFLANN<pcl::PointXYZRGBNormal, flann::L2_Simple<float> > >::radiusSearch(pclmake[2]: ::PointXYZRGBNormal const&*** [/home/turtlebot/catkin_ws_rtabmap/devel/lib/rtabmap_ros/stereo_odometry] Error 1, 
double, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&, unsigned int) const'
collect2: error: ld returned 1 exit status
make[1]: *** [rtabmap_ros/CMakeFiles/stereo_odometry.dir/all] Error 2
make[2]: *** [/home/turtlebot/catkin_ws_rtabmap/devel/lib/rtabmap_ros/rtabmap] Error 1
make[1]: *** [rtabmap_ros/CMakeFiles/rtabmap.dir/all] Error 2
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointNormal, pcl::KdTreeFLANN<pcl::PointNormal, flann::L2_Simple<float> > >::KdTree(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZ, pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> > >::setPointRepresentation(boost::shared_ptr<pcl::PointRepresentation<pcl::PointXYZ> const> const&)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointNormal, pcl::KdTreeFLANN<pcl::PointNormal, flann::L2_Simple<float> > >::setPointRepresentation(boost::shared_ptr<pcl::PointRepresentation<pcl::PointNormal> const> const&)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGB, pcl::KdTreeFLANN<pcl::PointXYZRGB, flann::L2_Simple<float> > >::nearestKSearch(pcl::PointXYZRGB const&, int, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&) const'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGB, pcl::KdTreeFLANN<pcl::PointXYZRGB, flann::L2_Simple<float> > >::KdTree(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGB, pcl::KdTreeFLANN<pcl::PointXYZRGB, flann::L2_Simple<float> > >::radiusSearch(pcl::PointXYZRGB const&, double, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&, unsigned int) const'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZI, pcl::KdTreeFLANN<pcl::PointXYZI, flann::L2_Simple<float> > >::KdTree(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGBNormal, pcl::KdTreeFLANN<pcl::PointXYZRGBNormal, flann::L2_Simple<float> > >::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGBNormal> const> const&, boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZ, pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> > >::KdTree(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGB, pcl::KdTreeFLANN<pcl::PointXYZRGB, flann::L2_Simple<float> > >::setSortedResults(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGBNormal, pcl::KdTreeFLANN<pcl::PointXYZRGBNormal, flann::L2_Simple<float> > >::setSortedResults(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGBNormal, pcl::KdTreeFLANN<pcl::PointXYZRGBNormal, flann::L2_Simple<float> > >::nearestKSearch(pcl::PointXYZRGBNormal const&, int, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&) const'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGB, pcl::KdTreeFLANN<pcl::PointXYZRGB, flann::L2_Simple<float> > >::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB> const> const&, boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGBNormal, pcl::KdTreeFLANN<pcl::PointXYZRGBNormal, flann::L2_Simple<float> > >::KdTree(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGBNormal, pcl::KdTreeFLANN<pcl::PointXYZRGBNormal, flann::L2_Simple<float> > >::radiusSearch(pcl::PointXYZRGBNormal const&, double, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&, unsigned int) const'
collect2: error: ld returned 1 exit status
make[2]: *** [/home/turtlebot/catkin_ws_rtabmap/devel/lib/rtabmap_ros/rgbdicp_odometry] Error 1
make[1]: *** [rtabmap_ros/CMakeFiles/rgbdicp_odometry.dir/all] Error 2
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointNormal, pcl::KdTreeFLANN<pcl::PointNormal, flann::L2_Simple<float> > >::KdTree(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZ, pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> > >::setPointRepresentation(boost::shared_ptr<pcl::PointRepresentation<pcl::PointXYZ> const> const&)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointNormal, pcl::KdTreeFLANN<pcl::PointNormal, flann::L2_Simple<float> > >::setPointRepresentation(boost::shared_ptr<pcl::PointRepresentation<pcl::PointNormal> const> const&)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGB, pcl::KdTreeFLANN<pcl::PointXYZRGB, flann::L2_Simple<float> > >::nearestKSearch(pcl::PointXYZRGB const&, int, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&) const'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGB, pcl::KdTreeFLANN<pcl::PointXYZRGB, flann::L2_Simple<float> > >::KdTree(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGB, pcl::KdTreeFLANN<pcl::PointXYZRGB, flann::L2_Simple<float> > >::radiusSearch(pcl::PointXYZRGB const&, double, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&, unsigned int) const'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZI, pcl::KdTreeFLANN<pcl::PointXYZI, flann::L2_Simple<float> > >::KdTree(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGBNormal, pcl::KdTreeFLANN<pcl::PointXYZRGBNormal, flann::L2_Simple<float> > >::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGBNormal> const> const&, boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZ, pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> > >::KdTree(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGB, pcl::KdTreeFLANN<pcl::PointXYZRGB, flann::L2_Simple<float> > >::setSortedResults(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGBNormal, pcl::KdTreeFLANN<pcl::PointXYZRGBNormal, flann::L2_Simple<float> > >::setSortedResults(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGBNormal, pcl::KdTreeFLANN<pcl::PointXYZRGBNormal, flann::L2_Simple<float> > >::nearestKSearch(pcl::PointXYZRGBNormal const&, int, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&) const'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGB, pcl::KdTreeFLANN<pcl::PointXYZRGB, flann::L2_Simple<float> > >::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB> const> const&, boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGBNormal, pcl::KdTreeFLANN<pcl::PointXYZRGBNormal, flann::L2_Simple<float> > >::KdTree(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGBNormal, pcl::KdTreeFLANN<pcl::PointXYZRGBNormal, flann::L2_Simple<float> > >::radiusSearch(pcl::PointXYZRGBNormal const&, double, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&, unsigned int) const'
collect2: error: ld returned 1 exit status
make[2]: *** [/home/turtlebot/catkin_ws_rtabmap/devel/lib/rtabmap_ros/camera] Error 1
make[1]: *** [rtabmap_ros/CMakeFiles/camera.dir/all] Error 2
[ 83%] Linking CXX executable /home/turtlebot/catkin_ws_rtabmap/devel/lib/rtabmap_ros/odom_msg_to_tf
[ 84%] Linking CXX executable /home/turtlebot/catkin_ws_rtabmap/devel/lib/rtabmap_ros/data_player
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointNormal, pcl::KdTreeFLANN<pcl::PointNormal, flann::L2_Simple<float> > >::KdTree(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGB, pcl::KdTreeFLANN<pcl::PointXYZRGB, flann::L2_Simple<float> > >::nearestKSearch(pcl::PointXYZRGB const&, int, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&) const'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGB, pcl::KdTreeFLANN<pcl::PointXYZRGB, flann::L2_Simple<float> > >::KdTree(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZI, pcl::KdTreeFLANN<pcl::PointXYZI, flann::L2_Simple<float> > >::KdTree(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGBNormal, pcl::KdTreeFLANN<pcl::PointXYZRGBNormal, flann::L2_Simple<float> > >::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGBNormal> const> const&, boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGBNormal, pcl::KdTreeFLANN<pcl::PointXYZRGBNormal, flann::L2_Simple<float> > >::nearestKSearch(pcl::PointXYZRGBNormal const&, int, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&) const'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGB, pcl::KdTreeFLANN<pcl::PointXYZRGB, flann::L2_Simple<float> > >::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB> const> const&, boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGBNormal, pcl::KdTreeFLANN<pcl::PointXYZRGBNormal, flann::L2_Simple<float> > >::radiusSearch(pcl::PointXYZRGBNormal const&, double, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&, unsigned int) const'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZ, pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> > >::setPointRepresentation(boost::shared_ptr<pcl::PointRepresentation<pcl::PointXYZ> const> const&)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointNormal, pcl::KdTreeFLANN<pcl::PointNormal, flann::L2_Simple<float> > >::setPointRepresentation(boost::shared_ptr<pcl::PointRepresentation<pcl::PointNormal> const> const&)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGB, pcl::KdTreeFLANN<pcl::PointXYZRGB, flann::L2_Simple<float> > >::radiusSearch(pcl::PointXYZRGB const&, double, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&, unsigned int) const'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZ, pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> > >::KdTree(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGB, pcl::KdTreeFLANN<pcl::PointXYZRGB, flann::L2_Simple<float> > >::setSortedResults(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGBNormal, pcl::KdTreeFLANN<pcl::PointXYZRGBNormal, flann::L2_Simple<float> > >::setSortedResults(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGBNormal, pcl::KdTreeFLANN<pcl::PointXYZRGBNormal, flann::L2_Simple<float> > >::KdTree(bool)'
collect2: error: ld returned 1 exit status
make[2]: *** [/home/turtlebot/catkin_ws_rtabmap/devel/lib/rtabmap_ros/odom_msg_to_tf] Error 1
make[1]: *** [rtabmap_ros/CMakeFiles/odom_msg_to_tf.dir/all] Error 2
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointNormal, pcl::KdTreeFLANN<pcl::PointNormal, flann::L2_Simple<float> > >::KdTree(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGB, pcl::KdTreeFLANN<pcl::PointXYZRGB, flann::L2_Simple<float> > >::nearestKSearch(pcl::PointXYZRGB const&, int, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&) const'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGB, pcl::KdTreeFLANN<pcl::PointXYZRGB, flann::L2_Simple<float> > >::KdTree(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZI, pcl::KdTreeFLANN<pcl::PointXYZI, flann::L2_Simple<float> > >::KdTree(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGBNormal, pcl::KdTreeFLANN<pcl::PointXYZRGBNormal, flann::L2_Simple<float> > >::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGBNormal> const> const&, boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGBNormal, pcl::KdTreeFLANN<pcl::PointXYZRGBNormal, flann::L2_Simple<float> > >::nearestKSearch(pcl::PointXYZRGBNormal const&, int, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&) const'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGB, pcl::KdTreeFLANN<pcl::PointXYZRGB, flann::L2_Simple<float> > >::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB> const> const&, boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGBNormal, pcl::KdTreeFLANN<pcl::PointXYZRGBNormal, flann::L2_Simple<float> > >::radiusSearch(pcl::PointXYZRGBNormal const&, double, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&, unsigned int) const'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZ, pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> > >::setPointRepresentation(boost::shared_ptr<pcl::PointRepresentation<pcl::PointXYZ> const> const&)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointNormal, pcl::KdTreeFLANN<pcl::PointNormal, flann::L2_Simple<float> > >::setPointRepresentation(boost::shared_ptr<pcl::PointRepresentation<pcl::PointNormal> const> const&)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGB, pcl::KdTreeFLANN<pcl::PointXYZRGB, flann::L2_Simple<float> > >::radiusSearch(pcl::PointXYZRGB const&, double, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&, unsigned int) const'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZ, pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> > >::KdTree(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGB, pcl::KdTreeFLANN<pcl::PointXYZRGB, flann::L2_Simple<float> > >::setSortedResults(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGBNormal, pcl::KdTreeFLANN<pcl::PointXYZRGBNormal, flann::L2_Simple<float> > >::setSortedResults(bool)'
/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree<pcl::PointXYZRGBNormal, pcl::KdTreeFLANN<pcl::PointXYZRGBNormal, flann::L2_Simple<float> > >::KdTree(bool)'
collect2: error: ld returned 1 exit status
make[2]: *** [/home/turtlebot/catkin_ws_rtabmap/devel/lib/rtabmap_ros/data_player] Error 1
make[1]: *** [rtabmap_ros/CMakeFiles/data_player.dir/all] Error 2
make: *** [all] Error 2
Invoking "make -j8 -l8" failed

也许是安装ros-indigo时装的pcl和自己编译安装的pcl有冲突,所以卸载了自己编译安装的pcl,之后重新编译rtabmap,但是测试时出现vtk5.8的问题。
依然安装自己编译的pcl1.7,然后编译rtabmap并安装
在rtabmap_ros/CMakelists.text中添加:

find_package(PCL REQUIRED)

add_definitions(${PCL_DEFINITIONS})
link_directories(${PCL_LIBRARY_DIRS})

include_directories(
  ${CMAKE_CURRENT_SOURCE_DIR}/include
  ${RTABMap_INCLUDE_DIRS}
  ${OpenCV_INCLUDE_DIRS}
  ${catkin_INCLUDE_DIRS}
  ${PCL_INCLUDE_DIRS}
)

# libraries
SET(Libraries
   ${OpenCV_LIBRARIES}
   ${catkin_LIBRARIES}
   ${RTABMap_LIBRARIES}
   ${PCL_LIBRARIES}
)

编译通过并且可以建图,但是不能显示主界面,提示错误如下:

[rtabmap/rtabmapviz-3] process has died [pid 32330, exit code -11, cmd /home/turtlebot/catkin_ws/devel/lib/rtabmap_ros/rtabmapviz -d ~/.ros/rtabmap_gui.ini rgb/image:=/kinect2/qhd/image_color_rect depth/image:=/kinect2/qhd/image_depth_rect rgb/camera_info:=/kinect2/qhd/camera_info rgbd_image:=rgbd_image left/image_rect:=/stereo_camera/left/image_rect_color right/image_rect:=/stereo_camera/right/image_rect left/camera_info:=/stereo_camera/left/camera_info right/camera_info:=/stereo_camera/right/camera_info scan:=/scan scan_cloud:=/scan_cloud odom:=odom __name:=rtabmapviz __log:=/home/turtlebot/.ros/log/834461a8-30c8-11e8-8c8d-c8d3ffd835e0/rtabmap-rtabmapviz-3.log].
log file: /home/turtlebot/.ros/log/834461a8-30c8-11e8-8c8d-c8d3ffd835e0/rtabmap-rtabmapviz-3*.log

github上的解决办法

1. 卸载rtabmap
2. 重新编译
$ cmake -DWITH_G2O=OFF -DWITH_GTSAM=OFF ..
$ make
$ sudo make install 
  • 1
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 7
    评论
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值