Intel RealSense D435i与IMU标定用于vins-fusion

2023-05-16

1、标定imu工具

mkdir -p imu_catkin_ws/src
cd  imu_catkin_ws/src
git clone https://github.com/gaowenliang/code_utils.git
git clone https://github.com/gaowenliang/imu_utils.git
cd ..
catkin_make
source /devel/setup.bash

-----------------------------------------------------------出现的问题--------------------------------------------------

/home/sfann/imu_catkin_ws/src/code_utils-master/include/code_utils/backward.hpp:216:12: fatal error: elfutils/libdw.h: 没有那个文件或目录

include <elfutils/libdw.h>

compilation terminated.

sudo apt-get install libdw-dev

/home/sfann/imu_catkin_ws/src/code_utils-master/src/sumpixel_test.cpp:2:10: fatal error: backward.hpp: 没有那个文件或目录
#include “backward.hpp”
compilation terminated.
code_utils-master/CMakeFiles/sumpixel_test.dir/build.make:62: recipe for target ‘code_utils-master/CMakeFiles/sumpixel_test.dir/src/sumpixel_test.cpp.o’ failed
make[2]: *** [code_utils-master/CMakeFiles/sumpixel_test.dir/src/sumpixel_test.cpp.o] Error 1
CMakeFiles/Makefile2:857: recipe for target ‘code_utils-master/CMakeFiles/sumpixel_test.dir/all’ failed
make[1]: *** [code_utils-master/CMakeFiles/sumpixel_test.dir/all] Error 2
make[1]: *** 正在等待未完成的任务…
In file included from /home/sfann/imu_catkin_ws/src/code_utils-master/src/mat_io_test.cpp:2:0:
/home/sfann/imu_catkin_ws/src/code_utils-master/include/code_utils/backward.hpp:216:12: fatal error: elfutils/libdw.h: 没有那个文件或目录

include <elfutils/libdw.h>

compilation terminated.
code_utils-master/CMakeFiles/matIO_test.dir/build.make:62: recipe for target ‘code_utils-master/CMakeFiles/matIO_test.dir/src/mat_io_test.cpp.o’ failed
make[2]: *** [code_utils-master/CMakeFiles/matIO_test.dir/src/mat_io_test.cpp.o] Error 1
CMakeFiles/Makefile2:719: recipe for target ‘code_utils-master/CMakeFiles/matIO_test.dir/all’ failed
make[1]: *** [code_utils-master/CMakeFiles/matIO_test.dir/all] Error 2
Makefile:140: recipe for target ‘all’ failed
make: *** [all] Error 2
Invoking “make -j4 -l4” failed

将sumpixel_test.cpp中# include "backward.hpp"改为:#include "code_utils/backward.hpp"

******************imu标定
打开/imu_catkin_ws/src/imu_utils/launch,打开终端运行

roslaunch mavros px4.launch
gedit imu_calibration.launch

launch文件中写入如下内容

<launch>

    <node pkg="imu_utils" type="imu_an" name="imu_an" output="screen">
    	<!--TOPIC名称和上面一致-->
        <param name="imu_topic" type="string" value= "/mavros/imu/data"/>
        <!--imu_name 无所谓-->
        <param name="imu_name" type="string" value= "px4"/>
        <!--标定结果存放路径-->
        <param name="data_save_path" type="string" value= "$(find imu_utils)/data/"/>
        <!--数据录制时间-min-->
        <param name="max_time_min" type="int" value= "120"/>
        <!--采样频率,即是IMU频率,采样频率可以使用rostopic hz /camera/imu查看,设置为400,为后面的rosbag play播放频率-->
        <param name="max_cluster" type="int" value= "200"/>
    </node>
    
</launch>

插上相机,realsense静止放置,放置时间要稍大于imu_calibration.launch中的录制时间,即大于120分钟

rosbag record -O imu_calibration /mavros/imu/data

等待两小时录制完之后就按下ctrl+c,结束录制。运行校准程序

roslaunch imu_utils imu_calibration.launch
rosbag play -r 400 imu_calibration.bag

其中 -r 400是指400速播放bag数据

标定结束后在imu_catkin_ws/src/imu_utils/data中生成许多文件,其中imu_param.yaml就是我们想要的结果,展示如下:

2、相机标定工具kalibr
依赖环境

sudo apt-get install python-setuptools python-rosinstall ipython libeigen3-dev libboost-all-dev doxygen libopencv-dev
sudo apt-get install ros-melodic-vision-opencv ros-melodic-image-transport-plugins ros-melodic-cmake-modules 
sudo apt-get install software-properties-common software-properties-common libpoco-dev python-matplotlib python-scipy python-git python-pip ipython 
sudo apt-get install libtbb-dev libblas-dev liblapack-dev python-catkin-tools libv4l-dev
sudo apt-get install python-igraph 
mkdir -p /kalibr_workspace/src
cd /kalibr_workspace
source /opt/ros/melodic/setup.bash
catkin init
catkin config --extend /opt/ros/melodic
catkin config --merge-devel # Necessary for catkin_tools >= 0.4. 
catkin config --cmake-args -DCMAKE_BUILD_TYPE=Release
cd /kalibr_workspace/src
git clone https://github.com/ethz-asl/Kalibr.git
git clone https://github.com/ethz-asl/kalibr/tree/fix/18.04.git
catkin build -DCMAKE_BUILD_TYPE=Release -j4
source ~/kalibr_workspace/devel/setup.bash

