Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I have ran into this same situation. To remove NaN points there is another way without looping through the points etc. See the example below, which should work and let me know if it doesn't make sense.

boost::shared_ptr<std::vector<int>> indices(new std::vector<int>); pcl::removeNaNFromPointCloud(*source_cloud, *indices); pcl::ExtractIndices<pcl::PointXYZ> extract; extract.setInputCloud(source_cloud); extract.setIndices(indices); extract.setNegative(true); extract.filter(*source_cloud);

I have ran into this same situation. To remove NaN points there is another way without looping through the points etc. See the example below, which should work and let me know if it doesn't make sense.

 boost::shared_ptr<std::vector<int>> indices(new std::vector<int>);
 pcl::removeNaNFromPointCloud(*source_cloud, *indices);
 pcl::ExtractIndices<pcl::PointXYZ> extract;
 extract.setInputCloud(source_cloud);
 extract.setIndices(indices);
 extract.setNegative(true);
 extract.filter(*source_cloud);