简介

ORB-SLAM2是一套完整的SLAM方案,提供了单目,双目和RGB-D三种接口。它能够实现地图重用,回环检测和重新定位的功能。无论是在室内的小型手持设备,还是到工厂环境的无人机和城市里驾驶的汽车,ORB-SLAM2都能够在标准的CPU上进行实时工作。ORB-SLAM2在后端上采用的是基于单目和双目的光束法平差优化(BA)的方式,这个方法允许米制比例尺的轨迹精确度评估。此外,ORB-SLAM2包含一个轻量级的定位模式,该模式能够在允许零点漂移的条件下,利用视觉里程计来追踪未建图的区域并且匹配特征点。

可以说,ORB_SLAM2是近几年SLAM的集大成者,它吸收了近几年monoslam领域的很多理论成果,比如逆深度的使用,g2o工具箱的优化等。而且以orb特征贯穿始终,从一开始的特征处理,匹配,以及用于回环的bag-of-words,词典,全用的是orb。

缺点在于它的的建图部分只含有稀疏的map point,这不仅让最终建的图很难看,而且对于机器人下一步的应用会造成很大困难。

环境和数据准备

Ubuntu 14.04 +ROS indigo

ORB_SLAM2编译 :Ubuntu 14.04 ROS indigo下编译安装ORB_SLAM2

数据集下载链接 :rgbd_dataset_freiburg2_pioneer_360.tgz

运行

一.数据集解压

把数据集解压,放在了orbslam2工程目录下面:


tar -xzvf rgbd_dataset_freiburg2_pioneer_360.tgz

如图,rgbd_dataset_freiburg2_pioneer_360文件夹现在就在ORB_SLAM2的文件夹下。

二.Examples/RGB-D目录下新建associate.py


cd Examples/RGB-D/touch associate.py

associate.py内容如下:


