pcl 是一个命名空间,跟std类似,PointCloud是类模板,<pcl::PointXYZ>是模板类实例化的类型。
在使用pcl::PointCloud<pcl::PointXYZI>::Ptr时需要使用new进行初始化,如下:
pcl::PointCloud<pcl::PointXYZI>::Ptr cloudxyzi(new pcl::PointCloud<pcl::PointXYZI>);
在使用 pcl::PointCloud<pcl::PointXYZI> cloudxyzi时作为一个对象。
两者可以相互转换,如下:
//PointCloud::Ptr—>PointCloud
pcl::PointCloud<pcl::PointXYZ> cloud;
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_ptr(new pcl::PointCloud<pcl::PointXYZ>);
cloud=*cloud_ptr;
//PointCloud->PointCloud::Ptr
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_ptr(new pcl::PointCloud<pcl::Point