1

Rosanswers logo

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.


Originally posted by Ugo on ROS Answers with karma: 1620 on 2011-05-31

Post score: 0

2 Answers2

0

Rosanswers logo

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

<?xml version="1.0"?>
<launch>
  <group ns="/pcl_filters">
    <!-- PCL Manager -->
    <node pkg="nodelet" type="nodelet" name="box_filter_pcl_manager" args="manager" output="screen"/>
&lt;!-- Run a passthrough filter to delimit in x direction --&gt;
&lt;node pkg=&quot;nodelet&quot; type=&quot;nodelet&quot; name=&quot;psx&quot; args=&quot;load pcl/PassThrough box_filter_pcl_manager&quot; output=&quot;screen&quot;&gt;
  &lt;remap from=&quot;~input&quot; to=&quot;/camera/depth/points&quot; /&gt;
  &lt;rosparam&gt;
    filter_field_name: x
    filter_limit_min: -.8
    filter_limit_max: 0.5
  &lt;/rosparam&gt;
&lt;/node&gt;

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

&lt;!-- Run a passthrough filter to delimit in z direction --&gt;
&lt;node pkg=&quot;nodelet&quot; type=&quot;nodelet&quot; name=&quot;psz&quot; args=&quot;load pcl/PassThrough box_filter_pcl_manager&quot; output=&quot;screen&quot;&gt;
  &lt;remap from=&quot;~input&quot; to=&quot;psy/output&quot; /&gt;
  &lt;rosparam&gt;
    filter_field_name: z
    filter_limit_min: 0.0
    filter_limit_max: 2.0
  &lt;/rosparam&gt;
&lt;/node&gt;

</group> </launch>


Originally posted by Ugo with karma: 1620 on 2011-05-31

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by Eric Perko on 2011-06-01:
I think you mean @dejanpan's solution :)

Comment by Ugo on 2011-05-31:
Ok, it didn't work with one filter, I just pasted Erik's solution here to have the answer directly accessible. Thanks.

Comment by Ugo on 2011-05-31:
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.

Comment by Eric Perko on 2011-05-31:
Don't the later rosparam blocks overwrite the earlier ones?

Lucas Walter
  • 3,337
  • 1
  • 14
  • 19
0

Rosanswers logo

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.


Originally posted by dejanpan with karma: 1420 on 2011-05-31

This answer was NOT ACCEPTED on the original site

Post score: 3


Original comments

Comment by dejanpan on 2011-05-31:
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.

Comment by Ugo on 2011-05-31:
Thanks for that. Do we really need the 3 passthrough filters? Isn't it a big overhead?

Comment by Eric Perko on 2011-05-31:
Hmm... for some reason that link doesn't seem to want to linkify...