38 PCL_DEPRECATED_HEADER(1, 16,
"The CUDA VoxelGrid filter does not work. Use the CPU VoxelGrid filter instead.")
40 #include <pcl_cuda/filters/filter.h>
41 #include <pcl_cuda/filters/passthrough.h>
42 #include <thrust/count.h>
43 #include <thrust/remove.h>
44 #include <vector_types.h>
51 template <
typename CloudT>
57 using PointCloud =
typename PCLCUDABase<CloudT>::PointCloud;
74 std::cerr <<
"applyFilter" << std::endl;
97 output.resize (input_->points.size ());
99 Device<PointXYZRGB>::type::iterator nr_points = thrust::copy_if (input_->points.begin (), input_->points.end (), output.begin (),
isFiniteAOS ());
100 output.resize (nr_points - output.begin ());
135 output.resize (input_->size ());
137 Device<float>::type::iterator nr_points = thrust::copy_if (input_->points_x.begin (), input_->points_x.end (), output.points_x.begin (),
isFiniteSOA ());
138 nr_points = thrust::copy_if (input_->points_y.begin (), input_->points_y.end (), output.points_y.begin (),
isFiniteSOA ());
139 nr_points = thrust::copy_if (input_->points_z.begin (), input_->points_z.end (), output.points_z.begin (),
isFiniteSOA ());
140 output.resize (nr_points - output.points_z.begin ());
149 PointCloud::zip_iterator result = thrust::remove_if (output.zip_begin (), output.zip_end (),
isFiniteZIPSOA ());
150 PointCloud::iterator_tuple result_tuple = result.get_iterator_tuple ();
151 PointCloud::float_iterator xiter = thrust::get<0> (result_tuple),
152 yiter = thrust::get<1> (result_tuple),
153 ziter = thrust::get<2> (result_tuple);
155 unsigned badpoints =
distance (xiter, output.points_x.end ());
156 unsigned goodpoints =
distance (output.points_x.begin (), xiter);
158 output.resize (goodpoints);
shared_ptr< PointCloud< PointT > > Ptr
shared_ptr< const PointCloud< PointT > > ConstPtr
Removes points with x, y, or z equal to NaN.
typename PointCloud::ConstPtr PointCloudConstPtr
typename PointCloud::Ptr PointCloudPtr
typename PCLCUDABase< CloudT >::PointCloud PointCloud
std::string filter_name_
The filter name.
VoxelGrid()
Empty constructor.
void applyFilter(PointCloud &output)
Filter a Point Cloud.
void applyFilter(PointCloud &output)
Filter a Point Cloud.
VoxelGrid()
Empty constructor.
VoxelGrid assembles a local 3D grid over a given PointCloud, and downsamples + filters the data.
void applyFilter(PointCloud &output)
Filter a Point Cloud.
VoxelGrid()
Empty constructor.
float distance(const PointT &p1, const PointT &p2)
#define PCL_DEPRECATED_HEADER(Major, Minor, Message)
macro for compatibility across compilers and help remove old deprecated headers for the Major....
Check if a specific point is valid or not.
Check if a specific point is valid or not.
Check if a specific point is valid or not.