ROS消息机制

ROS 中集成好的message类型

ubuntu平台下,在终端输入rosmsg show 下面的消息名字,可以将相关信息打印出来。

geometry相关的

geometry_msgs/Point.msg

// This contains the position of a point in free space
// 点
float64 x
float64 y
float64 z

geometry_msgs/Vector3.msg

// This represents a vector in free space. 
// It is only meant to represent a direction. Therefore, it does not
// make sense to apply a translation to it (e.g., when applying a 
// generic rigid transformation to a Vector3, tf2 will only apply the
// rotation). If you want your data to be translatable too, use the
// geometry_msgs/Point message instead.
float64 x
float64 y
float64 z

geometry_msgs/Accel.msg

// This expresses acceleration in free space broken into its linear and angular parts.
// 加速度项,包括线性加速度和角加速度
Vector3 linear
Vector3 angular

geometry_msgs/Quaternion.msg

// This represents an orientation in free space in quaternion form.
// 四元数
float64 x
float64 y
float64 z
float64 w

geometry_msgs/Pose.msg

// A representation of pose in free space, composed of position and orientation. 
// 位姿
Point position
Quaternion orientation

geometry_msgs/Twist

// This expresses velocity in free space broken into its linear and angular parts.
// 速度的统称,线速度和角速度
Vector3  linear
Vector3  angular

std_msgs/Header.msg

// Standard metadata for higher-level stamped data types.
// This is generally used to communicate timestamped data 
// in a particular coordinate frame.
// 定义数据的参考时间和参考坐标,上述的一些消息都可以有增加时间戳的版本
uint32 seq #数据ID
time stamp #数据时间戳
string frame_id #数据的参考坐标系

geometry_msgs/PointStamped

// This represents a Point with reference coordinate frame and timestamp
Header header
Point point

geometry_msgs/Vector3Stamped

// This represents a Vector3 with reference coordinate frame and timestamp
Header header
Vector3 vector

geometry_msgs/AccelStamped

// An accel with reference coordinate frame and timestamp
Header header
Accel accel

geometry_msgs/QuaternionStamped

// This represents an orientation with reference coordinate frame and timestamp.
Header header
Quaternion quaternion

geometry_msgs/PoseStamped.msg

// A Pose with reference coordinate frame and timestamp
// 带时间戳的位姿
Header header
Pose pose

geometry_msgs/TwistStamped

// A twist with reference coordinate frame and timestamp
// 带时间戳的速度
Header header
Twist twist

geometry_msgs/PoseWithCovariance.msg

// This represents a pose in free space with uncertainty.
// 带不确定度的位姿,一个协方差矩阵
Pose pose
// Row-major representation of the 6x6 covariance matrix
// The orientation parameters use a fixed-axis representation.
// In order, the parameters are:
// (x, y, z, rotation about X axis, rotation about Y axis, rotation about Z axis)
float64[36] covariance

geometry_msgs/TwistWithCovariance.msg

// 消息定义了包含不确定性的速度量,协方差矩阵按行分别表示:
// 沿x方向速度的不确定性,沿y方向速度的不确定性,沿z方向速度的不确定性
// 绕x转动角速度的不确定性,绕y轴转动的角速度的不确定性,绕z轴转动的
// 角速度的不确定性
Twist twist
float64[36] covariance #分别表示[x; y; z; Rx; Ry; Rz]

sensor传感器相关的

sensor_msgs/Imu.msg

// This is a message to hold data from an IMU (Inertial Measurement Unit)
// 消息包含了从惯性原件中得到的数据
// Accelerations should be in m/s^2 (not in g's), and rotational velocity should be in rad/sec
// 加速度为m/^2,角速度为rad/s
// 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
// 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.
// 如果所有的测量协方差已知,则需要全部填充进来
// 如果只知道方差,则只填充协方差矩阵的对角数据即可,一般设备出厂的时候会有一个对应的标定结果
Header header
geometry_msgs/Quaternion orientation
float64[9] orientation_covariance
geometry_msgs/Vector3 angular_velocity
float64[9] angular_velocity_covariance
geometry_msgs/Vector3 linear_acceleration
float64[9] linear_acceleration_covariance

一个livox固态激光雷达IMU消息的例子:

