ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You can always check about the examples in the test code of PCL official library. Here is the code introduce how to use the filter: cropBox filter

And here is the code:

  // Test the PointCloud<PointT> method
 CropBox<PointXYZ> cropBoxFilter (true);
 cropBoxFilter.setInputCloud (input);
 Eigen::Vector4f min_pt (-1.0f, -1.0f, -1.0f, 1.0f);
 Eigen::Vector4f max_pt (1.0f, 1.0f, 1.0f, 1.0f);

 // Cropbox slighlty bigger then bounding box of points
 cropBoxFilter.setMin (min_pt);
 cropBoxFilter.setMax (max_pt);

 // Indices
 vector<int> indices;
 cropBoxFilter.filter (indices);

 // Cloud
 PointCloud<PointXYZ> cloud_out;
 cropBoxFilter.filter (cloud_out);