我正在尝试从该站点编译程序。
( 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/