下载标定板

https://github.com/ethz-asl/kalibr/wiki/downloads

在这里插入图片描述
在这里插入图片描述
原始pdf的格子参数是:6*6的格子
大格子边长:5.5cm
小格子边长:1.65cm
小格子与大格子边长比例:0.3
打印A4纸的格子参数是:
大格子边长:2.4cm
小格子边长:0.7cm
小格子与大格子边长比例:0.3
生产标定板文件

cd kalibr_workspace   
gedit april_6x6_A4.yaml
kalibr_create_target_pdf --type apriltag --nx 6 --ny 6 --tsize 0.024 --tspace 0.3

填写内容

target_type: 'aprilgrid' #gridtype
tagCols: 6               #number of apriltags
tagRows: 6               #number of apriltags
tagSize: 0.024           #size of apriltag, edge to edge [m]
tagSpacing: 0.3          #ratio of space between tags to tagSize

标定板参数定义

–type apriltag 标定板类型

–nx [NUM_COLS] 列个数

–ny [NUM_ROWS] 行个数

–tsize [TAG_WIDTH_M] 二维码方格长度,单位m

–tspace [TAG_SPACING_PERCENT] 小方格与二维码方格长度比例
关闭结构光
在这里插入图片描述

roslaunch realsense2_camera rs_camera.launch
rviz
rosrun topic_tools throttle messages /camera/color/image_raw 4.0 /color & rosrun topic_tools throttle messages /camera/infra1/image_rect_raw 4.0 /infra_left & rosrun topic_tools throttle messages /camera/infra2/image_rect_raw 4.0 /infra_right
rosbag record -O multicameras_calibration /infra_left /infra_right /color
rosrun kalibr kalibr_calibrate_cameras --target april_6x6_A4.yaml --bag  multicameras_calibration.bag --models pinhole-equi pinhole-equi pinhole-equi --topics /infra_left /infra_right /color --bag-from-to 10 100 --show-extraction

打开rviz观察合理的距离,要求摄像头能看到标定棋盘格。
kalibr在处理标定数据的时候要求频率不能太高,一般为4Hz,我们可以使用如下命令来更改topic的频率,实际上是将原来的topic以新的频率转成新的topic,实际测试infra1才是对应左目相机

3、IMU+双目标定

  1. 编辑yaml文件
    新建 camchain.yaml,imu.yaml
    官方教程https://github.com/ethz-asl/kalibr/wiki/yaml-formats
    在这里插入图片描述
gedit camchain.yaml

参数参考上面得到的yaml文件,没有的参数可以删除,最终结果示例如下:

cam0:
  camera_model: pinhole
  intrinsics: [422.64066392524313, 424.02986182898763, 433.8337283244407, 239.28229368758497]
  distortion_model: equidistant
  distortion_coeffs: [0.3504343204199696,  0.09942954345832032, 0.06984316113464994, 0.06546342606600335]
  rostopic: /infra_left
  resolution: [848, 480]
cam1:
  camera_model: pinhole
  intrinsics: [422.6846630997528, 424.22648250200166, 432.1283922008165, 239.61231361314714]
  distortion_model: equidistant
  distortion_coeffs: [0.34116697848102345, 0.14997256247725585, -0.035613030583661255, 0.12752761977350466]
  T_cn_cnm1:
  - [0.9999944120461245, -5.1892669972653565e-05, 0.0033426312493865813, -0.04991163289867289]
  - [5.4683759833798546e-05, 0.999999649965876, -0.0008349118544065274, 1.250629277077362e-05]
  - [-0.0033425867535462755, 0.0008350899766020524, 0.9999940648516464, -0.00011162780864553323]
  - [0.0,0.0,0.0,1.0]
  rostopic: /infra_right
  resolution: [848, 480]
gedit imu.yaml

参数使用之前imu标定得到的参数,示例如下:

#Accelerometers
accelerometer_noise_density: 2.0546933436785896e-02   #Noise density (continuous-time)
accelerometer_random_walk:   1.0213093603518382e-03   #Bias random walk

#Gyroscopes
gyroscope_noise_density:     1.9035698029406516e-03   #Noise density (continuous-time)
gyroscope_random_walk:       1.9530927686562762e-05   #Bias random walk

rostopic:                    /imu      #the IMU ROS topic
update_rate:                 200.0      #Hz (for discretization of the values above)

参考链接:https://blog.csdn.net/qq_38364548/article/details/124917067

roslaunch mavros px4.launch
roslaunch realsense2_camera rs_camera.launch

关闭IR结构光