#!/usr/bin/python
# Software License Agreement (BSD License)
#
# Copyright (c) 2013, Juergen Sturm, TUM
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
#  * Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#  * Redistributions in binary form must reproduce the above
#    copyright notice, this list of conditions and the following
#    disclaimer in the documentation and/or other materials provided
#    with the distribution.
#  * Neither the name of TUM nor the names of its
#    contributors may be used to endorse or promote products derived
#    from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# Requirements:
# sudo apt-get install python-argparse"""
The Kinect provides the color and depth images in an un-synchronized way. This means that the set of time stamps from the color images do not intersect with those of the depth images. Therefore, we need some way of associating color images to depth images.For this purpose, you can use the ''associate.py'' script. It reads the time stamps from the rgb.txt file and the depth.txt file, and joins them by finding the best matches.
"""import argparse
import sys
import os
import numpydef read_file_list(filename):"""Reads a trajectory from a text file.File format:The file format is "stamp d1 d2 d3 ...", where stamp denotes the time stamp (to be matched)and "d1 d2 d3.." is arbitary data (e.g., a 3D position and 3D orientation) associated to this timestamp.Input:filename -- File nameOutput:dict -- dictionary of (stamp,data) tuples"""file = open(filename)data = file.read()lines = data.replace(","," ").replace("\t"," ").split("\n")list = [[v.strip() for v in line.split(" ") if v.strip()!=""] for line in lines if len(line)>0 and line[0]!="#"]list = [(float(l[0]),l[1:]) for l in list if len(l)>1]return dict(list)def associate(first_list, second_list,offset,max_difference):"""Associate two dictionaries of (stamp,data). As the time stamps never match exactly, we aimto find the closest match for every input tuple.Input:first_list -- first dictionary of (stamp,data) tuplessecond_list -- second dictionary of (stamp,data) tuplesoffset -- time offset between both dictionaries (e.g., to model the delay between the sensors)max_difference -- search radius for candidate generationOutput:matches -- list of matched tuples ((stamp1,data1),(stamp2,data2))"""first_keys = first_list.keys()second_keys = second_list.keys()potential_matches = [(abs(a - (b + offset)), a, b)for a in first_keysfor b in second_keysif abs(a - (b + offset)) < max_difference]potential_matches.sort()matches = []for diff, a, b in potential_matches:if a in first_keys and b in second_keys:first_keys.remove(a)second_keys.remove(b)matches.append((a, b))matches.sort()return matchesif __name__ == '__main__':# parse command lineparser = argparse.ArgumentParser(description='''This script takes two data files with timestamps and associates them''')parser.add_argument('first_file', help='first text file (format: timestamp data)')parser.add_argument('second_file', help='second text file (format: timestamp data)')parser.add_argument('--first_only', help='only output associated lines from first file', action='store_true')parser.add_argument('--offset', help='time offset added to the timestamps of the second file (default: 0.0)',default=0.0)parser.add_argument('--max_difference', help='maximally allowed time difference for matching entries (default: 0.02)',default=0.02)args = parser.parse_args()first_list = read_file_list(args.first_file)second_list = read_file_list(args.second_file)matches = associate(first_list, second_list,float(args.offset),float(args.max_difference))if args.first_only:for a,b in matches:print("%f %s"%(a," ".join(first_list[a])))else:for a,b in matches:print("%f %s %f %s"%(a," ".join(first_list[a]),b-float(args.offset)," ".join(second_list[b])))

三.生成associations_my.txt文件

在新建association.py文件完毕之后,需要生成associations_my.txt文件,命令如下 :


python2 associate.py ../../rgbd_dataset_freiburg2_pioneer_360/rgb.txt ../../rgbd_dataset_freiburg2_pioneer_360/depth.txt > associations_my.txt

四.运行

执行以下命令即可运行:

./rgbd_tum ../../Vocabulary/ORBvoc.txt TUM2.yaml ../../rgbd_dataset_freiburg2_pioneer_360 associations_my.txt

其中TUM2.yaml 可以换为TUM1.yaml 和TUM3.yaml

运行前提示:

ORB-SLAM2 Copyright (C) 2014-2016 Raul Mur-Artal, University of Zaragoza.
This program comes with ABSOLUTELY NO WARRANTY;
This is free software, and you are welcome to redistribute it
under certain conditions. See LICENSE.txt.Input sensor was set to: RGB-DLoading ORB Vocabulary. This could take a while...

运行结果图如下:

ORB_SLAM2系列之三:ORB_SLAM2跑RGBD SLAM数据集相关推荐

  1. Ubuntu16.04配置orb_slam2环境,orb_slam的单目数据集,单目实时运行,RGB-D数据集的运行

    Ubuntu16.04配置orb_slam2环境,orb_slam的单目数据集,单目实时运行,RGB-D数据集的运行 1.运行配置过程中参考链接如下: 1.配置orb_slam2环境 参考链接http ...

  2. 【ORB_SLAM2源码解读】EuRoC双目数据集跑通ORB_SLAM2

    文章目录 ORB_SLAM2框架简介 下载ORB_SLAM2源码 ORB_SLAM2源码介绍 ORB_SLAM2源码编译 下载 EuRoC Dataset 将数据集移动到路径下 stereo_euro ...

  3. BAD SLAM | 直接法实时BA+RGBD基准数据集(CVPR2019)

    论文解读:BAD SLAM | 直接法实时BA+RGBD基准数据集(CVPR2019) 本文解读的论文为发表于CVPR 2019的 "Schops, Thomas, Torsten Satt ...

  4. M2DGR:多源多场景 地面机器人SLAM数据集(ICRA 2022 )

    Paper:https://arxiv.org/pdf/2112.13659.pdf 出处:ICRA2022 & RAL2021 项目地址:https://github.com/SJTU-Vi ...

  5. SLAM导航机器人零基础实战系列:(六)SLAM建图与自主避障导航——2.google-cartographer机器人SLAM建图...

    SLAM导航机器人零基础实战系列:(六)SLAM建图与自主避障导航--2.google-cartographer机器人SLAM建图 摘要 通过前面的基础学习,本章进入最为激动的机器人自主导航的学习.在 ...

  6. 一起做RGB-D SLAM调试

    最近在学习高博的一起做RGB-D SLAM第一版本,其中调试出现了挺多问题,百度查找许多资料, 最后调通所有程序,记录以下运行环境. 高博一起做RGB-D SLAM系列主页: http://www.c ...

  7. BAD SLAM:捆绑束调整直接RGB-D SLAM

    BAD SLAM:捆绑束调整直接RGB-D SLAM BAD SLAM: Bundle Adjusted Direct RGB-D SLAM 论文地址: http://openaccess.thecv ...

  8. Towards Real-time Semantic RGB-D SLAM in Dynamic Environments(动态语义SLAM)

    动态环境下的实时语义SLAM 简介 摘要 系统流程 实验结果 总结 简介 在ICRA 2021上看到这样一篇论文:Towards Real-time Semantic RGB-D SLAM in Dy ...

  9. 结构化场景中的RGB-D SLAM

    点云PCL免费知识星球,点云论文速读. 文章:RGB-D SLAM with Structural Regularities 作者:Yanyan Li , Raza Yunus , Nikolas B ...

  10. 面向动态环境基于面元的RGB-D SLAM系统

    点击上方"3D视觉工坊",选择"星标" 干货第一时间送达 作者:robot L https://zhuanlan.zhihu.com/p/142175916 本 ...

最新文章

  1. 使用php与mysql构建我们的网站
  2. 通过反射动态调用webservices
  3. vs五子棋c语言代码,五子棋代码C语言版.doc
  4. html运用以及工具
  5. 机器学习入门(2)之模型评估与选择
  6. 免费开源低代码拖拽开发_资料来源:面向开源开发人员的免费代码搜索工具
  7. C源程序括号匹配检查(C语言)
  8. js面向对象的程序设计 --- 上篇(理解对象)
  9. linux路由表的查看和含义
  10. (转)基于FPGA技术的FAST行情解码研究
  11. mysql数据迁移到sqlserver_技术分享 | 使用OGG实现Oracle到MySQL数据平滑迁移
  12. oracle analyze any,Oracle 工具:Analyze
  13. MyGUI_Orge官网教程_2.快速在工程中使用MyGUI
  14. 笔记本电脑计算机无法显示u盘,小编告诉你为什么笔记本电脑识别不了u盘
  15. 网页 php,怎么用php写一个网页
  16. 驱动开发:实现字符设备
  17. iOS下载APP之后直接跳转到信任界面
  18. xmanager linux 远程桌面,Windows系统下通过xmanager远程桌面控制Linux
  19. 柯西不等式证明及推广
  20. 油菜籽的全球与中国市场2022-2028年:技术、参与者、趋势、市场规模及占有率研究报告

热门文章

  1. 通过自定义注解+反射的形式,使用POI实现excel的导入导出
  2. ICPC冠军教练亲自授课 字节跳动ICPC冬令营全球招募50支受训队
  3. Java中的private关键字
  4. 我们需要“第二人生”吗?[Second life]
  5. 美金融犯罪执法局文件遭泄露:汇丰、摩根大通、渣打等国际大行涉嫌非法转移资金...
  6. mongodb mapreduce分析
  7. 我爱淘二次冲刺阶段3
  8. .NET Core使用微软官方类库实现汉字简繁切换以及转拼音
  9. 英语计算机四级如何查询,四级成绩查询
  10. OKR工作法学习心得