根据错误提示,可以看到addLine函数的参数列表与代码中传递的参数不匹配。addLine函数的参数应该为两个点的坐标,而代码中传递了两个点云的指针作为参数。

要解决这个问题,可以将代码中的addLine函数调用修改为正确的形式,如下所示:

pcl::PointXYZ pt1, pt2;
pt1.x = x0;
pt1.y = y0;
pt1.z = z0;
pt2.x = x0 + m;
pt2.y = y0 + n;
pt2.z = z0 + p;
viewer.addLine(pt1, pt2, "line");

这样,就可以正确地添加直线到点云可视化中了。

#include iostream#include pclioply_ioh#include pclpoint_typesh#include pclcommonpcah#include pclsegmentationsac_segmentationh#include pclvisualizationpcl_visualizerhint main	--------------------------

原文地址: https://www.cveoy.top/t/topic/ihB6 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录