Revision 29 as of 2009-08-18 00:36:52

Clear message

  Show EOL distros: 

common: actionlib | bfl | bond | bondcpp | bondpy | filters | nodelet | nodelet_topic_tools | pluginlib | smclib | tinyxml | xacro | yaml_cpp

Package Summary

The pluginlib package provides tools for writing and dynamically loading plugins using the ROS build infrastructure. To work, these tools require plugin providers to register their plugins in the manifest.xml of their package. Pluginlib includes parts of Poco from pocoproject.org

pluginlib

Package Summary

The pluginlib package provides tools for writing and dynamically loading plugins using the ROS build infrastructure. To work, these tools require plugin providers to register their plugins in the manifest.xml of their package. Pluginlib includes parts of Poco from pocoproject.org

Package Summary

The pluginlib package provides tools for writing and dynamically loading plugins using the ROS build infrastructure. To work, these tools require plugin providers to register their plugins in the package.xml of their package.

  • Maintainer: Esteve Fernandez <esteve AT osrfoundation DOT org>
  • Author: Eitan Marder-Eppstein, Tully Foote, Dirk Thomas, Mirza Shah
  • License: BSD, Boost Software License
  • Source: git https://github.com/ros/pluginlib.git (branch: groovy-devel)

Package Summary

The pluginlib package provides tools for writing and dynamically loading plugins using the ROS build infrastructure. To work, these tools require plugin providers to register their plugins in the package.xml of their package.

  • Maintainer status: maintained
  • Maintainer: Esteve Fernandez <esteve AT osrfoundation DOT org>
  • Author: Eitan Marder-Eppstein, Tully Foote, Dirk Thomas, Mirza Shah
  • License: BSD, Boost Software License
  • Source: git https://github.com/ros/pluginlib.git (branch: groovy-devel)
ros_base: actionlib | bond_core | class_loader | dynamic_reconfigure | nodelet_core | pluginlib | ros_core

Package Summary

The pluginlib package provides tools for writing and dynamically loading plugins using the ROS build infrastructure. To work, these tools require plugin providers to register their plugins in the package.xml of their package.

ros_base: actionlib | bond_core | class_loader | dynamic_reconfigure | nodelet_core | pluginlib | ros_core

Package Summary

The pluginlib package provides tools for writing and dynamically loading plugins using the ROS build infrastructure. To work, these tools require plugin providers to register their plugins in the package.xml of their package.

ros_base: actionlib | bond_core | class_loader | dynamic_reconfigure | nodelet_core | pluginlib | ros_core

Package Summary

The pluginlib package provides tools for writing and dynamically loading plugins using the ROS build infrastructure. To work, these tools require plugin providers to register their plugins in the package.xml of their package.

ros_base: actionlib | bond_core | class_loader | dynamic_reconfigure | nodelet_core | pluginlib | ros_core

Package Summary

The pluginlib package provides tools for writing and dynamically loading plugins using the ROS build infrastructure. To work, these tools require plugin providers to register their plugins in the package.xml of their package.

ros_core: class_loader | cmake_modules | common_msgs | gencpp | geneus | genlisp | genmsg | gennodejs | genpy | message_generation | message_runtime | pluginlib | ros | ros_comm | rosbag_migration_rule | rosconsole | rosconsole_bridge | roscpp_core | rosgraph_msgs | roslisp | rospack | std_msgs | std_srvs

Package Summary

The pluginlib package provides tools for writing and dynamically loading plugins using the ROS build infrastructure. To work, these tools require plugin providers to register their plugins in the package.xml of their package.

ros_core: class_loader | cmake_modules | common_msgs | gencpp | geneus | genlisp | genmsg | gennodejs | genpy | message_generation | message_runtime | pluginlib | ros | ros_comm | rosbag_migration_rule | rosconsole | rosconsole_bridge | roscpp_core | rosgraph_msgs | roslisp | rospack | std_msgs | std_srvs

Package Summary

