import pcldefdo_voxel_grid_downssampling(pcl_data,leaf_size):''' Create a VoxelGrid filter object for a input point cloud :param pcl_data: point cloud data subscriber :param leaf_size: voxel(or leaf) size :return: Voxel grid downsampling on point cloud :https://github.com/fouliex/RoboticPerception ''' vox = pcl_data.make_voxel_grid_filter() vox.set_leaf_size(leaf_size, leaf_size, leaf_size)# The bigger the leaf size the less information retainedreturn vox.filter()cloud = pcl.load("./sample/lobby.pcd")print(cloud)LEAF_SIZE =0.01cloud =do_voxel_grid_downssampling(cloud,LEAF_SIZE)print(cloud)