VINS-Fusion运行Kaist数据集

2023-11-23 01:50
文章标签 数据 运行 fusion vins kaist

本文主要是介绍VINS-Fusion运行Kaist数据集,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

目录

  • Kaist数据集转rosbag
  • 运行Kaist rosbag数据集

Kaist数据集转rosbag

使用Kaist序列38,转换rosbag参考GithubKaist2bag,这里主要使用IMU,双目相机以及GPS数据。
附:其他的合并rosbag方法数据参考bag_merge。

#!/usr/bin/env pythonimport sys
import argparse
from fnmatch import fnmatchcasefrom rosbag import Bagdef main():parser = argparse.ArgumentParser(description='Merge one or more bag files with the possibilities of filtering topics.')parser.add_argument('outputbag',help='output bag file with topics merged')parser.add_argument('inputbag', nargs='+',help='input bag files')parser.add_argument('-v', '--verbose', action="store_true", default=False,help='verbose output')parser.add_argument('-t', '--topics', default="*",help='string interpreted as a list of topics (wildcards \'*\' and \'?\' allowed) to include in the merged bag file')args = parser.parse_args()topics = args.topics.split(' ')total_included_count = 0total_skipped_count = 0if (args.verbose):print("Writing bag file: " + args.outputbag)print("Matching topics against patters: '%s'" % ' '.join(topics))with Bag(args.outputbag, 'w') as o: for ifile in args.inputbag:matchedtopics = []included_count = 0skipped_count = 0if (args.verbose):print("> Reading bag file: " + ifile)with Bag(ifile, 'r') as ib:for topic, msg, t in ib:if any(fnmatchcase(topic, pattern) for pattern in topics):if not topic in matchedtopics:matchedtopics.append(topic)if (args.verbose):print("Including matched topic '%s'" % topic)o.write(topic, msg, t)included_count += 1else:skipped_count += 1total_included_count += included_counttotal_skipped_count += skipped_countif (args.verbose):print("< Included %d messages and skipped %d" % (included_count, skipped_count))if (args.verbose):print("Total: Included %d messages and skipped %d" % (total_included_count, total_skipped_count))if __name__ == "__main__":main()

运行Kaist rosbag数据集

Kaist相机配置文件:

%YAML:1.0
---
model_type: PINHOLE
camera_name: camera
image_width: 1280
image_height: 560
distortion_parameters:k1: -5.6143027800000002e-02k2: 1.3952563200000001e-01p1: -1.2155906999999999e-03p2: -9.7281389999999998e-04
projection_parameters:fx: 816.90378992770002fy: 811.56803828490001cx: 608.50726281690004cy: 263.47599764440002

总的配置文件:

%YAML:1.0#common parameters
imu: 1
num_of_cam: 1  imu_topic: "/imu0"
image0_topic: "/cam0/image_raw"
image1_topic: "/cam1/image_raw"
output_path: "/home/Workspace/RosWorkspace/catkin_ws_vins_fusion/src/VINS-Fusion/output/"cam0_calib: "kaist_cam.yaml"
cam1_calib: "kaist_cam.yaml"
image_width: 1280
image_height: 560# Extrinsic parameter between IMU and Camera.
estimate_extrinsic: 0   # 0  Have an accurate extrinsic parameters. We will trust the following imu^R_cam, imu^T_cam, don't change it.# 1  Have an initial guess about extrinsic parameters. We will optimize around your initial guess.body_T_cam0: !!opencv-matrixrows: 4cols: 4dt: ddata: [-6.80499000e-03, -1.53215000e-02, 9.99850000e-01, 1.71239,-9.99977000e-01,  3.34627000e-04, -6.80066000e-03, 0.247401,-2.30383000e-04, -9.99883000e-01, -1.53234000e-02, -0.11589,0, 0, 0, 1]body_T_cam1: !!opencv-matrixrows: 4cols: 4dt: ddata: [-6.80499000e-03, -1.53215000e-02, 9.99850000e-01, 1.71239,-9.99977000e-01,  3.34627000e-04, -6.80066000e-03, 0.247401,-2.30383000e-04, -9.99883000e-01, -1.53234000e-02, -0.11589,0, 0, 0, 1]#Multiple thread support
multiple_thread: 1#feature traker paprameters
max_cnt: 200            # max feature number in feature tracking
min_dist: 30            # min distance between two features 
freq: 10                # frequence (Hz) of publish tracking result. At least 10Hz for good estimation. If set 0, the frequence will be same as raw image 
F_threshold: 1.0        # ransac threshold (pixel)
show_track: 1           # publish tracking image as topic
flow_back: 1            # perform forward and backward optical flow to improve feature tracking accuracy#optimization parameters
max_solver_time: 0.08  # max solver itration time (s), to guarantee real time
max_num_iterations: 10   # max solver itrations, to guarantee real time
keyframe_parallax: 15 # keyframe selection threshold (pixel)#imu parameters       The more accurate parameters you provide, the better performance
acc_n: 0.02          # accelerometer measurement noise standard deviation. #0.2   0.04
gyr_n: 0.003         # gyroscope measurement noise standard deviation.     #0.05  0.004
acc_w: 0.005         # accelerometer bias random work noise standard deviation.  #0.02
gyr_w: 3.0e-5       # gyroscope bias random work noise standard deviation.     #4.0e-5
g_norm: 9.81007     # gravity magnitude#unsynchronization parameters
estimate_td: 0                      # online estimate time offset between camera and imu
td: 0.0                             # initial value of time offset. unit: s. readed image clock + td = real image clock (IMU clock)#loop closure parameters
load_previous_pose_graph: 0        # load and reuse previous pose graph; load from 'pose_graph_save_path'
pose_graph_save_path: "/home/Workspace/RosWorkspace/catkin_ws_vins_fusion/src/VINS-Fusion/output/pose_graph/" # save and load path
save_image: 1                   # save image in pose graph for visualization prupose; you can close this function by setting 0

