如何用Realsense D435i运行VINS

您所在的位置:网站首页 d435i参数 如何用Realsense D435i运行VINS

如何用Realsense D435i运行VINS

2024-07-10 18:49| 来源: 网络整理| 查看: 265

前言

Intel Realsense D435i在D435的基础上硬件融合了IMU,然而目前网上关于这款摄像头的资料非常少,本文主要介绍自己拿着d435i历经曲折最后成功运行VINS-Mono的过程。。。

重要

最近官方更新了GitHub上的Realsense ROS Wrapper和librealsense,据反映在d435i的IMU数据获取上存在一些问题,如时间戳混乱、运行VINS的时候没有数据等。这些问题造成的现象包括但不限于: 1、roslaunch VINS后只能看到特征跟踪图像,没有world坐标系,终端也不报任何错误 2、终端一直提示imu message ins disorder! 由于其源码与本博客的差异较大,且在本博客的方法下这些问题并无法解决,我上传了自己当时版本的Realsense ROS Wrapper,供大家参考。(我的librealsense是2.17.1的,可能需要配套使用) https://download.csdn.net/download/qq_41839222/11122224

如果一直报imu message ins disorder!且roslaunch /camera/imu后并看不出明显的时间戳混乱的,可以把源码上这行注释掉再试试效果~

准备工作

1、Intel Realsense D435i、Ubuntu 16.04 2、已经安装好Realsense驱动,如果没有的话可以参考:https://blog.csdn.net/qq_41839222/article/details/86503113 3、已经安装好VINS-Mono并且在数据集上正常工作 https://github.com/HKUST-Aerial-Robotics/VINS-Mono

一开始很神奇地发现VINS-Mono上居然有realsense的配置文件,以为事情非常简单,但运行以后发现并没有工作(因为不存在imu_topic: "/camera/imu/data_raw"啊)。

存在问题

运行realsense2_camera时,如

roslaunch realsense2_camera rs_camera.launch

realsense d435i在ROS中发布的IMU数据分成了两个: “/camera/gyro/sample” 发布角速度 “/camera/accel/sample” 发布线加速度

同时这两个的时间戳也不太一样,在launch文件中的频率也不一样:

在这里插入图片描述 但是显然VINS-Mono是需要订阅一个同时具有角速度和线加速度信息的topic。

因此问题变成了如何让realsense2_camera发布这么一个topic。

解决方法:看源码

realsense2_camera\src\base_realsense_node.cpp就是写了如何发布所有topic,代码很长,一开始绕了不少弯路。

其中void BaseRealSenseNode::setupStreams():

if (gyro_profile != _enabled_profiles.end() && accel_profile != _enabled_profiles.end()) { ROS_INFO("starting imu..."); std::vector profiles; profiles.insert(profiles.begin(), gyro_profile->second.begin(), gyro_profile->second.end()); profiles.insert(profiles.begin(), accel_profile->second.begin(), accel_profile->second.end()); auto& sens = _sensors[GYRO]; sens.open(profiles); auto imu_callback_inner = [this](rs2::frame frame){ imu_callback(frame); }; auto imu_callback_sync_inner = [this](rs2::frame frame){ imu_callback_sync(frame, _imu_sync_method); }; if (_imu_sync_method > imu_sync_method::NONE) { std::string unite_method_str; int expected_fps(_fps[GYRO] + _fps[ACCEL]); unite_method_str = "COPY"; if (_imu_sync_method == imu_sync_method::LINEAR_INTERPOLATION) { unite_method_str = "LINEAR_INTERPOLATION"; expected_fps = 2 * std::min(_fps[GYRO], _fps[ACCEL]); } ROS_INFO_STREAM("Gyro and accelometer are enabled and combined to IMU message at "


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3