####仅作为笔记
环境:
Ubuntu 12.04, 14.04 and 16.04
C++11 or C++0x Compiler
Pangolin
OpenCV(至版本少 2.4.3. OpenCV 2.4.11 和 OpenCV 3.2作者已经测试过)
Eigen3(至少3.1.0)
DBoW2 and g2o (在第三方库文件夹内已包含)
ROS(可选)
- ROS(如果需要使用ROS节点,传输数据)
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
sudo apt-get update
sudo apt-get install ros-kinetic-desktop-full
sudo apt-get install python-catkin-tools
echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
- Pangolin
sudo apt-get install libglew-dev libboost-dev libboost-thread-dev libboost-filesystem-dev
git clone https://github.com/stevenlovegrove/Pangolin.git
cd Pangolin
mkdir build
cd build
cmake ..
make -j4
sudo make install
- OpenCV
https://github.com/opencv/opencv/releases/tag/3.2.0 #下载对应版本
tar -xzvf opencv-3.2.0.tar.gz
cd opencv-3.2.0/
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
make -j4
sudo make install
- Eigen3
sudo apt-get install libeigen3-dev
- 安装ORBSLAM2
git clone https://github.com/raulmur/ORB_SLAM2.git ORB_SLAM2
cd ORB_SLAM2
chmod +x build.sh
./build.sh
或者ROS版本:
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:PATH/ORB_SLAM2/Examples/ROS
chmod +x build_ros.sh
./build_ros.sh
- 测试(不使用ROS)
#单目:
(1)TUM数据集:http://vision.in.tum.de/data/datasets/rgbd-dataset/download
./Examples/Monocular/mono_tum Vocabulary/ORBvoc.txt Examples/Monocular/TUMX.yaml PATH_TO_SEQUENCE_FOLDER
(2)KITTI数据集:http://www.cvlibs.net/datasets/kitti/eval_odometry.php
./Examples/Monocular/mono_kitti Vocabulary/ORBvoc.txt Examples/Monocular/KITTIX.yaml PATH_TO_DATASET_FOLDER/dataset/sequences/SEQUENCE_NUMBER
(3)EuRoc数据集:http://projects.asl.ethz.ch/datasets/doku.php?id=kmavvisualinertialdatasets
./Examples/Monocular/mono_euroc Vocabulary/ORBvoc.txt Examples/Monocular/EuRoC.yaml PATH_TO_SEQUENCE_FOLDER/mav0/cam0/data Examples/Monocular/EuRoC_TimeStamps/SEQUENCE.txt
#双目:
(1)KITTI数据集:http://www.cvlibs.net/datasets/kitti/eval_odometry.php
./Examples/Stereo/stereo_kitti Vocabulary/ORBvoc.txt Examples/Stereo/KITTIX.yaml PATH_TO_DATASET_FOLDER/dataset/sequences/SEQUENCE_NUMBER
(2)EuRoc数据集:http://projects.asl.ethz.ch/datasets/doku.php?id=kmavvisualinertialdatasets
./Examples/Stereo/stereo_euroc Vocabulary/ORBvoc.txt Examples/Stereo/EuRoC.yaml PATH_TO_SEQUENCE/mav0/cam0/data PATH_TO_SEQUENCE/mav0/cam1/data Examples/Stereo/EuRoC_TimeStamps/SEQUENCE.txt
#RGBD深度
TUM数据集:http://vision.in.tum.de/data/datasets/rgbd-dataset/download
#需要使用associate.py文件关联RGB图像和深度图像,associate.py链接:http://vision.in.tum.de/data/datasets/rgbd-dataset/tools
python associate.py PATH_TO_SEQUENCE/rgb.txt PATH_TO_SEQUENCE/depth.txt > associations.txt
./Examples/RGB-D/rgbd_tum Vocabulary/ORBvoc.txt Examples/RGB-D/TUMX.yaml PATH_TO_SEQUENCE_FOLDER ASSOCIATIONS_FILE
- 测试(使用ROS)
#第一个终端:
roscore
#第二个终端:
#单目:
rosrun ORB_SLAM2 Mono PATH_TO_VOCABULARY PATH_TO_SETTINGS_FILE #普通数据集或者用你自己的相机,修改话题
rosrun ORB_SLAM2 MonoAR PATH_TO_VOCABULARY PATH_TO_SETTINGS_FILE #VR实例
#双目:
rosrun ORB_SLAM2 Stereo PATH_TO_VOCABULARY PATH_TO_SETTINGS_FILE ONLINE_RECTIFICATION
#举个例子:
roscore
rosrun ORB_SLAM2 Stereo Vocabulary/ORBvoc.txt Examples/Stereo/EuRoC.yaml true
rosbag play --pause V1_01_easy.bag /cam0/image_raw:=/camera/left/image_raw /cam1/image_raw:=/camera/right/image_raw
#RGBD:
rosrun ORB_SLAM2 RGBD PATH_TO_VOCABULARY PATH_TO_SETTINGS_FILE
7.测试结果