Airsim中运行OpenVINS和VINS_Fusion

  • 1. 简介
  • 2. 参考
  • 3. 步骤
    • 3.1 编译
    • 3.2 运行
    • 3.3 运行结果
    • 3.4 相机和IMU参数配置

1. 简介

本文简介在Airsim中运行OpenVINS和VINS_Fusion.

2. 参考

  1. 无人飞行器智能感知技术竞赛 赛事公告
  2. 在AirSim中控制无人机平台并采集数据
  3. OpenVINS 官网
  4. AirSim中运行VIO算法(VINS-Mono)

3. 步骤

3.1 编译

  1. 模拟器和Airsim_ros_wrapper下载安装
    参考该工程的README.md文件,本文按照“LINUX 单机开发模式”进行配置。
    (1)模拟器下载(simulator_LINUX.zip)
    在浏览器中输入此网址即可开始下载:
    https://stg-robomasters-hz-q0o2.oss-cn-hangzhou.aliyuncs.com/simulator/simulator_LINUX.zip
    (2)airsim_ros_wrapper下载
git clone https://github.com/RoboMaster/IntelligentUAVChampionshipSimulator.git
  1. OpenVINS 下载安装
    参照 OpenVINS的说明文档,安装OpenVINS.

  2. VINS_Fusion下载安装
    参照VINS-Fusion的README.md, 安装VINS-Fusion.

  3. 键盘控制脚本
    这个博客中提供了一个“无人机控制“的python脚本。复制该脚本的内容,保存为本地文件"airsim_keyboard.py"。

3.2 运行

  1. 启动Airsim仿真器 ( simulator_LINUX.zip )
python launcher.py

输入本机IP地址, 127.0.0.1; 启动成功之后,按键“3”, 切到 3.自主飞行-双目 模式。
2. 启动Airsim_ros_wrapper

cd  ${YourPath}/IntelligentUAVChampionshipSimulator/roswrapper
source ros/devel/setup.bash
./simulator.sh  127.0.0.1

用于将收到的Airsim中的数据通过ROS发布出来。
3. 启动OpenVINS

cd ${YourPath}/openvins_ws
source devel/setup.bash
roslaunch ov_msckf  airsim.launch

打开另一个终端,rviz显示openvins运行情况:

rviz  -d  '${YourPath}/openvins_ws/src/open_vins/ov_msckf/launch/display.rviz'
  1. 启动VINS-Fusion
roslaunch vins vins_rviz.launch
rosrun vins vins_node ~/catkin_ws/src/VINS-Fusion/config/euroc/euroc_stereo_imu_config.yaml
(optional) rosrun loop_fusion loop_fusion_node ~/catkin_ws/src/VINS-Fusion/config/airsim/airsim_stereo_imu_config.yaml
  1. 启动键盘控制脚本
python airsim_keyboard.py
  1. 同时录制bag数据
    录制的rosbag中,包含双目图像和IMU数据,以及无人机的轨迹真值数据。
rosbag  record   /airsim_node/drone_1/front_left/Scene  /airsim_node/drone_1/front_right/Scene   /airsim_node/drone_1/imu/imu    /airsim_node/drone_1/odom_local_ned
  1. 录制完rosbag之后,可以参考 “https://github.com/ethz-asl/kalibr/blob/master/aslam_offline_calibration/kalibr/python/kalibr_bagextractor” , 对bag中的数据进行提取。

3.3 运行结果

  • 仿真器: 在 simulator_LINUX/Settings/Stereo.json 中,设置 “ViewMode”: “NoDisplay”, 可以提高图像输出帧率。
  • OpenVINS
  • VINS-Fusion
  • 轨迹对齐
    • vio估计的轨迹
      OpenVINS 的 airsim.launch 文件中,配置“ dosave ”为“true”, 可以保存下运行轨迹 “traj_estimate.txt”, 并处理为euroc格式 (t, x, y, z, qw, qx, qy, qz )。
    • airsim的仿真真值
      读取rosbag中的“/airsim_node/drone_1/odom_local_ned” 数据,并保存为euroc格式的轨迹文件,命名为 truth.csv
    • evo轨迹对齐
evo_traj  euroc  traj_estimate.csv   --ref   truth.csv   -a  -p

3.4 相机和IMU参数配置

参考博客, 可以得到工程“simulator_LINUX/Settings/Stereo.json”中对应的相机参数(kalibr_imucam_chain.yaml)为:

