Vins-Moon配准运行

Vins-Moon运行

  • 源码地址
  • 电脑配置
  • 环境配置
  • 编译
  • 适配Kitti数据集
  • 运行结果
    • Euroc数据集
    • kitti数据集
  • evo评估(KITTI数据)
    • 输出轨迹(tum格式)
    • 结果

源码地址

源码链接:https://github.com/HKUST-Aerial-Robotics/VINS-Mono.git

电脑配置

Ubuntu 18.04 + ROS Melodic + GTSAM 4.0.2 + CERES 1.14.0
pcl1.8+vtk8.2.0+opencv3.2.0

环境配置

之前已经配置过LVI-SAM的环境,所以没有什么额外需要配置的(可参考之前的博客)

编译

 cd ~/catkin_ws/srcgit clone https://github.com/HKUST-Aerial-Robotics/VINS-Mono.gitcd ..catkin_make -j2

注:直接catkin_make会死机

适配Kitti数据集

在config文件夹下新建kitti文件夹
新建kitti_config.yaml文件
(具体参数设置的方式,可以参考之前LVI-SAM博客)

%YAML:1.0#common parameters
imu_topic: "/imu_raw"   #"/kitti/oxts/imu"
image_topic: "/kitti/camera_gray_left/image_raw"
output_path: "/home/nssc/sbk/outputs/map/vinsmoon/"#camera calibration 
model_type: PINHOLE
camera_name: camera
#10_03
# image_width: 1241
# image_height: 376
# 09_30
image_width: 1226
image_height: 370
distortion_parameters:k1: 0.0k2: 0.0p1: 0.0p2: 0.0
projection_parameters:
# 10_03
#   fx: 7.188560e+02
#   fy: 7.188560e+02
#   cx: 6.071928e+02
#   cy: 1.852157e+02# 09_30fx: 7.070912e+02fy: 7.070912e+02cx: 6.018873e+02cy: 1.831104e+02# 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.# 2  Don't know anything about extrinsic parameters. You don't need to give R,T. We will try to calibrate it. Do some rotation movement at beginning.                        
#If you choose 0 or 1, you should write down the following matrix.
#Rotation from camera frame to imu frame, imu^R_cam
extrinsicRotation: !!opencv-matrixrows: 3cols: 3dt: d#  10_03# data: [0.00875116, -0.00479609,  0.99995027, -0.99986428, -0.01400249,  0.00868325, 0.01396015, -0.99989044, -0.00491798]#  09_30data: [0.00781298, -0.0042792,  0.99996033,-0.99985947, -0.01486805,  0.00774856, 0.0148343 , -0.99988023, -0.00439476]     #Translation from camera frame to imu frame, imu^T_cam
extrinsicTranslation: !!opencv-matrixrows: 3cols: 1dt: d#  10_03# data: [1.10224312,-0.31907194,  0.74606588]
#09_30 data: [1.14389871,-0.31271847,  0.72654605]#feature traker paprameters
max_cnt: 150            # 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
equalize: 1             # if image is too dark or light, trun on equalize to find enough features
fisheye: 0              # if using fisheye, trun on it. A circle mask will be loaded to remove edge noisy points#optimization parameters
max_solver_time: 0.04  # max solver itration time (ms), to guarantee real time
max_num_iterations: 8   # max solver itrations, to guarantee real time
keyframe_parallax: 10.0 # keyframe selection threshold (pixel)#imu parameters       The more accurate parameters you provide, the better performance
acc_n: 0.08          # accelerometer measurement noise standard deviation. #0.2   0.04
gyr_n: 0.004         # gyroscope measurement noise standard deviation.     #0.05  0.004
acc_w: 0.00004         # accelerometer bias random work noise standard deviation.  #0.02
gyr_w: 2.0e-6       # gyroscope bias random work noise standard deviation.     #4.0e-5
g_norm: 9.81007     # gravity magnitude#loop closure parameters
loop_closure: 1                    # start loop closure
load_previous_pose_graph: 0        # load and reuse previous pose graph; load from 'pose_graph_save_path'
fast_relocalization: 0             # useful in real-time and large project
pose_graph_save_path: "/home/nssc/sbk/outputs/map/vinsmoon/pose_graph/" # save and load path#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)#rolling shutter parameters
rolling_shutter: 0                  # 0: global shutter camera, 1: rolling shutter camera
rolling_shutter_tr: 0               # unit: s. rolling shutter read out time per frame (from data sheet). #visualization parameters
save_image: 1                   # save image in pose graph for visualization prupose; you can close this function by setting 0 
visualize_imu_forward: 0        # output imu forward propogation to achieve low latency and high frequence results
visualize_camera_size: 0.4      # size of camera marker in RVIZ

