【问题标题】:PCL Point Cloud Library converting from abstract PointT to PointXYZ pcl::PointCloud<PointType>::ConstPtr to pcl::PointCloud<pcl::PointXYZ>PCL 点云库从抽象 PointT 转换为 PointXYZ pcl::PointCloud<PointType>::ConstPtr 到 pcl::PointCloud<pcl::PointXYZ>
【发布时间】:2016-01-13 20:52:21
【问题描述】:

我的名为 cloud_cb 的回调函数采用 pcl::PointCloud&lt;PointType&gt;::ConstPtr 类型的参数。

但我终生无法弄清楚如何将数据转换为pcl::PointCloud&lt;pcl::PointXYZ&gt;。

【问题讨论】:

    标签: point-cloud-library


    【解决方案1】:

    PointType 不是 PCL 点类型,它是一个模板参数,可以表示 pcl::PointXYZ 或任何其他 PCL 数据类型(如果您使用的是示例代码,请在某处查找 typedef)。

    pcl::PointCloud&lt;pcl::PointXYZ&gt;::ConstPtr 是一个指针,即Boost共享指针(见doc here)

    同时 pcl::PointCloud&lt;pcl::PointXYZ&gt; 是你的共享指针指向的指针

    因此,请确保您的 PointType 是 pcl::PointXYZ,如果是,您可以像使用常规指针一样使用 boost 指针。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-03-26
      • 1970-01-01
      • 2021-03-12
      • 2012-05-25
      • 2020-07-31
      • 2017-12-08
      • 2021-12-30
      相关资源
      最近更新 更多