Step 5 - Creating plugin description file: calculator_plugins.xml

After creating the calculator loader code, next we have to describe the list of plugins inside this package in an XML file called the Plugin Description File. The plugin description file contains all the information about the plugins inside a package such as the name of the classes, types of classes and base class, and so on.

The plugin description is an important file for plugin based packages, because it helps the ROS system to automatically discover, load, and reason about the plugin. It also holds information such as the description of the plugin.

The following code shows the plugin description file of our package called calculator_plugins.xml, which is stored along with the CMakeLists.txt and package.xml files. You can get this file from the chapter_5_codes/pluginlib_calculator folder itself.

Here is the explanation of this file:

<library path="lib/libpluginlib_calculator"> 
    <class name="pluginlib_calculator/Add" type="calculator_plugins::Add" base_class_type="calculator_base::calc_functions"> 
   <description>This is a add plugin.</description> 
  </class> 

This code is for the Add plugin and it defines the library path of the plugin, the class name, the class type, the base class, and the description.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.12.150.203