Skip to content

Commit

Permalink
Fixed queryBBIncludes_subsample
Browse files Browse the repository at this point in the history
Extractor's input cloud was not set and sample_points cast to int could
reach zero (e.g. if sample_points=0.9)
  • Loading branch information
raulmola committed Sep 5, 2017
1 parent e67fad3 commit ee66ae6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions outofcore/include/pcl/outofcore/impl/octree_base_node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1622,7 +1622,7 @@ namespace pcl
if (num_pts > 0)
{
//always sample at least one point
sample_points = sample_points > 0 ? sample_points : 1;
sample_points = sample_points > 1 ? sample_points : 1;
}
else
{
Expand All @@ -1639,7 +1639,8 @@ namespace pcl
random_sampler.setSample (static_cast<unsigned int> (sample_points));

pcl::ExtractIndices<pcl::PCLPointCloud2> extractor;

extractor.setInputCloud(tmp_blob);

pcl::IndicesPtr downsampled_cloud_indices (new std::vector<int> ());
random_sampler.filter (*downsampled_cloud_indices);
extractor.setIndices (downsampled_cloud_indices);
Expand Down

0 comments on commit ee66ae6

Please sign in to comment.