1.安装boost库

官网上的依赖没有boost,但如果不安装boost会报很多的关于c++的错误,并且无法定位。
进入boost官网网址:http://www.boost.org/users/download/

tar -xvf 对应的版本.tar.gz
cd ./boost_1_77_0
./bootstrap.sh
sudo ./b2 install

2.更改orb-slam3/build.sh

make -j4

在这里插入图片描述

3.更改orb-slam3/CmakeLists.txt

gedit ./CMakeLists.txt
add_compile_options(-std=c++14)

在这里插入图片描述

4.编译成功后,下载EuRoc数据集中MH01

下载链接
在这里插入图片描述
图片数据集下载好解压后是一个mav0这种形式的文件夹,在ORB-SLAM3/Examples文件夹下新建一个datasets文件夹,在datasets文件夹新建一个名称为MH01的文件夹,把mav0整个文件夹拷贝到MH01文件夹中。

cd Examples
mkdir datasets

5.orb-slam3运行EuRoc数据集中MH01

(1)第一种方式运行

orb-slam命令格式:

# 命令格式 可执行文件 词袋路径 yaml路径 数据集图片路径 时间戳路径 需要保存的轨迹文件名称

./Monocular-Inertial/mono_inertial_euroc ../Vocabulary/ORBvoc.txt ./Monocular-Inertial/EuRoC.yaml ./datasets/MH01 ./Monocular-Inertial/EuRoC_TimeStamps/MH01.txt dataset-MH01_mono+imu

(1)第二种方式运行

我们自己创建一个脚本文件来运行它

cd Examples
touch Monocular-Inertial.sh

在Monocular-Inertial.sh文件中加入:

#!/bin/bash
pathDatasetEuroc='./datasets'
#Example, it is necesary to change it by the dataset path
 
# Monocular-Inertial Examples
echo "Launching MH01 with Monocular-Inertial sensor"
./Monocular-Inertial/mono_inertial_euroc ../Vocabulary/ORBvoc.txt ./Monocular-Inertial/EuRoC.yaml "$pathDatasetEuroc"/MH01 ./Monocular-Inertial/EuRoC_TimeStamps/MH01.txt dataset-MH01_mono+imu

#第一个参数 ../Vocabulary/ORBvoc.txt                 词袋模型
#第二个参数 ./Monocular-Inertial/EuRoC.yaml          相机配置文件
#第三个参数 "$pathDatasetEuroc"/MH01                 数据的位置
#第四个参数 ./Examples/Monocular-Inertial/EuRoC_TimeStamps/MH01.txt         数据里面的时间戳
#第五个参数 dataset-MH01_monoi                       跑完之后保存的文件名格式
./Monocular-Inertial.sh

运行成功
在这里插入图片描述

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