The pluginlib package provides tools for writing and dynamically loading plugins using the ROS build infrastructure. To work, these tools require plugin providers to register their plugins in the package.xml of their package.

Package Summary

The pluginlib package provides tools for writing and dynamically loading plugins using the ROS build structure. To work, these tools require plugin providers to register their plugins in the manifest.xml of their package. To make this clear, let's consider a small example. First, suppose that a polygon_interface package exists containing a polygon base class. Let's also say that there are two different kinds of polygons supported in the system: a rectangle which lives in the rectangle_plugin package and a traingle that lives in the triangle_plugin package. The implementers of both the rectangle_plugin and triangle_plugin packages would include special export lines in their manifest.xml file telling the rosbuild system that they intend to provide plugins for the polygon class in the polygon_interface package. These export lines, in effect, register the plugins with the rosbuild system. This means that someone wishing to see all polygon plugins available in the system can run a simple rospack query which will return a list of available plugins, in this case, rectangle and traingle.

plugin_model.png

Providing a Plugin

Adding a Plugin to the Plugin List

In order to allow a plugin to be dynamically loaded, it must be added to a plugin list for the relevant plugin type. This list can be defined in any .cpp file that is compiled in the library containing a plugin. To help with this process, pluginlib defines three macros in the plugin_macros.h file to help with this process. For the example above, we might create a plugin_list.cpp file that looks as follows and compile it into the librectangle library:

Toggle line numbers
   1 #include <pluginlib/plugin_macros.h>
   2 #include <polygon_interface/polygon.h>
   3 #include <rectangle_package/rectangle.h>
   4 
   5 //register the rectangle as a polygon plugin
   6 BEGIN_PLUGIN_LIST(polygon_namespace::polygon)
   7 REGISTER_PLUGIN(rectangle_namespace::rectangle)
   8 END_PLUGIN_LIST

The Plugin Description File

The plugin description file is an xml file that serves to store all the important information about a plugin in a machine readable format. It contains information about the library the plugin is in, the name of the plugin, the type of the plugin, etc. If we consider the rectangle_plugin package discussed above, the plugin description file, we'll call it rectangle_plugin.xml, would look something like this:

Toggle line numbers
   1 <library path="lib/librectangle">
   2   <plugin name="rectangle" class="rectangle_namespace::rectangle" type="polygon_namespace::polygon">
   3   <description>
   4   This is a rectangle plugin
   5   </description>
   6   </plugin>
   7 </library>

For a detailed description of plugin description files and their associated tags/attributes please see the following documentation.

Exporting a Plugin

In order to allow plugin users to access information, a plugin provider must point to its plugin descritption file in its manifest.xml inside the export tag block. Considering the rectangle_plugin package again, the relevant lines would look as follows:

Toggle line numbers
   1 <export>
   2   <polygon_interface polygon="${prefix}/rectangle_plugin.xml" />
   3 </export>

For a detailed discussion of exporting a plugin, please see the following documentation.

Important Note: In order for the above export command to work properly, the providing package must depend directly on the package containing the plugin interface. For example, the rectangle_plugin must have the line below in its manifest.xml:

  <depend package="polygon_interface" />

Using a Plugin

pluginlib provides a PluginLoader tool available in the plugin_loader.h header that makes it quick and easy to use provided plugins. For detailed documentation of the code-level API for this tool please see pluginlib::PluginLoader documentation. Below, we'll show a simple example of using the PluginLoader to create an instance of a rectangle in some code that uses a polygon:

Toggle line numbers
   1 #include <pluginlib/plugin_loader.h>
   2 #include <polygon_interface/polygon.h>
   3 
   4 //... some code ...
   5 
   6 pluginlib::PluginLoader poly_loader("polygon_interface", "polygon");
   7 polygon_namespace::polygon* poly = poly_loader.createPluginInstance("rectangle");
   8 
   9 //... use the polygon
  10 

Tutorials

Links to relevant tutorials


Troubleshooting

Review Process