c++ - 迭代最近点算法编译过程中遇到错误

标签 c++ boost point-cloud-library

我正在尝试从该站点编译程序。

( http://pointclouds.org/documentation/tutorials/iterative_closest_point.php )!

但是在编译过程中我遇到了以下错误。

'pcl::Registration<PointSource,PointTarget,Scalar>::setInputCloud' : cannot convert parameter 1 from 'boost::shared_ptr<T>' to 'const boost::shared_ptr<T> &' \sample\kinect2_grabber.h 424 1 Sample

出现错误的代码如下:-

icp.setInputCloud (cloud);
icp.setInputTarget (cloud);

我已经在函数 convertRGBDepthToPointXYZRGB 中声明了这个云像这样

pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud( new pcl::PointCloud<pcl::PointXYZRGB>() );

我不知道如何纠正上面的错误。请有人帮我解决上面的错误。

谢谢

最佳答案

您已经为两个模板参数在 pcl::PointXYZ 类型上模板化了 IterativeClosestPoint 对象,因此函数 setInputCloud setInputTarget,其参数类型由类模板确定,期望 pcl::PointXYZ 的对象作为它们的参数。但是,您正在尝试将 pcl::PointXYZRGB 传递给对象。相反,为源和目标在 pcl::PointXYZRGB 上模板化对象。

IterativeClosestPoint 类的 API:

http://docs.pointclouds.org/1.7.1/classpcl_1_1_iterative_closest_point.html

关于c++ - 迭代最近点算法编译过程中遇到错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31289553/

相关文章:

python - 在 Python/Ubuntu 18.04 LTS 上安装 PCL 库

c++ - 为 PCL c++ 代码创建的 boost.python 模块导入错误

c++ - 如果存在非捕获局部变量,为什么不能在 Lambda 中使用非限定成员变量?

c++ - 从十进制转换为最多n位的二进制数字

c++ - 为什么这个调用有歧义?

c++ - boost:asio:read_until 问题与 boost::bind

c++ - 嵌入式 C++ 项目 - 需要支持智能指针。可能的可移植性问题?

c++ - boost::geometry svg_mapper svg origin,我的图像被翻转了?

c++ - 使用键盘回调事件保存屏幕截图

python - 我的 Py_NoneStruct 符号(python、boost.python)在哪里?