Search code examples
c++rospoint-cloud-librarypoint-clouds

How to modify PCL voxel grid implementation?


I would like to turn a 3D point cloud into a simple 2D occupancy grid. In my current implementation I first apply the voxel grid to a point cloud and then I manually iterate through all points in the voxelized cloud to fill in my grid. Is there a way to make it so that while I am voxelizing the grid, I am generating my 2D occupancy grid?


Solution

  • You could probably create a new class, derive from pcl::VoxelGrid (see here), and implement your custom applyFilter which would shadow the one in the base class. This would allow you to use the same utility functions and code, and introduce your new behavior.