由于近期项目要求,我们使用了一款北科天绘的雷达,使用官方的驱动程序已经能够得到点云数据,但是我们需要使用pcl库中的一些算法以及加上自己对点云的一些描述性标签,所以打算把北科使用的ROS官方的标准点云变为我们所需要的格式的点云。
我们对点云结构截取了velodyne中关于点云的部分头文件中的内容如下:
#ifndef __VELODYNE_POINTCLOUD_POINT_TYPES_H
#define __VELODYNE_POINTCLOUD_POINT_TYPES_H
#include <pcl/point_types.h>
/** Euclidean Velodyne coordinate, including intensity and ring number. */
struct pointXYZIR
{
PCL_ADD_POINT4D; // quad-word XYZ
float intensity; //< laser intensity reading
uint16_t ring; //< laser ring number
EIGEN_MAKE_ALIGNED_OPERATOR_NEW // ensure proper alignment
} EIGEN_ALIGN16;
// namespace velodyne_pointcloud
POINT_CLOUD_REGISTER_POINT_STRUCT(pointXYZIR,
(float, x, x)
(float, y, y)
(float, z, z)