ORB-SLAM 编译问题记录及解决

问题1 编译ros部分 eigen问题

执行:

~/MYNT-EYE-ORB-SLAM2-Sample$ ./build_ros.sh

结果:

/home/lqk/MYNT-EYE-ORB-SLAM2-Sample/Examples/ROS/ORB_SLAM2/../../../Thirdparty/g2o/g2o/types/se3quat.h:32:22: fatal error: Eigen/Core: 没有那个文件或目录
compilation terminated.
CMakeFiles/RGBD.dir/build.make:119: recipe for target 'CMakeFiles/RGBD.dir/src/ros_rgbd.cc.o' failed
make[2]: *** [CMakeFiles/RGBD.dir/src/ros_rgbd.cc.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/RGBD.dir/all' failed
make[1]: *** [CMakeFiles/RGBD.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

修改:
在相应的.h文件当中,eigen的引用作如下修改。例如:

#include 

改为

#include 

问题2 usleep问题

执行:

~/MYNT-EYE-ORB-SLAM2-Sample$ ./build_ros.sh

结果:

/home/lqk/MYNT-EYE-ORB-SLAM2-Sample/Examples/ROS/ORB_SLAM2/src/AR/ViewerAR.cc:233:23: error: ‘usleep’ was not declared in this scope
         usleep(mT*1000);
                       ^
CMakeFiles/MonoAR.dir/build.make:200: recipe for target 'CMakeFiles/MonoAR.dir/src/AR/ViewerAR.cc.o' failed
make[2]: *** [CMakeFiles/MonoAR.dir/src/AR/ViewerAR.cc.o] Error 1
CMakeFiles/Makefile2:857: recipe for target 'CMakeFiles/MonoAR.dir/all' failed
make[1]: *** [CMakeFiles/MonoAR.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

修改:
在相应的文件里面添加usleep 的头文件unistd.h,如下:

#include 

你可能感兴趣的:(SLAM)