在vins_estimator/launch/文件夹下新建文件kitti.launch
(主要修改一下config_path的路径)

<launch><arg name="config_path" default = "$(find feature_tracker)/../config/kitti/kitti_config.yaml" /><arg name="vins_path" default = "$(find feature_tracker)/../config/../" /><node name="feature_tracker" pkg="feature_tracker" type="feature_tracker" output="log"><param name="config_file" type="string" value="$(arg config_path)" /><param name="vins_folder" type="string" value="$(arg vins_path)" /></node><node name="vins_estimator" pkg="vins_estimator" type="vins_estimator" output="screen"><param name="config_file" type="string" value="$(arg config_path)" /><param name="vins_folder" type="string" value="$(arg vins_path)" /></node><node name="pose_graph" pkg="pose_graph" type="pose_graph" output="screen"><param name="config_file" type="string" value="$(arg config_path)" /><param name="visualization_shift_x" type="int" value="0" /><param name="visualization_shift_y" type="int" value="0" /><param name="skip_cnt" type="int" value="0" /><param name="skip_dis" type="double" value="0" /></node></launch>

运行结果

Euroc数据集

 roslaunch vins_estimator euroc.launch roslaunch vins_estimator vins_rviz.launchrosbag play YOUR_PATH_TO_DATASET/MH_01_easy.bag 

在这里插入图片描述同时看到groundtrue:

roslaunch benchmark_publisher publish.launch sequence_name:=MH_01_easy

在这里插入图片描述

kitti数据集

有关kitti数据集生成bag包的方式,可参考之前生成LVI-SAM适配数据的博客

 roslaunch vins_estimator kitti.launch roslaunch vins_estimator vins_rviz.launchrosbag play YOUR_PATH_TO_DATASET/ rosbag play kitti_2011_09_30_drive_0027_synced.bag

在这里插入图片描述

evo评估(KITTI数据)

输出轨迹(tum格式)

vins_estimator/src/utility/visualization.cpp
pubOdometry()函数150+行

        // write result to file// ofstream foutC(VINS_RESULT_PATH, ios::app);// foutC.setf(ios::fixed, ios::floatfield);// foutC.precision(0);// foutC << header.stamp.toSec() * 1e9 << ",";// foutC.precision(5);// foutC << estimator.Ps[WINDOW_SIZE].x() << ","//       << estimator.Ps[WINDOW_SIZE].y() << ","//       << estimator.Ps[WINDOW_SIZE].z() << ","//       << tmp_Q.w() << ","//       << tmp_Q.x() << ","//       << tmp_Q.y() << ","//       << tmp_Q.z() << ","//       << estimator.Vs[WINDOW_SIZE].x() << ","//       << estimator.Vs[WINDOW_SIZE].y() << ","//       << estimator.Vs[WINDOW_SIZE].z() << "," << endl;ofstream foutC(VINS_RESULT_PATH, ios::app);foutC.setf(ios::fixed, ios::floatfield);foutC.precision(9);foutC << header.stamp.toSec() << " ";foutC.precision(5);foutC << estimator.Ps[WINDOW_SIZE].x() << " "<< estimator.Ps[WINDOW_SIZE].y() << " "<< estimator.Ps[WINDOW_SIZE].z() << " "<< tmp_Q.x() << " "<< tmp_Q.y() << " "<< tmp_Q.z() << " "<< tmp_Q.w() << endl;foutC.close();

