PCL 点云基础

发布时间 2023-09-05 21:12:42作者: 量子与太极

PCL 点云基础:

 

一、概念
1、点云的结构公共字段
        PCL包含一个重要的数据结构,被设计成一个模板类,把点的类型当做模板类的参数。
        header:pcl::PCLHeader 记录了点云的获取时间
        points:std::vector<PointT,...>储存所有点的容器
        width:指定点云组织成图像时的宽度
        height:指定点云组成图像时的高度
        is_dense: 指定点云中是否有无效值
        sensor_origin_:是Eigen::Vector4f类型,传感器相对于原点平移所得的位姿
        sensor_orientation_:是Eigen::Quaternionf类型,定义传感器旋转所得的位姿
2、点云的类型
       PointT是pcl::PointCloud类的模板参数,定义点云的类型

 

       pcl::PointXYZ 位置 
       pcl::PointXYZI 位置+亮度 

       pcl::PointXYZRGBA 位置+颜色+透明度
       pcl::PointXYZRGB 位置+颜色
       pcl::Normal 表示曲面上给定点处的法线以及测量的曲率
       pcl::PointNormal 曲率信息+位置

3、ROS的PCL接口,定义不同的消息类型去处理点云的数据

 

      std_msgs::Header 不是真的消息类型,它包含发送的时间、序列号等

 

      sensor_msgs::PointCloud2 用来转换pcl::PointCloud类型

 

      pcl_msgs::PointIndices 储存点云的索引

 

      pcl_msgs::PolygonMesh 保存了描绘网格、定点和多边形

 

      pcl_msgs::Vertices 将一组定点的索引保存在数组中

 

      pcl_msgs::ModelCoefficients 储存一个模型的不同系数,如描述一个平面需要四个参数

 

用函数转换消息

 

     void fromPCL(const <PCL Type> &,<ROS Message type> &)

 

     void fromPCL(const pcl::PointCloud<T> &, sensor_msgs::PointCloud2 &)

 

原文链接:https://blog.csdn.net/HUASHUDEYANJING/article/details/123367811