ros学习(七):sensor_msgs 消息类型

一、sensor_msgs/Imu

sensor_msgs/Imu Documentationhttp://docs.ros.org/en/api/sensor_msgs/html/msg/Imu.html

        c++使用时头文件为:

#include <sensor_msgs/Imu.h>
# This is a message to hold data from an IMU (Inertial Measurement Unit)
#这是一条保存来自IMU(惯性测量单元)的数据的消息

# Accelerations should be in m/s^2 (not in g's), and rotational velocity should be in rad/sec
#加速度应以m/s^2为单位(而不是以g为单位),转速应以rad/sec为单位

# If the covariance of the measurement is known, it should be filled in (if all you know is the  variance of each measurement, e.g. from the datasheet, just put those along the diagonal)
#如果测量值的协方差已知,则应填写(如果您只知道每个测量值的方差,例如,从数据表中,只需沿对角线放置)

# A covariance matrix of all zeros will be interpreted as "covariance unknown", and to use the data a covariance will have to be assumed or gotten from some other source
#所有零的协方差矩阵将被解释为“协方差未知”,为了使用数据,必须假设协方差或从其他来源获得协方差

# If you have no estimate for one of the data elements (e.g. your IMU doesn't produce an orientation  estimate), please set element 0 of the associated covariance matrix to -1
#如果您对其中一个数据元素没有估计值(例如,您的IMU没有生成方向估计值),请将相关协方差矩阵的元素0(首位,标志位)设置为-1
# If you are interpreting this message, please check for a value of -1 in the first element of each covariance matrix, and disregard the associated estimate.
#如果要解释此消息,请在每个协方差矩阵的第一个元素中检查值-1,并忽略相关估计。

Header header

geometry_msgs/Quaternion orientation #姿态、方向
float64[9] orientation_covariance # Row major about x, y, z axes

geometry_msgs/Vector3 angular_velocity  #角速度
float64[9] angular_velocity_covariance # Row major about x, y, z axes

geometry_msgs/Vector3 linear_acceleration #线加速度
float64[9] linear_acceleration_covariance # Row major x, y z 
meng@meng:/media/meng/5418189112144B70/kitti/residential$ rosmsg info sensor_msgs/Imu
std_msgs/Header header
  uint32 seq
  time stamp
  string frame_id
geometry_msgs/Quaternion orientation
  float64 x
  float64 y
  float64 z
  float64 w
float64[9] orientation_covariance
geometry_msgs/Vector3 angular_velocity
  float64 x
  float64 y
  float64 z
float64[9] angular_velocity_covariance
geometry_msgs/Vector3 linear_acceleration
  float64 x
  float64 y
  float64 z
float64[9] linear_acceleration_covariance

@meng

这些头文件是C++编程中常用的库文件,主要作用如下: - #include <iostream>:用于输入输出流的操作,如输出到控制台等。 - #include "ros/ros.h":ROS机器人操作系统的头文件,用于机器人程序的编写。 - #include "std_msgs/String.h":ROS中的标准消息类型,用于传递字符串类型的消息。 - #include "std_msgs/Float32.h":ROS中的标准消息类型,用于传递浮点型数据。 - #include <sstream>:用于字符串流的操作,如将数字转换为字符串等。 - #include "math.h":数学库文件,提供了许多常用的数学函数。 - #include "can_drive/ICANCmd.h":自定义消息类型,用于控制CAN总线通信。 - #include "can_drive/Nav_data_msg.h":自定义消息类型,用于传递导航数据。 - #include "can_drive/encoder_vel_msg.h":自定义消息类型,用于传递编码器速度数据。 - #include "can_drive/radar_obs_msg.h":自定义消息类型,用于传递雷达障碍物数据。 - #include "can_drive/camera_obs_msg.h":自定义消息类型,用于传递摄像头障碍物数据。 - #include "sensor_msgs/Imu.h":ROS中的标准消息类型,用于传递IMU数据。 - #include "can_drive/pwm_cmd_msg.h":自定义消息类型,用于控制PWM信号输出。 - #include "can_drive/sensor_states_msg.h":自定义消息类型,用于传递各种传感器状态数据。 - #include <tf/tf.h>:ROS中的变换库文件,用于实现坐标系变换。 - #include <bitset>:二进制库文件,提供了位运算的一些常用函数。 - #include <string>:字符串库文件,提供了许多字符串操作的函数。 - #include <algorithm>:STL算法库文件,提供了许多常用的算法函数。 - #include <thread>:C++11中的多线程库文件,用于实现多线程编程。 - #include <pthread.h>:POSIX线程库文件,用于实现多线程编程。 - #include <time.h>:时间库文件,提供了许多时间相关的函数。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值