一、下载ORB Slam2依赖
下载链接:https://gitcode.com/raulmur/ORB_SLAM2/overview?tab=readme-ov-file&utm_source=csdn_github_accelerator&isLogin=1
1.安装Pangolin
打开终端,执行以下命令:
cd Pangolin
mkdir build
cd build
2.安装Eigen
下载Eigen3.3.7:https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.tar.gz
解压后,打开终端
mkdir build
cd build
cmake ..
sudo make install
3.安装Ceres
sudo apt-get install liblapack-dev libsuitesparse-dev libcxsparse3 libgflags-dev libgoogle-glog-dev libgtest-dev
cd ceres-solver
mkdir build && cd build
cmake ..
sudo make -j8
sudo make install
4.g2o安装
sudo apt-get install qt5-qmake qt5-default libqglviewer-dev-qt5 libsuitesparse-dev libcxsparse3 libcholmod3
cd g2o
mkdir build && cd build
cmake ..
sudo make -j8
sudo make install
5.DBoW3安装
mkdir build
cd build/
cmake ..
make
sudo make install
二.安装编译ORB_SLAM2
进入你的ROS工作空间的src目录下,下载ORB_SLAM2的安装包
配置环境:
在控制台输入:export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}
进入ORB_SLAM2文件夹下
cd ~/catkin_ws/src/ORB_SLAM2
sudo chmod +x build.sh
./build.sh
使用ROS编译
sudo chmod +x build_ros.sh
./build_ros.sh
有进度条并且达到100%就代表成功,
成功之后,Example目录下也多了可执行文件:
三、运行Kitee数据集
1、数据集准备
链接:https://www.cvlibs.net/datasets/kitti/eval_odometry.php
下载第一个:
2、单目模式运行演示案例
运行命令格式为:
./mono_kitti path_to_vocabulary path_to_settings path_to_sequence
所以命令为
./Examples/Monocular/mono_kitti Vocabulary/ORBvoc.txt Examples/Monocular/KITTI00-02.yaml …/dataset/sequences/00/
结果如下