[ros-users] Filters

Peshala Jayasekara peshala_24 at yahoo.com
Thu Apr 1 09:53:28 UTC 2010


Thank you very much for your reply.

I have already added a plugin description file.
Its contents are as follows:

  <library path="lib/libbackgroundsubtraction">
    <class name="LaserBackgroundSubtractionFilter" type="beginner_tutorials::LaserBackgroundSubtractionFilter"
        This is a background subtraction filter.

Also, I have edited the manifest file as follows:
  <depend package="filters"/>
  <depend package="sensor_msgs"/>
  <depend package="pluginlib"/>
  <export><filters plugin="${prefix}/plugin_description_file.xml"/>

PLUGINLIB_REGISTER_CLASS(LaserBackgroundSubtractionFilter, beginner_tutorials::LaserBackgroundSubtractionFilter, filters::FilterBase<sensor_msgs::LaserScan>)
in the .cpp file

I am confused with adding the node configuration parameters. 
Because I am running a launch file
<node pkg="laser_filters" type="scan_to_scan_filter_chain" output="screen" name="background_subtraction_filter">      
      <rosparam command="load" file="$(find beginner_tutorials)/launch/background_subtraction_filter.yaml" />

So when I run the launch file it says 
According to the loaded plugin descriptions the class
LaserBackgroundSubtractionFilter with base class type
filters::FilterBase<sensor_msgs::LaserScan> does not exist.

On the other hand, when I tried putting my .h and .cpp files inside laser_filters and using laser_filter namespace and editing its CMakeLists and laser_filters_plugins I could run the scan_to_scan_filter_chain node without problem; however I know this is not the recommended way.

Also, in http://www.ros.org/wiki/pluginlib
it says PLUGINLIB_DECLARE_CLASS which is not to be found in  <pluginlib/class_list_macros.h>

Need some advice how I can run scan_to_scan_filter_chain node using my libbackground_subtraction_filter.so outside the laser_filters package

Thanks in advance

From: Tully Foote <tfoote at willowgarage.com>
To: ros-users at code.ros.org
Sent: Thursday, April 1, 2010 4:49:23
Subject: Re: [ros-users] Filters


For question 1 you need to add a plugin description file.  See http://www.ros.org/wiki/pluginlib  linked from here http://www.ros.org/wiki/filters  You will both need to add this file and export it in the manifest.  

To run it inside the scan_to_scan_filter_chain node you just need to add your filter to the nodes configuration parameters.  See 3.2.2 in http://www.ros.org/wiki/filters#Steps_to_create_a_filter  There is specific documentation on scan_to_scan_filter_chain node at http://www.ros.org/wiki/laser_filters

For question 2, filters can be run in any node.  The filters::FilterChain class is the recommended way to instantiate filters in code.  However for your purposes the scan_to_scan_filter_chain node is likely the easiest.  


On Wed, Mar 31, 2010 at 12:05 AM, Peshala Jayasekara <peshala_24 at yahoo.com> wrote:

>Dear Ros-Users,
>I am thinking of writing a background subtraction filter for my incoming laser data through hokoyo_node.
>Here are my problems.
>1) After going through the examples of laser_filters, I thought I can use scan_to_scan_filter_chain node to run "background_subtraction_filter-which is the one I am writing, inside it. However, it gave an error msg saying 
>According to the loaded plugin descriptions the class LaserBackgroundSubtractionFilter with base class type filters::FilterBase<sensor_msgs::LaserScan> does not exist.
>Is there a way to run a user's filter inside  scan_to_scan_filter_chain node?
>2) On the other hand, once you write your own filter according to the "Implementing a simple filter" tutorial how do you run it - what node should it be associated with ?
>Thank you in advance
 Get your preferred Email name!  
>>Now you can @ymail.com and @rocketmail.com.
>>ros-users mailing list
>ros-users at code.ros.org

Tully Foote
Systems Engineer
Willow Garage, Inc.
tfoote at willowgarage.com
(650) 475-2827

      Get your preferred Email name!
Now you can @ymail.com and @rocketmail.com. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osuosl.org/pipermail/ros-users/attachments/20100401/4da571d9/attachment-0002.html>

More information about the ros-users mailing list