EVO Evaluation of SLAM 4 --- ORB-SLAM3 编译和利用数据集运行
一、前言
上一篇已经用EVO来估计了VINS-Mono:
EVO Evaluation of SLAM 2 — VINS-Mono 编译和利用数据集运行
EVO Evaluation of SLAM 3 — VINS-Mono 精度和性能效果评估
二、说明
现在开始用EVO估计ORB-SLAM3。
之前编译ORB-SLAM3的时候是用现在电脑上的环境,用源码编译遇到的坑已经在之前的文章中列出来,有问题的童鞋可以看看:
ORB-SLAM3 Ubuntu ros melodic 编译的坑
自己修改的源码在github上,欢迎大家指正:
https://github.com/shanpenghui/ORB_SLAM3_Fixed.git
如果用新安装Ubuntu系统的电脑进行编译的话,需要进行Pangolin的安装,
地址是:
https://github.com/stevenlovegrove/Pangolin.git
具体操作步骤是:
sudo apt install libglew-dev
git clone https://github.com/stevenlovegrove/Pangolin.git
cd Pangolin
mkdir build
cd build
cmake ..
make -j 4
sudo make install
然后进行ORB-SLAM3的编译,其中有分ros版本和非ros版本,因为涉及到EuRoc和TUM数据集的评估,有些地方不一样,所以在此特别指出。否则会出现下面错误:
--------------------------------------------------------------------------------
Loaded 2151 stamps and poses from: f_dataset-room4_512_monoi.txt
Loaded 13075 stamps and poses from: data_tum.csv
Synchronizing trajectories...
[ERROR] found no matching timestamps between f_dataset-room4_512_monoi.txt and data_tum.csv with max. time diff 0.01 (s) and time offset 0.0 (s)
EuRoc
把system.cc里面的Line677和Line685的源码中的1e9*(*lT)变成(*lT)
f << setprecision(6) << (*lT) << " " << setprecision(9) << twb.at<float>(0) << " " << twb.at<float>(1) << " " << twb.at<float>(2) << " " << q[0] << " " << q[1] << " " << q[2] << " " << q[3] << endl;
TUM
把system.cc里面的Line677和Line685的源码中的1e9*(*lT)不变
f << setprecision(6) << 1e9*(*lT) << " " << setprecision(9) << twb.at<float>(0) << " " << twb.at<float>(1) << " " << twb.at<float>(2) << " " << q[0] << " " << q[1] << " " << q[2] << " " << q[3] << endl;
三、下载数据集
A.EuRoc
本文利用的是EuRoc数据集的MH_01_easy
http://robotics.ethz.ch/~asl-datasets/ijrr_euroc_mav_dataset/machine_hall/MH_01_easy/MH_01_easy.zip
官网地址是:
http://robotics.ethz.ch/~asl-datasets
B.TUM
TUM的Visual-Inertial Dataset数据集的地址在下面,注意选择room4的Euroc / DSO 512x512 dataset
http://vision.in.tum.de/tumvi/exported/euroc/512_16/dataset-room4_512_16.tar
官网地址是:
https://vision.in.tum.de/data/datasets/visual-inertial-dataset
四、非ros版本编译和运行(Monocular)
1.编译
git clone https://github.com/shanpenghui/ORB_SLAM3_Fixed.git
cd ORB_SLAM3_Fixed/shells
./build.sh
2.运行
这里要分清楚,两个数据集运行脚本分别是euroc.sh和tum_vi.sh
A.EuRoc
运行之前,需要修改ORB_SLAM3_Fixed/shells/euroc.sh文件里面的数据集存放的路径:
Line 5:
pathDatasetEuroc='/home/sph/Downloads' #Example, it is necesary to change it by the dataset path
然后运行:
cd ORB_SLAM3_Fixed/shells
./euroc.sh
结果:
B.TUM
运行之前,需要修改ORB_SLAM3_Fixed/shells/tum_vi.sh文件里面的数据集存放的路径:
Line 5:
pathDatasetTUM_VI='/home/sph/Downloads' #Example, it is necesary to change it by the dataset path
然后运行:
cd ORB_SLAM3_Fixed/shells
./tum_vi.sh
结果:
五、ros版本的编译和运行
1.编译
git clone https://github.com/shanpenghui/ORB_SLAM3_Fixed.git
cd ORB_SLAM3_Fixed/shells
./build_ros.sh
2.运行
Stereo和Mono订阅的话题名称不一样,所以在运行rosbag和rosrun的时候,两个指令是有区别的!!!比如:
rosbag in terminal 2 的
(1)EuRoc - Stereo
(2)EuRoc - Mono
rosrun in terminal 3 的
(1)EuRoc - Stereo
(2)EuRoc - Mono
A.roscore in terminal 1
source /opt/ros/melodic/setup.bash
roscore
B.rosbag in terminal 2
(1)EuRoc - Stereo
以暂停的方式运行,等orb-slam3运行起来之后记得按空格键play,不然不正常都不知道什么原因,切记!切记!
source /opt/ros/melodic/setup.bash
cd /home/sph/Downloads/dataset/EuRoc
rosbag play --pause MH_01_easy.bag /cam0/image_raw:=/camera/left/image_raw /cam1/image_raw:=/camera/right/image_raw
(2)EuRoc - Mono
source /opt/ros/melodic/setup.bash
cd /home/sph/Downloads/dataset/EuRoc
rosbag play --pause MH_01_easy.bag /cam0/image_raw:=/camera/image_raw
(3)TUM - Stereo
source /opt/ros/melodic/setup.bash
cd /home/sph/Downloads/dataset/TUM
rosbag play --pause dataset-room4_512_16.bag /cam0/image_raw:=/camera/left/image_raw /cam1/image_raw:=/camera/right/image_raw
(4)TUM - Mono ros版本暂时不支持该功能!!!
C.rosrun in terminal 3
编译完之后运行ros版本的时候,需要先export一下package的路径.
运行的路径是在ORB_SLAM3_Fixed下,不要在shells里面运行!!
(1)EuRoc - Stereo
source /opt/ros/melodic/setup.bash
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:/home/sph/Documents/slam/ORB_SLAM3_Fixed/Examples/ROS
cd /home/sph/Documents/slam/ORB_SLAM3_Fixed
rosrun ORB_SLAM3 Stereo Vocabulary/ORBvoc.txt Examples/Stereo/EuRoC.yaml true
Result files:
Saving keyframe trajectory to KeyFrameTrajectory_TUM_Format.txt ...
Saving camera trajectory to FrameTrajectory_TUM_Format.txt ...
Saving camera trajectory to FrameTrajectory_KITTI_Format.txt ...
结果:
(2)EuRoc - Mono
source /opt/ros/melodic/setup.bash
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:/home/sph/Documents/slam/ORB_SLAM3_Fixed/Examples/ROS
cd /home/sph/Documents/slam/ORB_SLAM3_Fixed
rosrun ORB_SLAM3 Mono Vocabulary/ORBvoc.txt Examples/Monocular/EuRoC.yaml
Result files:
Saving keyframe trajectory to KeyFrameTrajectory.txt ...
结果:
(3)TUM - Stereo
因为没有打开IMU,所以rosrun指令结尾要以false结束
source /opt/ros/melodic/setup.bash
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:/home/sph/Documents/slam/ORB_SLAM3_Fixed/Examples/ROS
cd /home/sph/Documents/slam/ORB_SLAM3_Fixed
rosrun ORB_SLAM3 Stereo Vocabulary/ORBvoc.txt Examples/Stereo/TUM_512.yaml false
Result files:
Saving keyframe trajectory to KeyFrameTrajectory_TUM_Format.txt ...
Saving camera trajectory to FrameTrajectory_TUM_Format.txt ...
Saving camera trajectory to FrameTrajectory_KITTI_Format.txt ...
结果:
(4)TUM - Monocular
source /opt/ros/melodic/setup.bash
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:/home/sph/Documents/slam/ORB_SLAM3_Fixed/Examples/ROS
cd /home/sph/Documents/slam/ORB_SLAM3_Fixed
rosrun ORB_SLAM3 Mono Vocabulary/ORBvoc.txt Examples/Monocular/TUM_512.yaml
-------------------------------- 华丽的分割线 --------------------------------
2021年01月21日新增
六、非ros版本编译和运行(RGB-D)
1. 下载数据集
本例子用的是TUM的RGBD数据集,https://vision.in.tum.de/data/datasets/rgbd-dataset/download#freiburg1_desk
本次用的yaml配置文件是TUM4.yaml,在tum_rgbd.sh文件中可以修改。作者原版本是没有TUM4.yaml文件的,只有TUM1-3.yaml,我这里是根据官网给的参数自己添加的配置文件,具体相机参数的参考在这里:File Formats
2. 配置启动文件
启动文件是tum_rgbd.sh,在shells文件夹下面,内容我贴一下吧:
#!/bin/bashcd ..
currentDir=$(pwd)
# 配置运行类型
runType=RGB-D
# 配置文件夹
datasetType=rgbd_dataset_freiburg1_deskpathDatasetTUM_VI='/home/sph/Downloads/dataset/TUM' #Example, it is necesary to change it by the dataset path
if [ -d "$pathDatasetTUM_VI" ];thenecho ""
elseecho "该文件夹不存在 ${pathDatasetTUM_VI} "exit 1
fiif [ -f "$currentDir/Vocabulary/ORBvoc.txt" ];thenecho ""
elseecho "该文件不存在 $currentDir/Vocabulary/ORBvoc.txt "exit 1
fi
if [ -f "$currentDir/Examples/$runType/TUM4.yaml" ];thenecho ""
elseecho "该文件不存在 $currentDir/Examples/$runType/TUM4.yaml "exit 1
fiif [ -d ""$pathDatasetTUM_VI"/"$datasetType"" ];thenecho ""
elseecho "该文件夹不存在 "$pathDatasetTUM_VI"/"$datasetType" "exit 1
fi
if [ -f "$currentDir/Examples/$runType/associations/fr1_desk.txt" ];thenecho ""
elseecho "该文件不存在 $currentDir/Examples/$runType/associations/fr1_desk.txt "exit 1
fi
if [ -d "logs" ];thenecho ""
elseecho "logs 该文件夹不存在 创建"mkdir logs
fi#------------------------------------
# Monocular Examples
echo "Launching $datasetType with $runType SLAM"
./Examples/RGB-D/rgbd_tum Vocabulary/ORBvoc.txt Examples/"$runType"/TUM4.yaml "$pathDatasetTUM_VI"/"$datasetType" "$currentDir"/Examples/"$runType"/associations/fr1_desk.txt
3. 运行
按照上面的配置,运行之后如果有问题的话会显示提示的,所以不用担心出问题怎么办,直接运行脚本就好,注意运行的时候保证终端的文件夹路径是在shells下面。提醒一下,有时候会发现相机位姿跳变这是正常现象。在IDE里面运行该程序,比如我在CLion里面运行的时候,就出现Segment的问题,建议大家还是在系统terminal下面运行,否则会出现一些莫名其妙的问题
./tum_rgbd.sh
结果:
EVO Evaluation of SLAM 4 --- ORB-SLAM3 编译和利用数据集运行相关推荐
- ORB SLAM3加载Vocabulary更快ORBvoc.bin
最近ORB SLAM3刚开源,跑了跑,发现源代码加载词袋还是ORBvoc.txt,加载时间比较慢,这里教你修改成ORBvoc.bin加载,1秒内完成加载. 1. 将ORBvoc.bin拷贝到Vocab ...
- opencv与ORB SLAM提取orb特征点比较
在ORB SLAM中,通过四叉树的方式存储关键点,使得图像上特征点分布均匀,便于追踪.此次实验分别用opencv接口和ORB SLAM实现特征点的提取,效果图如下: 实现程序: #include &l ...
- ORB SLAM3——IMU优化部分精读-VertexPose(ImuCamPose)的更新量到底是什么?
ORB SLAM3--IMU优化部分精读-VertexPose(ImuCamPose)的更新量到底是什么? 先说答案 void ImuCamPose::Update(const double *pu) ...
- Part-1 ORB SLAM3初始化-1
初始化 ORB SLAM3的初始化主要是创建ORB词袋.关键帧数据库.多地图等对象,其步骤如下: 检测配置文件能否打开 加载ORB词袋(ORBVocabulary) 创建关键帧数据库(KeyFrame ...
- ORB SLAM3论文大致翻译,手动整理
ORB-SLAM3: An Accurate Open-Source Library for Visual, Visual-Inertial and Multi-Map SLAM I. INTRODU ...
- 视觉SLAM十四讲---第一、二讲(讲解slam框架, c++编译实践)
同时定位与地图构建:首先是估计自己的运动,然后描述环境这两件事. 困难之处: 数据来源只有图像等 视觉slam14讲有编程内容 书中有相关知识的小例题 一.视觉slam框架分为四个模块 定位和建图的相 ...
- 【Android 插件化】DroidPlugin 编译运行 ( DroidPlugin 简介 | 编译 DroidPlugin 官方示例 | 运行 DroidPlugin 官方示例 )
文章目录 一.DroidPlugin 简介 二.DroidPlugin 编译运行 1.编译 DroidPlugin 官方示例 2.运行 DroidPlugin 官方示例 一.DroidPlugin 简 ...
- linux编写arm执行文件夹,嵌入式ARM-Linux平台上的编译、配置和运行使用
本文介绍了嵌入式ARM-Linux上的常用应用程序wpa_supplicant(以及wpa_supplicant依赖的libnl和openssl)的编译.配置和运行使用,iw.hostapd等应用的编 ...
- Visual Studio 2013开发 mini-filter driver step by step (2) - 编译,部署,运行
编译driver 一个基本的mini filter项目创建好了以后,就可以编译,部署和运行了,在部署之前,我们要先确定在什么样的系统上运行,我有一台windows 2008 r2拟机,所以我的运行的目 ...
- maven常用命令(编译、测试、运行、打包、安装、部署)
我们可以在cmd中通过一系列的maven命令来对我们的maven-helloworld工程进行编译.测试.运行.打包.安装.部署. compile compile是maven工程的编译命令,作用是将s ...
最新文章
- python requests_Python爬虫之requests模块
- C# 开发和使用中的33个技巧
- 神策数据荣获北京市广播电视局优秀推荐项目
- Google API 设计指南 - 前言
- 韩信点兵python源代码_少儿编程|Python小课堂 – 韩信点兵
- IP地址概念及其划分
- JVM学习笔记(四)
- 【数据结构与算法】之线性表的应用和操作
- 数据科学和统计学_数据科学中的统计
- 初识EntityFramework6【转】
- 什么是智能决策支持系统?
- EMC NetWorker简单管理指南(二)
- 从“老公”的称呼来历,看男人地位的变迁!
- 中国图书分类法检索计算机方面的图书,《中国图书分类法》(简称《中图法》)是我国常用的分类法,要检索计算机方面的图书,需要在( )类目下查找。...
- 手把手教你做小米商城-商品展示页面
- 外币折算、汇兑损益、重估
- csv文件用excel打开乱码
- Ubuntu16.04安装卸载Kinetic
- 健身耳机哪个好、最好的健身耳机推荐
- 水果的用途大全,喜欢水果的亲们一定要收藏哦!
热门文章
- R语言入门-常用的向量运算
- EXCEL实现自动填充
- 市政基础设施工程与建筑工地施工人员安全管理实名制通道系统的应用与解决方案
- sklearn常用函数整理
- 大数据集群资源监控Zabbix
- c语言this什么意思,JavaScript 中的this是什么?它到底做了什么?
- win10更改/修改c盘下的用户名/Users
- Win10菜单栏卡顿无响应的解决方法
- matlab+nnf.m,第6章_西安电子科技大学:工程线性代数(MATLAB版)_ppt_大学课件预览_高等教育资讯网...
- android实现跳转支付宝微信支付,Android接入支付宝和微信支付的方法