【发布时间】:2016-01-13 20:52:21
【问题描述】:
我的名为 cloud_cb 的回调函数采用 pcl::PointCloud<PointType>::ConstPtr 类型的参数。
但我终生无法弄清楚如何将数据转换为pcl::PointCloud<pcl::PointXYZ>。
【问题讨论】:
我的名为 cloud_cb 的回调函数采用 pcl::PointCloud<PointType>::ConstPtr 类型的参数。
但我终生无法弄清楚如何将数据转换为pcl::PointCloud<pcl::PointXYZ>。
【问题讨论】:
PointType 不是 PCL 点类型,它是一个模板参数,可以表示 pcl::PointXYZ 或任何其他 PCL 数据类型(如果您使用的是示例代码,请在某处查找 typedef)。
pcl::PointCloud<pcl::PointXYZ>::ConstPtr
是一个指针,即Boost共享指针(见doc here)
同时
pcl::PointCloud<pcl::PointXYZ>
是你的共享指针指向的指针
因此,请确保您的 PointType 是 pcl::PointXYZ,如果是,您可以像使用常规指针一样使用 boost 指针。
【讨论】: