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.pswp.cn/news/715545.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/715545.shtml
英文地址,請注明出處:http://en.pswp.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;完全可以根據實際需求添加其他屬性&…