pose_graph/src/pose_graph.cpp
addKeyFrame()函数150+行

    if (SAVE_LOOP_PATH){// ofstream loop_path_file(VINS_RESULT_PATH, ios::app);// loop_path_file.setf(ios::fixed, ios::floatfield);// loop_path_file.precision(0);// loop_path_file << cur_kf->time_stamp * 1e9 << ",";// loop_path_file.precision(5);// loop_path_file  << P.x() << ","//       << P.y() << ","//       << P.z() << ","//       << Q.w() << ","//       << Q.x() << ","//       << Q.y() << ","//       << Q.z() << ","//      << endl;ofstream loop_path_file(VINS_RESULT_PATH, ios::app);loop_path_file.setf(ios::fixed, ios::floatfield);loop_path_file.precision(0);loop_path_file << cur_kf->time_stamp << " ";loop_path_file.precision(5);loop_path_file  << P.x() << " "<< P.y() << " "<< P.z() << " "<< Q.x() << " "<< Q.y() << " "<< Q.z() << " "<< Q.w() << endl;    loop_path_file.close();}

updatePath()函数600+行

        if (SAVE_LOOP_PATH){// ofstream loop_path_file(VINS_RESULT_PATH, ios::app);// loop_path_file.setf(ios::fixed, ios::floatfield);// loop_path_file.precision(0);// loop_path_file << (*it)->time_stamp * 1e9 << ",";// loop_path_file.precision(5);// loop_path_file  << P.x() << ","//       << P.y() << ","//       << P.z() << ","//       << Q.w() << ","//       << Q.x() << ","//       << Q.y() << ","//       << Q.z() << ","//       << endl;ofstream loop_path_file(VINS_RESULT_PATH, ios::app);loop_path_file.setf(ios::fixed, ios::floatfield);loop_path_file.precision(0);loop_path_file << (*it)->time_stamp << " ";loop_path_file.precision(5);loop_path_file  << P.x() << " "<< P.y() << " "<< P.z() << " "<< Q.x() << " "<< Q.y() << " "<< Q.z() << " "<< Q.w() << endl;loop_path_file.close();}

pose_graph_node.cpp中的main()函数

       # VINS_RESULT_PATH = VINS_RESULT_PATH + "/vins_result_loop.csv";VINS_RESULT_PATH = VINS_RESULT_PATH + "/vins_result_loop.txt";

对输出的vins_result_loop.txt文件修改时间戳

# 读取txt文件
with open('vins_result_loop.txt', 'r') as file:lines = file.readlines()# 处理数据
first_line = lines[0].strip().split()
first_num = int(first_line[0])
output_lines = []
for line in lines[0:]:parts = line.split()new_num = float(parts[0]) - first_numnew_line = str(new_num)  +' '+ ' '.join(parts[1:]) + '\n'output_lines.append(new_line)# 写入txt文件
with open('output.txt', 'w') as file:for line in output_lines:file.write(''.join(line))

结果

evo_traj tum output.txt 07_gt_tum.txt --ref=07_gt_tum.txt -a -p --plot_mode=xyz


在这里插入图片描述
在这里插入图片描述

参考链接:
https://blog.csdn.net/m0_49066914/article/details/131814856
https://blog.csdn.net/Hanghang_/article/details/104535370

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/715545.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

破解SQL Server迷局,彻底解决“管道的另一端无任何进程错误233”

问题描述&#xff1a;在使用 SQL Server 2014的时候&#xff0c;想用 SQL Server 身份方式登录 SQL Servcer Manager&#xff0c;结果报错&#xff1a; 此错误消息&#xff1a;表示SQL Server未侦听共享内存或命名管道协议。 问题原因&#xff1a;此问题的原因有多种可能 管道…

人才测评系统在企业中的作用有哪些?

一个企业除了产出价值给社会&#xff0c;它还有自己的工作架构体系&#xff0c;无论的工作时间制度上&#xff0c;还是工资组成方向&#xff0c;这样公司才能正常运转&#xff0c;那么人才测评系统可以在企业中充当一个什么角色呢&#xff1f;又或者说它起着什么作用呢&#xf…

【数据结构】栈和队列(概念选择题)

1.概念选择题 1.一个栈的初始状态为空。现将元素1、2、3、4、5、A、B、C、D、E依次入栈&#xff0c;然后再依次出栈&#xff0c;则元素出 栈的顺序是&#xff08; &#xff09;。 A 12345ABCDE B EDCBA54321 C ABCDE12345 D 54321EDCBA2.若进栈序列为 1,2,3,4 &#xff0c;进栈…

走进SQL审计视图——《OceanBase诊断系列》之二

1. 前言 在SQL性能诊断上&#xff0c;OceanBase有一个非常实用的功能 —— SQL审计视图(gv$sql_audit)。在OceanBase 4.0.0及更高版本中&#xff0c;该功能是 gv$ob_sql_audit。它可以使开发和运维人员更方便地排查在OceanBase上运行过的任意一条SQL&#xff0c;无论这些SQL是成…

字节前端实习一面

1.自我介绍 实习经历介绍 2.选择前端的原因 3.如何解决跨域 4.tailwind CSS 这个是我其中一个项目中使用的&#xff0c;但我当时只是当它工具使用的&#xff0c;直接问我实现原理和优势等等。实现原理我没回答好&#xff0c;但这个确实是一个好问题 代码题&#xff1a; 1.let …

层级锁笔记

注意看test_hierarchy_lock函数 如果thread t2的不注释&#xff0c;就会报错。 这是因为层级锁强调的单个线程内上锁的顺序。 线程t2若已经获取了hmtx2&#xff0c;再试图获取hmtx1就会因为违反层级顺序而抛出异常。 #include <mutex> #include <thread> //层级锁…

kafka文件存储机制和消费者

1.broker文件存储机制 去查看真正的存储文件&#xff1a; 在/opt/module/kafka/datas/ 路径下 kafka-run-class.sh kafka.tools.DumpLogSegments --files ./00000000000000000000.index 如果是6415那么这个会存储在563的log文件之中&#xff0c;因为介于6410和10090之间。 2.…

java mysql八股

mysql中如何定位慢查询 表象&#xff1a;页面加载过慢、接口压测响应时间较长&#xff08;超过1秒&#xff09; 可以采用开源工具如Arthas以及Skywalking&#xff0c;使用skywalking可以检测出哪个接口过慢。同时可以在mysql中开启慢日志查询&#xff0c;设置值为2秒&#xff0…

基于YOLOv8/YOLOv7/YOLOv6/YOLOv5的行人车辆检测与计数(Python+PySide6界面+训练代码)

摘要&#xff1a;开发行人车辆检测与计数系统对于提升城市交通管理和监控系统的效率至关重要。本篇博客详细介绍了如何利用深度学习构建一个行人车辆检测与计数系统&#xff0c;并提供了完整的实现代码。该系统基于强大的YOLOv8算法&#xff0c;并结合了YOLOv7、YOLOv6、YOLOv5…

[Java 探索者之路] 一个大厂都在用的分布式任务调度平台

分布式任务调度平台是一种能够在分布式计算环境中调度和管理任务的系统&#xff0c;在此环境下&#xff0c;各个任务可以在独立的节点上运行。它有助于提升资源利用率&#xff0c;增强系统扩展性以及提高系统对错误的容忍度。 文章目录 1. 分布式任务调度平台1. 基本概念1.1 任…

Linux文本处理三剑客:sed

在Linux操作系统中&#xff0c;grep、sed、awk被称为文本操作“三剑客”&#xff0c;上一期中&#xff0c;我们将详细介绍grep的基本使用方法&#xff0c;希望能够帮助到有需要的朋友&#xff0c;现在&#xff0c;我们继续学习sed。 我会参考官方文档来做翻译理解。下面正式开…

使用Java同步Linux服务器时间

前言 公司客户线上服务器采用的是UOS系统&#xff0c;实施发现系统不会同步时间&#xff0c;并且时间有真实时间有偏差&#xff0c;本意想安装NTP授时服务&#xff0c;结果发现UOS安装NTP都要折腾好久&#xff0c;遂采用Java来曲线救国了。 添加依赖 <dependency><…

Java基于SpringBoot的旅游网站的设计与实现论文

目 录 摘 要 2 Abstract 3 1.1 课题开发的背景 4 1.2 课题研究的意义 4 1.3 研究内容 5 第二章 系统开发关键技术 6 2.1 JSP技术介绍 6 2.2 JAVA简介 6 2.3 MyEclipse开发环境 7 2.4 Tomcat服务器 7 2.5 Spring Boot框架 7 2.6 MySQL数据库 8 第三章 系统分析 9 3.1 系统可行性…

实践航拍小目标检测,基于YOLOv8全系列【n/s/m/l/x】参数模型开发构建无人机航拍场景下的小目标检测识别分析系统

关于无人机相关的场景在我们之前的博文也有一些比较早期的实践&#xff0c;感兴趣的话可以自行移步阅读即可&#xff1a; 《deepLabV3Plus实现无人机航拍目标分割识别系统》 《基于目标检测的无人机航拍场景下小目标检测实践》 《助力环保河道水质监测&#xff0c;基于yolov…

使用 llama.cpp 在本地部署 AI 大模型的一次尝试

对于刚刚落下帷幕的2023年,人们曾经给予其高度评价——AIGC元年。随着 ChatGPT 的火爆出圈,大语言模型、AI 生成内容、多模态、提示词、量化…等等名词开始相继频频出现在人们的视野当中,而在这场足以引发第四次工业革命的技术浪潮里,人们对于人工智能的态度,正从一开始的…

JVM(5)

垃圾回收相关 垃圾收集器 警告:纯八股文! 如果说上面我们讲的收集算法是内存回收的方法论,那么垃圾收集器就是内存回收的具体体现. 垃圾收集器的作用:垃圾收集器是为了保证程序能够正常,持久运行的一种技术,它是将程序中不用的死亡对象也就是垃圾对象进行清除,从而保证新的…

第四十五天| 322. 零钱兑换、279.完全平方数

Leetcode 322. 零钱兑换 题目链接&#xff1a;322 零钱兑换 题干&#xff1a;给你一个整数数组 coins &#xff0c;表示不同面额的硬币&#xff1b;以及一个整数 amount &#xff0c;表示总金额。计算并返回可以凑成总金额所需的 最少的硬币个数 。如果没有任何一种硬币组合能…

AI大语言模型【成像光谱遥感技术】ChatGPT应用指南

遥感技术主要通过卫星和飞机从远处观察和测量我们的环境&#xff0c;是理解和监测地球物理、化学和生物系统的基石。ChatGPT是由OpenAI开发的最先进的语言模型&#xff0c;在理解和生成人类语言方面表现出了非凡的能力。本文重点介绍ChatGPT在遥感中的应用&#xff0c;人工智能…

vscode + git

写在前面&#xff1a; origin分支&#xff1a; 当我们在使用git clone的时候&#xff0c;git会自动地将这个远程的repo命名为origin&#xff0c;拉取它所有的数据之后&#xff0c;创建一个指向它master的指针&#xff0c;命名为origin/master&#xff0c;之后会在本地创建一个…

C#单向链表实现:用泛型类在当前位置插入新数据的方法Insert()

一、涉及到的知识点 1.ListNode<T>类 ListNode<T>是一个泛型类&#xff0c;用于表示链表中的一个节点。Value和Next属性是ListNode<T>最基本的属性&#xff0c;用于表示节点的值和指向下一个节点的引用。但是&#xff0c;完全可以根据实际需求添加其他属性&…