1.git clone https://github.com/raulmur/ORB_SLAM2.git
2.git clone https://github.com/stevenlovegrove/Pangolin.git
cd ~/Pangolin/
mkdir build
cd build/
cmake ..
sudo apt install libgl1-mesa-dev
sudo apt install libglew-dev
cmake ..
sudo apt install pkg-config
sudo apt install libegl1-mesa-dev libwayland-dev libxkbcommon-dev wayland-protocols
cmake ..
cmake --build .
3.cd ORB_SLAM2/
./build.sh
在編譯usleep()報錯的文件里加入#include<unistd.h>
locate libboost_system
在/home/wang/ORB_SLAM2/Examples/ROS/ORB_SLAM2/CMakeLists.txt的set(LIBS...最后加入/usr/lib/x86_64-linux-gnu/libboost_system.so
./build.sh
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:/home/wang/ORB_SLAM2/Examples/ROS/ORB_SLAM2
./build_ros.sh
4.使用ros錄的bag測試orb_slam2
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:/home/wang/ORB_SLAM2/Examples/ROS/ORB_SLAM2
cd ~/ORB_SLAM2
roscore
rosrun ORB_SLAM2 Mono Vocabulary/ORBvoc.txt Examples/Monocular/TUM1.yaml
rosbag play xxxx.bag(rosbag reindex xxxx.bag)