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

相关文章

批量导入txt数据到的redis过程

《批量导入txt数据到的redis过程》用户通过将Redis命令逐行写入txt文件,利用管道模式运行客户端,成功执行批量删除以Product*匹配的Key操作,提高了数据清理效率... 目录批量导入txt数据到Redisjs把redis命令按一条 一行写到txt中管道命令运行redis客户端成功了批量删除k

SpringBoot多环境配置数据读取方式

《SpringBoot多环境配置数据读取方式》SpringBoot通过环境隔离机制,支持properties/yaml/yml多格式配置,结合@Value、Environment和@Configura... 目录一、多环境配置的核心思路二、3种配置文件格式详解2.1 properties格式(传统格式)1.

解决pandas无法读取csv文件数据的问题

《解决pandas无法读取csv文件数据的问题》本文讲述作者用Pandas读取CSV文件时因参数设置不当导致数据错位,通过调整delimiter和on_bad_lines参数最终解决问题,并强调正确参... 目录一、前言二、问题复现1. 问题2. 通过 on_bad_lines=‘warn’ 跳过异常数据3

MySQL多实例管理如何在一台主机上运行多个mysql

《MySQL多实例管理如何在一台主机上运行多个mysql》文章详解了在Linux主机上通过二进制方式安装MySQL多实例的步骤,涵盖端口配置、数据目录准备、初始化与启动流程,以及排错方法,适用于构建读... 目录一、什么是mysql多实例二、二进制方式安装MySQL1.获取二进制代码包2.安装基础依赖3.清

C#监听txt文档获取新数据方式

《C#监听txt文档获取新数据方式》文章介绍通过监听txt文件获取最新数据,并实现开机自启动、禁用窗口关闭按钮、阻止Ctrl+C中断及防止程序退出等功能,代码整合于主函数中,供参考学习... 目录前言一、监听txt文档增加数据二、其他功能1. 设置开机自启动2. 禁止控制台窗口关闭按钮3. 阻止Ctrl +

java如何实现高并发场景下三级缓存的数据一致性

《java如何实现高并发场景下三级缓存的数据一致性》这篇文章主要为大家详细介绍了java如何实现高并发场景下三级缓存的数据一致性,文中的示例代码讲解详细,感兴趣的小伙伴可以跟随小编一起学习一下... 下面代码是一个使用Java和Redisson实现的三级缓存服务,主要功能包括:1.缓存结构:本地缓存:使

在IntelliJ IDEA中高效运行与调试Spring Boot项目的实战步骤

《在IntelliJIDEA中高效运行与调试SpringBoot项目的实战步骤》本章详解SpringBoot项目导入IntelliJIDEA的流程,教授运行与调试技巧,包括断点设置与变量查看,奠定... 目录引言:为良驹配上好鞍一、为何选择IntelliJ IDEA?二、实战:导入并运行你的第一个项目步骤1

在MySQL中实现冷热数据分离的方法及使用场景底层原理解析

《在MySQL中实现冷热数据分离的方法及使用场景底层原理解析》MySQL冷热数据分离通过分表/分区策略、数据归档和索引优化,将频繁访问的热数据与冷数据分开存储,提升查询效率并降低存储成本,适用于高并发... 目录实现冷热数据分离1. 分表策略2. 使用分区表3. 数据归档与迁移在mysql中实现冷热数据分

C#解析JSON数据全攻略指南

《C#解析JSON数据全攻略指南》这篇文章主要为大家详细介绍了使用C#解析JSON数据全攻略指南,文中的示例代码讲解详细,感兴趣的小伙伴可以跟随小编一起学习一下... 目录一、为什么jsON是C#开发必修课?二、四步搞定网络JSON数据1. 获取数据 - HttpClient最佳实践2. 动态解析 - 快速

MyBatis-Plus通用中等、大量数据分批查询和处理方法

《MyBatis-Plus通用中等、大量数据分批查询和处理方法》文章介绍MyBatis-Plus分页查询处理,通过函数式接口与Lambda表达式实现通用逻辑,方法抽象但功能强大,建议扩展分批处理及流式... 目录函数式接口获取分页数据接口数据处理接口通用逻辑工具类使用方法简单查询自定义查询方法总结函数式接口