ubuntu 配置 ORB_SLAM3

参考:
https://blog.csdn.net/hhz_999/article/details/120473659
https://blog.csdn.net/u014709760/article/details/85253525
https://blog.csdn.net/weixin_51331359/article/details/120805189

- 安装Pangolin

官网:https://github.com/stevenlovegrove/Pangolin

git clone --recursive https://github.com/stevenlovegrove/Pangolin.git
cd Pangolin
./scripts/install_prerequisites.sh recommended
mkdir build && cd build
cmake ..
cmake --build .

- 安装Opencv3.4.5

参考https://www.cnblogs.com/wwzone/articles/16067206.html

- 安装Eigen

sudo apt-get install libeigen3-dev

- 安装boost

官网下载地址:http://www.boost.org/users/download/
下载安装boost_1_77_0.tar.gz

tar -xvf boost_1_77_0.tar.gz
cd ./boost_1_77_0
./bootstrap.sh
sudo ./b2 install

- 正式编译ORB_SLAM3

git clone https://github.com/UZ-SLAMLab/ORB_SLAM3.git ORB_SLAM3
cd ~/ORB_SLAM3
chmod +x build.sh
./build.sh

(1)可以一个一个的编译。
(2)同时尽量把-j改为-j12。
(3)如果报错:openssl/md5.h: 没有那个文件或目录,执行:

sudo apt-get install libssl-dev

(4)将CMakeLists.txt中find_package(OpenCV 4.4)改为find_package(OpenCV 3.4.5)
(5)如果是ubuntu21.10,可能会在编译最后一部分报很多未声明变量error,例如:error: ‘slots_reference’ was not declared。此时在主目录下执行:

sed -i 's/++11/++14/g' CMakeLists.txt

即可。原因参考:https://xie.infoq.cn/article/848196c877c2774f43850f575

- 测试

(1)EuRoC数据集下载任意一个ASL格式数据,如Vicon Room 1 01https://projects.asl.ethz.ch/datasets/doku.php?id=kmavvisualinertialdatasets
(2)解压,建立如下图所示目录结构:

(3)运行代码:

cd Examples
./Monocular-Inertial/mono_inertial_euroc ../Vocabulary/ORBvoc.txt ./Monocular-Inertial/EuRoC.yaml /home/wangbo/1-files/SLAM/dataset/EuRoC/V1_01_easy ./Monocular-Inertial/EuRoC_TimeStamps/V101.txt dataset-V101_monoi

效果如图所示即为成功:

posted @ 2022-03-28 21:40  仙海寻波  阅读(84)  评论(0编辑  收藏  举报