geometry_msgs
geometry_msgs主要是一些几何信息相关的数据结构,导入方式;
其中常有几个几个比较常用
Vector3
空间向量,需要用v.x、v.y、v.z来获取或修改其存储的信息
float64 x
float64 y
float64 z
Twist
六维速度(速度螺旋),由线速度和角速度组成,用两个vector3构成:
Vector3 linear # x, y, z
Vector3 angular # angular.x, angular.y, angular.z
Wrench
六维力(力螺旋),由力和力矩组成,用两个vector3构成
Vector3 force
Vector3 torque
Point
空间点信息,
float64 x
float64 y
float64 z
Quaternion
四元数, q = w + xi + yj + zk,表示旋转量
float64 x
float64 y
float64 z
float64 w
Pose
位姿,由位置和姿态组成,用来确定一个坐标系在另一个坐标系中的表示:
Point position #三维点
Quaternion orientation #四元素
Pose2D
平面位姿,由2维点和一个转角决定
float64 x
float64 y
float64 theta
_Stamped
时间戳,与时间有关的变量,例如TwistStamped
Header header #时间戳
Twist twist #速度螺旋
sensor_msgs
sensor_msgs主要包括一些传看器反馈信息的数据结构,可以通过下面方式导入某个具体数据类
在ROS中表示点云的数据结构有: sensor_msgs::PointCloud sensor_msgs::PointCloud2 pcl::PointCloud
比如: pcl::toROSMsg(*cloud,output);
实现的功能是将pcl里面的pcl::PointCloudpcl::PointXYZ cloud 转换成ros里面的sensor_msgs::PointCloud2 output 这个类型