UBUNTU18.04安装使用ORB-SLAM2

1.下载:

  git clone https://github.com/raulmur/ORB_SLAM2.git ORB_SLAM2

2.依赖项:

  sudo apt install autotools-dev ccache doxygen dh-autoreconf git liblapack-dev libblas-dev libgtest-dev libreadline-dev libssh2-1-dev pylint clang-format-3.8

3.安装eigen,pangolin

4.解决ORB-SLAM2编译死机问题

  vim build.sh,在最后将 -j 取消掉。

5.解决usleep问题

  在include里面的system.h加入#include

6.运行./build.sh

 

7.修正错误Failed to invoke rospack to get compile flags for package 'ORB_SLAM2'.

  sudo gedit ~/.bashrc修改bashrc,在其末端加入

export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:/home/username/catkin_ws/src/ORB_SLAM2/Examples/ROS

并在加入保存后在终端运行source ~/.bashrc

 

8.修正错误recipe for target 'CMakeFiles/Mono.dir/all' failed

set(LIBS
${OpenCV_LIBS}
${EIGEN3_LIBS} ${Pangolin_LIBRARIES}
${PROJECT_SOURCE_DIR}/../../../Thirdparty/DBoW2/lib/libDBoW2.so
${PROJECT_SOURCE_DIR}/../../../Thirdparty/g2o/lib/libg2o.so
${PROJECT_SOURCE_DIR}/../../../lib/libORB_SLAM2.so
-lboost_system
)

 

你可能感兴趣的:(UBUNTU)