rosrun topic_tools throttle messages /camera/infra1/image_rect_raw 20.0 /infra_left & rosrun topic_tools throttle messages /camera/infra2/image_rect_raw 20.0 /infra_right & rosrun topic_tools throttle messages /camera/imu 200.0 /imu
rostopic hz topic名可以查看实际频率。

rosbag record -O imu_stereo.bag /infra_left /infra_right /imu

source  /kalibr_workspace/devel/setup.bash
rosrun kalibr kalibr_calibrate_imu_cameras --target april_6x6_A4.yaml --bag  multicameras_calibration.bag --models pinhole-equi pinhole-equi pinhole-equi --topics /infra_left /infra_right /color --bag-from-to 10 100 --show-extraction --approx-sync 0.04 

在这里插入图片描述

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Intel RealSense D435i与IMU标定用于vins-fusion 的相关文章

随机推荐

  • D435i VINS-Fusion环境搭建

    参考网址 https span class token operator span span class token comment github com kuankuan yue VINS FUSION leanrning span 1
  • jetson nx 安装cuda 10.2

    看到的另外两个方案 https span class token operator span span class token comment blog csdn net FRD2009041510 article details 4204
  • LIO-SAM ouster

    1 ROS tested with Melodic sudo apt span class token operator span get install span class token operator span y ros span
  • 数据分析业务场景 | 用户画像

    一 概况 定义 是根据用户的一系列行为和意识过程建立起来的多维度标签 xff1b 是根据用户人口学特征 xff0c 网络浏览内容 xff0c 网络社交活动和消费行为等信息而抽象出的一个标签化的用户模型 xff1b 首要任务 xff1a 根据
  • D435i vins搜集资料

    在D435i上运行VINS Mono 前面都测试好之后就可以再D435i上运行VINS Mone了 xff0c 这里特地感谢下博客如何用Realsense D435i运行VINS Mono等VIO算法 获取IMU同步数据的作者Manii x
  • mavros常用控制消息

    数传 用于查看数传状态 xff1a span class token operator span mavros span class token operator span span class token function radio s
  • 启动T265

    室内T265定点飞行 先启动基本vio脚本 roslaunch p450 experiment p450 vio onboard launch 再启动控制脚本 roslaunch p450 experiment p450 vio contr
  • VINS标定---Ego-planner

    1 检查realsense 和飞控的连接 查看飞控串口 ls span class token operator span dev span class token operator span ttyA span class token o
  • ego-planner框架和参数

    drone id 对应飞机的编号 从0开始 map size xyz 地图场地大小 xff0c 给的目标点要在地图范围内 fx fy cx cy 相机内参 obstacles inflation 障碍物膨胀大小 是 飞机外廓尺寸的1 5倍
  • 执行 install_geographiclib_datasets.sh 错误

    https blog csdn net weixin 41865104 article details 119418901 在 usr share 新建GeographicLib文件夹 在 usr share GeographicLib 文
  • 通过mavros的桥接连接qgc

    fcu url指定的是飞控的连接方式 xff0c 设置飞控为正确的端口即可 gcs url指定的是QGC所在主机的IP xff0c 这个换为运行QGC主机的IP地址即可 如果不知道主机的IP地址可以用udp发布方式 gcs url span
  • ros在同一工作空间下调用其它功能包的头文件

    A功能包需要调用B功能包的头文件 在B功能包CMakeLists txt中修改 去掉catkin package中的include注释 xff08 让别人能识别到自己的头文件 xff09 A功能包在find package时能识别到B功能包
  • 千寻位置NTRIP网络基准站

    端口选择NTRIP连接方式 xff1b 点击 Connect 输入Enter URL Enter URL格式 xff1a http NTRIP账号 xff1a 密码 64 rtk ntrip qxwz com 通道号 RTCM32 GGB
  • 关于egoplanner fastplanner内PID的控制

    Kp0 Kp1 Kp2 Kv0 Kv1 Kv2
  • 如何描述数据分布的特征?

    数据分布的特征可以从集中趋势 xff0c 离中趋势 xff0c 偏态和峰态三个方面进行描述 一 集中趋势 xff08 位置 xff09 是一组平均指标 xff0c 它反映了总体的一般水平或分布 1 平均数 分为 xff1a 简单平均数 xf
  • 对于egoplanner的障碍物分析

    根源 根据障碍物检查并分段初始轨迹 bool BsplineOptimizer span class token operator span span class token function check collision and reb
  • t265 通过mavros传递定位信息px4

    https github com thien94 vision to mavros 通过话题 mavros vision pose pose 向PX4发送位置数据 t265两种安装方式 xff1a USB口朝右镜头向前和向下安装 如需其它方
  • T265 VS D435i

  • px4_sitl_defult error

    span class token operator span Firmware span class token operator span Tools span class token operator span sitl gazebo
  • Intel RealSense D435i与IMU标定用于vins-fusion

    1 标定imu工具 mkdir span class token operator span p imu catkin ws span class token operator span src cd imu catkin ws span