运行指令:

roslaunch vins vins_rviz.launch
rosrun vins vins_node ~/catkin_ws/src/VINS-Fusion/config/kaist/kaist_config.yaml 
rosrun global_fusion global_fusion_node
rosbag play Kaist38_gps.bag

运行结果:
在这里插入图片描述前期由于ENU坐标系与VIO坐标系没有对齐,误差稍大,收敛之后整体效果尚可,但是在个别路段由于GPS的定位偏差较大,优化出的位姿效果没有预期的好。

这篇关于VINS-Fusion运行Kaist数据集的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/414454

相关文章

SQL中如何添加数据(常见方法及示例)

《SQL中如何添加数据(常见方法及示例)》SQL全称为StructuredQueryLanguage,是一种用于管理关系数据库的标准编程语言,下面给大家介绍SQL中如何添加数据,感兴趣的朋友一起看看吧... 目录在mysql中,有多种方法可以添加数据。以下是一些常见的方法及其示例。1. 使用INSERT I

Python使用vllm处理多模态数据的预处理技巧

《Python使用vllm处理多模态数据的预处理技巧》本文深入探讨了在Python环境下使用vLLM处理多模态数据的预处理技巧,我们将从基础概念出发,详细讲解文本、图像、音频等多模态数据的预处理方法,... 目录1. 背景介绍1.1 目的和范围1.2 预期读者1.3 文档结构概述1.4 术语表1.4.1 核

MySQL 删除数据详解(最新整理)

《MySQL删除数据详解(最新整理)》:本文主要介绍MySQL删除数据的相关知识,本文通过实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友参考下吧... 目录一、前言二、mysql 中的三种删除方式1.DELETE语句✅ 基本语法: 示例:2.TRUNCATE语句✅ 基本语

MyBatisPlus如何优化千万级数据的CRUD

《MyBatisPlus如何优化千万级数据的CRUD》最近负责的一个项目,数据库表量级破千万,每次执行CRUD都像走钢丝,稍有不慎就引起数据库报警,本文就结合这个项目的实战经验,聊聊MyBatisPl... 目录背景一、MyBATis Plus 简介二、千万级数据的挑战三、优化 CRUD 的关键策略1. 查

python实现对数据公钥加密与私钥解密

《python实现对数据公钥加密与私钥解密》这篇文章主要为大家详细介绍了如何使用python实现对数据公钥加密与私钥解密,文中的示例代码讲解详细,感兴趣的小伙伴可以跟随小编一起学习一下... 目录公钥私钥的生成使用公钥加密使用私钥解密公钥私钥的生成这一部分,使用python生成公钥与私钥,然后保存在两个文

mysql中的数据目录用法及说明

《mysql中的数据目录用法及说明》:本文主要介绍mysql中的数据目录用法及说明,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录1、背景2、版本3、数据目录4、总结1、背景安装mysql之后,在安装目录下会有一个data目录,我们创建的数据库、创建的表、插入的

Navicat数据表的数据添加,删除及使用sql完成数据的添加过程

《Navicat数据表的数据添加,删除及使用sql完成数据的添加过程》:本文主要介绍Navicat数据表的数据添加,删除及使用sql完成数据的添加过程,具有很好的参考价值,希望对大家有所帮助,如有... 目录Navicat数据表数据添加,删除及使用sql完成数据添加选中操作的表则出现如下界面,查看左下角从左

SpringBoot中4种数据水平分片策略

《SpringBoot中4种数据水平分片策略》数据水平分片作为一种水平扩展策略,通过将数据分散到多个物理节点上,有效解决了存储容量和性能瓶颈问题,下面小编就来和大家分享4种数据分片策略吧... 目录一、前言二、哈希分片2.1 原理2.2 SpringBoot实现2.3 优缺点分析2.4 适用场景三、范围分片

Redis分片集群、数据读写规则问题小结

《Redis分片集群、数据读写规则问题小结》本文介绍了Redis分片集群的原理,通过数据分片和哈希槽机制解决单机内存限制与写瓶颈问题,实现分布式存储和高并发处理,但存在通信开销大、维护复杂及对事务支持... 目录一、分片集群解android决的问题二、分片集群图解 分片集群特征如何解决的上述问题?(与哨兵模

浅析如何保证MySQL与Redis数据一致性

《浅析如何保证MySQL与Redis数据一致性》在互联网应用中,MySQL作为持久化存储引擎,Redis作为高性能缓存层,两者的组合能有效提升系统性能,下面我们来看看如何保证两者的数据一致性吧... 目录一、数据不一致性的根源1.1 典型不一致场景1.2 关键矛盾点二、一致性保障策略2.1 基础策略:更新数