%YAML:1.0cam0:T_imu_cam: #rotation from camera to IMU R_CtoI, position of camera in IMU p_CinI- [0.0, 0.0, 1.0, 0.26]- [1.0, 0.0, 0.0, -0.0475]- [0.0, 1.0, 0.0, 0.0]- [0.0, 0.0, 0.0, 1.0]cam_overlaps: [1]camera_model: pinholedistortion_coeffs: [0.0,0.0,0.0,0.0]distortion_model: radtanintrinsics: [268.511881977, 268.511881977, 320, 240] #fu, fv, cu, cv # horz fov is 100 degreeresolution: [640, 480]rostopic: /cam0/image_raw
cam1:T_imu_cam: #rotation from camera to IMU R_CtoI, position of camera in IMU p_CinI- [0.0, 0.0, 1.0, 0.26]- [1.0, 0.0, 0.0, 0.0475]- [0.0, 1.0, 0.0, 0.0]- [0.0, 0.0, 0.0, 1.0]cam_overlaps: [0]camera_model: pinholedistortion_coeffs: [0.0,0.0,0.0,0.0]distortion_model: radtanintrinsics: [268.511881977, 268.511881977, 320, 240] #fu, fv, cu, cv # horz fov is 100 degreeresolution: [640, 480]rostopic: /cam1/image_raw

IMU的噪声参数(kalibr_imu_chain.yaml)这里大致设为:

%YAML:1.0imu0:T_i_b:- [1.0, 0.0, 0.0, 0.0]- [0.0, 1.0, 0.0, 0.0]- [0.0, 0.0, 1.0, 0.0]- [0.0, 0.0, 0.0, 1.0]accelerometer_noise_density: 2.0000e-3  # [ m / s^2 / sqrt(Hz) ]   ( accel "white noise" )accelerometer_random_walk: 3.0000e-3    # [ m / s^3 / sqrt(Hz) ].  ( accel bias diffusion )gyroscope_noise_density: 1.6968e-04     # [ rad / s / sqrt(Hz) ]   ( gyro "white noise" )gyroscope_random_walk: 1.9393e-05       # [ rad / s^2 / sqrt(Hz) ] ( gyro bias diffusion )model: calibratedrostopic: /imu0time_offset: 0.0update_rate: 100.0

airsim.launch 如下:

<launch><!-- what config we are going to run (should match folder name) --><arg name="verbosity"   default="ALL" /> <!-- ALL, DEBUG, INFO, WARNING, ERROR, SILENT --><arg name="config"      default="airsim" /> <!-- euroc_mav, tum_vi, rpng_aruco --><arg name="config_path" default="$(find ov_msckf)/../config/$(arg config)/estimator_config.yaml" /><!-- mono or stereo and what ros bag to play --><arg name="max_cameras" default="2" /><arg name="use_stereo"  default="true" /><arg name="bag_start"   default="0" /> <!-- v1-2: 0, mh1: 40, mh2: 35, mh3: 17.5, mh4-5: 15 --><arg name="bag_rate"    default="1" /><arg name="dataset"     default="2022-08-24-10-59-44" /> <!-- V1_01_easy, V1_02_medium, V2_02_medium --><arg name="dobag"       default="false" /> <!-- if we should play back the bag --><arg name="bag"         default="/media/patrick/RPNG\ FLASH\ 3/$(arg config)/$(arg dataset).bag" /><!-- saving trajectory path and timing information --><arg name="dosave"      default="true" /><arg name="dotime"      default="false" /><arg name="path_est"    default="/tmp/traj_estimate.txt" /><arg name="path_time"   default="/tmp/traj_timing.txt" /><!-- if we should viz the groundtruth --><arg name="dolivetraj"  default="false" /><arg name="path_gt"     default="$(find ov_data)/$(arg config)/$(arg dataset).csv" /><!-- MASTER NODE! --><node name="ov_msckf" pkg="ov_msckf" type="run_subscribe_msckf" output="screen" clear_params="true" required="true"><remap from="/cam0/image_raw" to="/airsim_node/drone_1/front_left/Scene" /><remap from="/cam1/image_raw" to="/airsim_node/drone_1/front_right/Scene" /><remap from="/imu0" to="/airsim_node/drone_1/imu/imu" /><!-- master configuration object --><param name="verbosity"              type="string" value="$(arg verbosity)" /><param name="config_path"            type="string" value="$(arg config_path)" /><!-- world/filter parameters --><param name="use_stereo"             type="bool"   value="$(arg use_stereo)" /><param name="max_cameras"            type="int"    value="$(arg max_cameras)" /><!-- timing statistics recording --><param name="record_timing_information"   type="bool"   value="$(arg dotime)" /><param name="record_timing_filepath"      type="string" value="$(arg path_time)" /></node><!-- play the dataset --><group if="$(arg dobag)"><node pkg="rosbag" type="play" name="rosbag" args="-d 1 -r $(arg bag_rate) -s $(arg bag_start) $(arg bag)" required="true"/></group><!-- record the trajectory if enabled --><group if="$(arg dosave)"><node name="recorder_estimate" pkg="ov_eval" type="pose_to_file" output="screen" required="true"><param name="topic"      type="str" value="/ov_msckf/poseimu" /><param name="topic_type" type="str" value="PoseWithCovarianceStamped" /><param name="output"     type="str" value="$(arg path_est)" /></node></group><!-- path viz of aligned gt --><group if="$(arg dolivetraj)"><node name="live_align_trajectory" pkg="ov_eval" type="live_align_trajectory" output="log" clear_params="true"><param name="alignment_type" type="str" value="posyaw" /><param name="path_gt"        type="str" value="$(arg path_gt)" /></node></group></launch>

