ubuntu18.04运行ORBSLAM2踩坑记录
程序员文章站
2024-03-25 19:34:04
...
坑1:
error: 'usleep' was not declared in this scope
usleep(3000);解决办法:
在对应报错文件中添加头文件:#include<unistd.h>
坑2:
当编译执行到
./build.sh
文件时,报错Eigen3 found!之类错误。解决办法:
从目录ORB_SLAM2-master/cmake_modules/下找到FindEigen3.cmake文件,
然后把它复制到报错的CMakeLists.txt对应的路径下/src中
然后在CMakeLists.txt文件中添加以下两行配置:
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${EIGEN3_INCLUDE_DIRS})
坑3:
当编译执行到./build_ros.sh文件时,报错Eigen3 found!
解决方法:
在主文件夹下直接查找FindEigen3.cmake文件,然后把它复制到报错的orb-slam2/Examples/ROS/ORB-SLAM21/CMakeLists.txt对应的路径下/src中,在CMakeLists.txt中,
添加:
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) include_directories($ {EIGEN3_INCLUDE_DIRS})