gpt4 book ai didi

c++ - 初始化 PCL PointCloud::Ptr?

转载 作者:行者123 更新时间:2023-11-28 04:58:28 29 4
gpt4 key购买 nike

这很可能是一件简单的事情,但我被卡住了。我正在尝试在头文件中初始化点云库点云,以便我可以跨函数共享它。

我正在尝试:

//.h

typedef pcl::PointCloud<pcl::POINT_TYPE> PointCloud;

PointCloud::Ptr currCloud;

//.cpp

currCloud= new pcl::PointCloud<pcl::PointXYZI>;

但这给了我

no operator '=' matches these operands

如何初始化这个类型?

谢谢。

最佳答案

在 PCL 中,点类型必须在声明和定义之间匹配。

改变

typedef pcl::PointCloud<pcl::POINT_TYPE> PointCloud;

typedef pcl::PointCloud<pcl::PointXYZI> PointCloud;

在你的标题中。

关于c++ - 初始化 PCL PointCloud::Ptr?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46650052/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com