Airsim中运行OpenVINS和VINS_Fusion相关推荐

  1. 基于深度学习网络在Airsim中的自动驾驶

    **Airsim仿真平台介绍及模型建立** Airsim是一款基于Unreal Engine构建的无人机.汽车等模拟器的开源平台,并且可以跨平台的通过PX4飞行控制器进行仿真控制,在物理和视觉上逼真的 ...

  2. AirSim (六) ---理解篇: Airsim中的IMU数据信息

    目录 1 理解好IMU的输出数据 2 AirSim中如何生成IMU数据 3 AirSim中如何读取IMU数据 4. IMU的数据 in AirSim and ROS IMU Message 1 理解好 ...

  3. AirSim中只能同时起飞五架飞机的问题

    1.问题及现象 最近在做AirSim的无人机仿真,想做无人机的群控,但是出现一个很奇怪的问题.每次无人机只能同时起飞5架,例如在场景中有八架飞机,如果让他们同时起飞的话,会有五架飞机先起飞然后另外三架 ...

  4. 安卓中运行报错Error:Execution failed for task ':app:transformClassesWithDexForDebug'解决

    在androidstuio中运行我的未完项目,报错: Error:Execution failed for task ':app:transformClassesWithDexForDebug'. & ...

  5. 程序在内存中运行的奥秘

    简介 当丰富多彩的应用程序在计算机上运行,为你每天的工作和生活带来便利时,你是否知道它们是如何在计算机中工作呢?本文用形象的图表与生动的解释,揭示了程序在计算机中运行的奥秘. 内存管理是操作系统的核心 ...

  6. IIS配置相关问题:Framework 4.5 在IIS 7.5中运行

    <system.webServer>     <validation validateIntegratedModeConfiguration="false" /& ...

  7. docker保护python源码_Tensorflow在Docker中运行和源码编译

    本文分享在在Docker中运行Tensorflow和进行源码编译的方法和步骤,包括:编译.构建docker镜像.创建和运行Docker容器.部署完的容器可以通过Jupyter Notebook进行访问 ...

  8. 在 Linux“.NET研究” 操作系统中运行 ASP.NET 4 (下)

    "在 Linux 操作系统中运行 ASP.NET 4 (中)"中已经配置好了 openSUSE 11.3 操作系统. 现在,我们进入"GNOME 终端",使用 ...

  9. “Matlab R2016a中运行‘mex -setup’,错误使用 mex 未找到支持的编译器或 SDK”的解决办法

    目录 问题描述: 原因分析: 解决方案: 1.失败经验 2.成功方法 (1)下载MinGW-w64 C/C++ 编译器 (2)安装MinGW-w64 C/C++ 编译器 (3)设置为系统环境变量 (4 ...

最新文章

  1. mysql同时购买两种商品_SQL题1——查询所有购入商品为两种或两种以上的购物人记录...
  2. 对vector等STL标准容器进行排序操作
  3. matlab 常用m文件,MATLAB基础课程 第三章 M文件知识(4)
  4. 开源若要天下闻,掌声须给教育人
  5. python中abc属于字符串吗_在Python中,字符串s = 'abc',那么执行表达式s+'d'之后,s的打印结果是( )。...
  6. 江苏省有JAVA技能大赛,江苏省职业学校技能大赛组委会
  7. 网络软工个人作业4——Alpha阶段个人总结
  8. 机器学习笔记(十三):主成分分析法(PCA)
  9. 汇总15位身份证号和18位身份证号的区别
  10. [Android] [Hybrid APP开发简述]
  11. 邮件客户端远程管理邮箱
  12. 2022-2028全球植物生长帐篷行业调研及趋势分析报告
  13. js html5 音乐播放器代码大全,js实现简单音乐播放器
  14. 码元速率、数据速率、信道带宽、信道容量、载波的概念
  15. Android H5页出现广告分析和解决方案
  16. 云计算——第七天(寒假)
  17. 可以复用的数据中台架构与建设实践 | 数据中台公开课
  18. IP通讯名词解释-BLF(Busy Lamp Field)
  19. WebSocket实现android消息推送
  20. java 判断是否是字母_java中判断是否是字母

热门文章

  1. 卸甲归田——回顾CSP2019
  2. [Office] Microsoft Office Outlook 2007/2010 设置邮件已读/未读快捷键
  3. TAR GZ 压缩,解压缩命令
  4. 嵌入式ARM设计编程(二) 字符串拷贝
  5. 致——世界上最幸福的女孩——Chtholly
  6. G1D45-与英文编辑沟通(cover letter、催稿一类)
  7. 正则表达式替换某个字符
  8. 第五代选择器Icarus
  9. CAD输入坐标的方式有哪些?
  10. datax——全量、增量同步