[VSLAM] RTAB-Map 安装遇到问题及解决

rtabmap-ros遇到的问题1:

CMake Error at /opt/ros/indigo/share/gencpp/cmake/gencpp-extras.cmake:8 (file):
  file problem creating directory: /home/bear/study/devel/include/rtabmap_ros
Call Stack (most recent call first):
  /opt/ros/indigo/share/gencpp/cmake/gencpp-extras.cmake:34 (_generate_msg_cpp)
  /home/bear/study/build/rtabmap_ros/cmake/rtabmap_ros-genmsg.cmake:218 (_generate_srv_cpp)
  /opt/ros/indigo/share/genmsg/cmake/genmsg-extras.cmake:307 (include)
  rtabmap_ros/CMakeLists.txt:91 (generate_messages)


-- WITH costmap_2d
-- WITH octomap
-- WITH rviz
-- Configuring incomplete, errors occurred!
See also "/home/bear/study/build/CMakeFiles/CMakeOutput.log".
See also "/home/bear/study/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed

原因:英语渣看走眼,安rtabmap时,最后使用sudo make install,然而如果选择在cmake 后添加

-DCMAKE_INSTALL_PREFIX=~/catkin_ws/devel,就不能加sudo

解决:去rtabmap的build文件夹找到  install_manifest.txt ,然后用cat install_manifest.txt | sudo xargs rm,再把你工作空间devel文件夹里和rtabmap有关的文件全删了,重装不带sudo就行。

问题二:

/usr/local/lib/libopencv_nonfree.so.2.4.13:对‘cv::ocl::integral(cv::ocl::oclMat const&, cv::ocl::oclMat&)’未定义的引用
/usr/local/lib/libopencv_nonfree.so.2.4.13:对‘cv::ocl::integral(cv::ocl::oclMat const&, cv::ocl::oclMat&)’未定义的引用
/usr/local/lib/libopencv_nonfree.so.2.4.13:对‘cv::ocl::integral(cv::ocl::oclMat const&, cv::ocl::oclMat&)’未定义的引用
/usr/local/lib/libopencv_nonfree.so.2.4.13:对‘cv::ocl::integral(cv::ocl::oclMat const&, cv::ocl::oclMat&)’未定义的引用
collect2: error: ld returned 1 exit status
collect2: error: ld returned 1 exit status
collect2: error: ld returned 1 exit status
collect2: error: ld returned 1 exit status
make[2]: make[2]: *** [/home/bear/study/devel/lib/rtabmap_ros/stereo_odometry] 错误 1
make[2]: *** [/home/bear/study/devel/lib/rtabmap_ros/icp_odometry] 错误 1
make[2]: *** [/home/bear/study/devel/lib/rtabmap_ros/rgbdicp_odometry] 错误 1*** [/home/bear/study/devel/lib/rtabmap_ros/rtabmap] 错误 1

make[1]: *** [rtabmap_ros/CMakeFiles/rtabmap.dir/all] 错误 2
make[1]: *** 正在等待未完成的任务....
make[1]: *** [rtabmap_ros/CMakeFiles/icp_odometry.dir/all] 错误 2
make[1]: *** [rtabmap_ros/CMakeFiles/stereo_odometry.dir/all] 错误 2
make[1]: *** [rtabmap_ros/CMakeFiles/rgbdicp_odometry.dir/all] 错误 2
make: *** [all] 错误 2
Invoking "make -j4 -l4" failed

解决:把从源码安装的OPENCV卸载--->重新编译安装,记得先删除原来已经生成的文件,然后安装时的CMAKE用下面指令替代。

cmake -D CMAKE_BUILD_TYPE=RELEASE -D WITH_OPENCL=OFF -D CMAKE_INSTALL_PREFIX=/usr/local ..






你可能感兴趣的:(vslam-RTAB-Map,编译问题解决)