【发布时间】:2019-02-15 08:14:01
【问题描述】:
我有一个使用 pcl/gpu 命名空间的代码:
pcl::gpu::Octree::PointCloud clusterCloud;
clusterCloud.upload(cloud_filtered->points);
pcl::gpu::Octree::Ptr octree_device (new pcl::gpu::Octree);
octree_device->setCloud(clusterCloud);
octree_device->build();
/*tree->setCloud (clusterCloud);*/
// Create the cluster extractor object for the planar model and set all the parameters
std::vector<pcl::PointIndices> cluster_indices;
pcl::gpu::EuclideanClusterExtraction ec;
ec.setClusterTolerance (0.1);
ec.setMinClusterSize (2000);
ec.setMaxClusterSize (250000);
ec.setSearchMethod (octree_device);
ec.setHostCloud (cloud_filtered);
ec.extract (cluster_indices);
我已经安装了 CUDA 并包含了执行此操作所需的 pcl/gpu ".hpp"。它可以编译(我有一个带有 ROS 的 catkin 工作区),当我运行它时,它的运行速度非常慢。我用的是nvidia-smi,我的代码只运行在CPU中,不知道为什么以及如何解决。
此代码是此处 gpu/segmentation 示例的实现: pcl/seg.cpp
【问题讨论】:
-
对不起,我是初学者,所以我对主机端或设备端一无所知。您的意思是 std 不是 gpu 变量吗?无论如何,这个例子完全一样,所以我想它应该像那样工作。也许我的配置不好或其他什么,或者我可能忘记了我的 CMakeList 中的某些内容,但我没有找到问题所在。
标签: cmake gpu ros point-cloud-library