点云数据格式
sensor_msgs/PointCloud2
传感器中用的,像订阅激光点云或者相机点云topic返回的格式
header: // 点云的头信息
seq: 963 // 次数
stamp: // 时间戳
secs: 1541143772
nsecs: 912011000
frame_id: "/camera_init"
height: 1 // If the cloud is unordered, height is 1
width: 852578 // 点云的长度
fields: // sensor_msgs/PointField[] fields
-
name: "x"
offset: 0
datatype: 7 // uint8 INT8 = 1
// uint8 UINT8 = 2
// uint8 INT16 = 3
// uint8 UINT16 = 4
// uint8 INT32 = 5
// uint8 UINT32 = 6
// uint8 FLOAT32 = 7
// uint8 FLOAT64 = 8
count: 1
-
name: "y"
offset: 4
datatype: 7
count: 1
-
name: "z"
offset: 8
datatype: 7
count: 1
-
name: "intensity"
offset: 16
datatype: 7
count: 1
is_bigendian: False
point_step: 32 // Length of a point in bytes
row_step: 27282496 // Length of a row in bytes
data: [ ................... ] // Actual point data, size is (row_step*height)
is_dense: True // 没有非法数据点
pcl::PointT
一般处理点云就要将PointCloud2转为PCL格式,再进行操作
PointT是一类格式,包括PointXYZ、PointXYZI、PointXYZRGBA、PointXYZRGB、PointXY等
看PointXYZI就好了,参考文档
union
{
float data[4];
struct
{
float x;
float y;
float z;
};
};
union
{
struct
{
float intensity;
};
float data_c[4];
};