Xsens ROS 节点 时间戳以及话题

1. 概述

阅读Xsens在ROS下MTi系列节点源代码,将有用的部分总结一下,主要是时间戳以及topic的处理。

2. 目录结构

上一节对MTI系列的驱动和节点进行了处理,MTI_ROS_Driver
节点目录结构如下

.
├── CMakeLists.txt
├── launch
│   ├── display.launch
│   └── xsens_mti_node.launch
├── lib
│   └── xspublic
│       ├── Makefile
│       ├── xscommon
│       │   ├── abstractadditionallogger.h
│       │   ├── 、、、、
│       ├── xscontroller
│       │   ├── broadcastdevice.cpp
│       │   └── 、、、、
│       └── xstypes
│           ├── datapacket_p.cpp
│           └── 、、、、
├── LICENSE.txt
├── package.xml
├── param
│   └── xsens_mti_node.yaml
├── README.txt
├── rviz
│   ├── display.rviz
│   └── example.rviz
├── src
│   ├── main.cpp
│   ├── messagepublishers
│   │   ├── accelerationpublisher.h
│   │   ├── angularvelocitypublisher.h
│   │   ├── freeaccelerationpublisher.h
│   │   ├── gnsspublisher.h
│   │   ├── imupublisher.h
│   │   ├── magneticfieldpublisher.h
│   │   ├── orientationincrementspublisher.h
│   │   ├── orientationpublisher.h
│   │   ├── packetcallback.h
│   │   ├── pressurepublisher.h
│   │   ├── temperaturepublisher.h
│   │   ├── timereferencepublisher.h
│   │   ├── transformpublisher.h
│   │   ├── twistpublisher.h
│   │   └── velocityincrementpublisher.h
│   ├── xdacallback.cpp
│   ├── xdacallback.h
│   ├── xdainterface.cpp
│   └── xdainterface.h
└── urdf
    ├── MTi_10.stl
    ├── MTi_10.urdf
    ├── MTi_1.stl
    ├── MTi_1.urdf
    ├── MTi_6xx.stl
    └── MTi_6xx.urdf

可以很清楚的看到launch文件所在的位置。

├── launch
│   ├── display.launch
│   └── xsens_mti_node.launch

3. 时间戳的处理

每一种传感器信息定义了一个结构体,具体的结构体信息可以查看每个文件。

│   ├── messagepublishers
│   │   ├── accelerationpublisher.h
│   │   ├── angularvelocitypublisher.h
│   │   ├── freeaccelerationpublisher.h
│   │   ├── gnsspublisher.h
│   │   ├── imupublisher.h
│   │   ├── magneticfieldpublisher.h
│   │   ├── orientationincrementspublisher.h
│   │   ├── orientationpublisher.h
│   │   ├── packetcallback.h
│   │   ├── pressurepublisher.h
│   │   ├── temperaturepublisher.h
│   │   ├── timereferencepublisher.h
│   │   ├── transformpublisher.h
│   │   ├── twistpublisher.h
│   │   └── velocityincrementpublisher.h

在构造函数中完成topic的初始化。
例如对IMU信息topic的处理如下,首先从参数服务器中获取发布消息队列大小,设置发布topic为imu/data,消息类型为sensor_msgs::Imu,这是标准的ROS消息类型,具体消息内容可以查看msg/Imu,进一步对方差进行了初始化。

    ImuPublisher(ros::NodeHandle &node)
    {
   
        int pub_queue_size = 5;
        ros::param::get("~publisher_queue_size", pub_queue_size);
        pub = node
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值