【问题标题】:Facing error during compilation of Iterative closest point algorithm编译迭代最近点算法时面临错误
【发布时间】:2015-09-26 04:18:48
【问题描述】:

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

(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::IterativeClosestPoint 的那一行吗?
  • 我已经在受保护的修饰符中声明了它。受保护:IterativeClosestPoint icp; ;

标签: c++ boost point-cloud-library


【解决方案1】:

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

IterativeClosestPoint 类的 API:

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

【讨论】:

  • pcl::PointCloud<:pointxyzrgb>::Ptr finalcloud;但如果我执行 icp.align(finalcloud) 则会引发以下错误。
  • 没有重载函数实例“pcl::IterativeClosestPoint::align [with PointSource=pcl::PointXYZRGB, PointTarget=pcl::PointXYZRGB, Scalar=float]”匹配参数列表参数类型为:(boost::shared_ptr<:pointcloud>>) 对象类型为:pcl::IterativeClosestPoint<:pointxyzrgb pcl::pointxyzrgb float>
  • 在这种情况下,错误消息更清楚:align() 函数不采用 boost::shared_ptr<:pointcloud> 类型的参数 - 请参阅 API正确的参数类型:docs.pointclouds.org/1.7.1/…
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-07-16
  • 1970-01-01
  • 1970-01-01
  • 2013-03-13
  • 1970-01-01
相关资源
最近更新 更多