[setPointCloudRenderingProperties] Could not find any PointCloud datasets with id <XXX>!

错误:

一般创建的点云数据都命名为cloud,因为我这里有两组点云数据,要区分一下,所以把点云数据命名为cloud1和cloud2,下面是cloud2的显示代码

viewer2->setRepresentationToWireframeForAllActors();
viewer2->addPointCloud(cloud2);
viewer2->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 1, "cloud2");
viewer2->spinOnce(1);
viewer2->removeAllPointClouds();
viewer2->removeAllShapes();

运行后的出错

[setPointCloudRenderingProperties] Could not find any PointCloud datasets with id <cloud2>!

原因:

addPointCloud()默认的点云数据标签是id=“cloud”,上面代码添加了点云数据cloud2,但没有将默认的cloud标签改为id=“cloud2”,所以找不到cloud2的点云数据

addPointCloud (const pcl::PointCloud<pcl::PointXYZRGBA>::ConstPtr &cloud,

               const std::string &id = "cloud", int viewport = 0)

改正:

viewer2->setRepresentationToWireframeForAllActors();
viewer2->addPointCloud(cloud2,"cloud2");
viewer2->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 1, "cloud2");
viewer2->spinOnce(1);
viewer2->removeAllPointClouds();
viewer2->removeAllShapes();

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值