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

voxel_grid filter in all dimensions

asked 2017-04-27 14:08:18 -0600

dan gravatar image

I would like to filter point clouds in x, y, and z. I see from the tutorials and examples how to downsample with limits on a single axis. How can I downsample with limits on all three axes? Do I have to run three instances of voxel_grid, with one feeding into the other?

Here is an example launch file that limits in the z axis:

  <!-- Run a VoxelGrid filter to clean NaNs and downsample the data -->
  <node pkg="nodelet" type="nodelet" name="voxel_grid" args="load pcl/VoxelGrid pcl_manager" output="screen">
    <remap from="~input" to="/multisense/camera/points2" />
    <rosparam>
      filter_field_name: z
      filter_limit_min: 0.1
      filter_limit_max: 2.0
      filter_limit_negative: False
      leaf_size: 0.08
    </rosparam>
  </node>
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-05-17 08:36:02 -0600

paland3 gravatar image

I know it is probably late for you, but might be useful for someone else: we can create a launchfile with multiple voxelgrid nodelets like this:

<launch>
<node pkg="nodelet" type="nodelet" name="pcl_manager" args="manager" output="screen" />
<!-- Run a VoxelGrid filter to clean NaNs and downsample the data -->
  <node pkg="nodelet" type="nodelet" name="voxel_grid" args="load pcl/VoxelGrid pcl_manager" output="screen">
   <remap from="~input" to="/velodyne_points" />
    <rosparam>
      filter_field_name: y
      filter_limit_min: 0
      filter_limit_max: 17
      filter_limit_negative: False
      leaf_size: 0.05
    </rosparam>
   </node>
   <node pkg="nodelet" type="nodelet" name="voxel_grid2" args="load pcl/VoxelGrid pcl_manager" output="screen">
   <remap from="~input" to="/voxel_grid/output" />
   <remap from="~output" to="/Filtered_Lidar" />
    <rosparam>
      filter_field_name: x
      filter_limit_min: -7
      filter_limit_max: +7
      filter_limit_negative: False
    </rosparam>
  </node>
</launch>

Note that they have different names, and the output of the first is remapped to the input of the second. Hope it helps!

edit flag offensive delete link more

Question Tools

Stats

Asked: 2017-04-27 14:08:18 -0600

Seen: 1,058 times

Last updated: May 17 '18