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

point cloud "box" filtering

asked 2011-05-31 01:33:25 -0600

Ugo gravatar image

I just wanted to know if a package doing a "box" filtering already exists. I'd just like to limit the field of view of the Kinect, by removing everything that's not in a given box. I googled a bit and couldn't find an already implemented solution.

If it doesn't exist, I guess I can create a node and use the passthrough filter, but I thought it would already be implemented.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2011-05-31 03:21:20 -0600

Ugo gravatar image

updated 2011-05-31 20:23:52 -0600

Ok, I finally found the answer: I just needed to start a passthrough nodelet with the correct parameters. Here is a working launch file.

<launch>

  <group ns="/pcl_filters">
    <!-- PCL Manager -->
    <node pkg="nodelet" type="nodelet" name="box_filter_pcl_manager" args="manager" output="screen"/>

    <!-- Run a passthrough filter to delimit in x direction -->
    <node pkg="nodelet" type="nodelet" name="psx" args="load pcl/PassThrough box_filter_pcl_manager" output="screen">
      <remap from="~input" to="/camera/depth/points" />
      <rosparam>
        filter_field_name: x
        filter_limit_min: -.8
        filter_limit_max: 0.5
      </rosparam>
    </node>

    <!-- Run a passthrough filter to delimit in y direction -->
    <node pkg="nodelet" type="nodelet" name="psy" args="load pcl/PassThrough box_filter_pcl_manager" output="screen">
      <remap from="~input" to="psx/output" />
      <rosparam>
        filter_field_name: y
        filter_limit_min: -1.
        filter_limit_max: .3
      </rosparam>
    </node>

    <!-- Run a passthrough filter to delimit in z direction -->
    <node pkg="nodelet" type="nodelet" name="psz" args="load pcl/PassThrough box_filter_pcl_manager" output="screen">
      <remap from="~input" to="psy/output" />
      <rosparam>
        filter_field_name: z
        filter_limit_min: 0.0
        filter_limit_max: 2.0
      </rosparam>
    </node>
  </group>
</launch>
edit flag offensive delete link more

Comments

Don't the later rosparam blocks overwrite the earlier ones?
Eric Perko gravatar image Eric Perko  ( 2011-05-31 04:14:35 -0600 )edit
Hm, to be honest I haven't really tested it, I just subscribed to the output point cloud and saw that I had a smaller point cloud. I'll have to check this.
Ugo gravatar image Ugo  ( 2011-05-31 04:20:39 -0600 )edit
Ok, it didn't work with one filter, I just pasted Erik's solution here to have the answer directly accessible. Thanks.
Ugo gravatar image Ugo  ( 2011-05-31 20:24:59 -0600 )edit
I think you mean @dejanpan's solution :)
Eric Perko gravatar image Eric Perko  ( 2011-06-01 05:18:30 -0600 )edit
3

answered 2011-05-31 04:50:54 -0600

dejanpan gravatar image

updated 2011-06-28 03:14:26 -0600

dornhege gravatar image

Ugo, this is launch file I was using a while ago:

http://code.cs.tum.edu/indefero/index.php/p/mapping/source/tree/master/pcl_cloud_tools/launch/box_filter.launch .

The filtered cloud comes on psz/output topic. D.

edit flag offensive delete link more

Comments

Hmm... for some reason that link doesn't seem to want to linkify...
Eric Perko gravatar image Eric Perko  ( 2011-05-31 05:04:59 -0600 )edit
Thanks for that. Do we really need the 3 passthrough filters? Isn't it a big overhead?
Ugo gravatar image Ugo  ( 2011-05-31 05:05:48 -0600 )edit
Hmm, I did not really measure CPU usage to be honest. But yeah if your example works better I am happy to adopt it. D.
dejanpan gravatar image dejanpan  ( 2011-05-31 05:08:09 -0600 )edit

Question Tools

Stats

Asked: 2011-05-31 01:33:25 -0600

Seen: 2,636 times

Last updated: May 31 '11