header: 
  seq: 476902
  stamp: 
    secs: 1694233923
    nsecs: 777218342
  frame_id: "livox_frame"
orientation: 
  x: 0.0
  y: 0.0
  z: 0.0
  w: 0.0
orientation_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
angular_velocity: 
  x: -0.00626190332696
  y: 0.0618663430214
  z: -0.00704875588417
angular_velocity_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
linear_acceleration: 
  x: -0.619719028473
  y: 0.0707327947021
  z: 0.792525410652
linear_acceleration_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]

sensor_msgs/LaserScan.msg

Header header #时间戳为接收到第一束激光的时间
float32 angle_min #扫描开始时的角度(单位为rad)
float32 angle_max #扫描结束时的角度(单位为rad)
float32 angle_increment #两次测量之间的角度增量(单位为rad)
float32 time_increment #两次测量之间的时间增量(单位为s)
float32 scan_time #两次扫描之间的时间间隔(单位为s)
float32 range_min #距离最小值(m)
float32 range_max #距离最大值(m)
float32[] ranges #测距数据(m,如果数据不在最小数据和最大数据之间,则抛弃)
float32[] intensities #强度,具体单位由测量设备确定,如果仪器没有强度测量,则数组为空即可

sensor_msgs/PointCloud

// This message holds a collection of 3d points, plus optional additional information about each point.
// Time of sensor data acquisition, coordinate frame ID.
Header header
// Array of 3d points. Each Point32 should be interpreted as a 3d point in the frame given in the header.
geometry_msgs/Point32[] points
// Each channel should have the same number of elements as points array,
// and the data in each channel should correspond 1:1 with each point.
// Channel names in common practice are listed in ChannelFloat32.msg.
ChannelFloat32[] channels

sensor_msgs/NavSatFix

# Navigation Satellite fix for any Global Navigation Satellite System
# Specified using the WGS 84 reference ellipsoid
# header.stamp specifies the ROS time for this measurement (the
#        corresponding satellite time may be reported using the
#        sensor_msgs/TimeReference message).
# header.frame_id is the frame of reference reported by the satellite
#        receiver, usually the location of the antenna.  This is a
#        Euclidean frame relative to the vehicle, not a reference
#        ellipsoid.
Header header

# satellite fix status information
NavSatStatus status

# Latitude [degrees]. Positive is north of equator; negative is south.
float64 latitude

# Longitude [degrees]. Positive is east of prime meridian; negative is west.
float64 longitude

# Altitude [m]. Positive is above the WGS 84 ellipsoid
# (quiet NaN if no altitude is available).
float64 altitude

# Position covariance [m^2] defined relative to a tangential plane
# through the reported position. The components are East, North, and
# Up (ENU), in row-major order.
#
# Beware: this coordinate system exhibits singularities at the poles.

float64[9] position_covariance

# If the covariance of the fix is known, fill it in completely. If the
# GPS receiver provides the variance of each measurement, put them
# along the diagonal. If only Dilution of Precision is available,
# estimate an approximate covariance from that.

uint8 COVARIANCE_TYPE_UNKNOWN = 0
uint8 COVARIANCE_TYPE_APPROXIMATED = 1
uint8 COVARIANCE_TYPE_DIAGONAL_KNOWN = 2
uint8 COVARIANCE_TYPE_KNOWN = 3

uint8 position_covariance_type

自定义msg文件

// 定义超声传感器
Header header
uint16 front_left
uint16 front_center
uint16 front_right
uint16 rear_left
uint16 rear_center
uint16 rear_right

nav导航相关的

nav_msgs/Odometry.msg

// This represents an estimate of a position and velocity in free space.  
// The pose in this message should be specified in the coordinate frame given by header.frame_id.
// The twist in this message should be specified in the coordinate frame given by the child_frame_id
Header header
string child_frame_id
PoseWithCovariance pose
TwistWithCovariance twist

nav_msgs/OccupancyGrid

// This represents a 2-D grid map, in which each cell represents the probability of occupancy.
Header header 
// MetaData for the map
MapMetaData info
// The map data, in row-major order, starting with (0,0).  Occupancy
// probabilities are in the range [0,100].  Unknown is -1.
int8[] data
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值