Tutorials/1.0/plugins/converting old plugins

Gazebo 1.0 plugin API has changed, here's the new plugin API.
 * 1) Instructions on Converting Pre-1.0 Gazebo Plugins #

Below is a *ChangeList* of this API update if you have an old plugin and would like to convert it to the new plugin API.


 * 1) List of Items to Update ##

This guideline simply highlights a sample conversion process, please refer to the new plugin API for complete details.

Item | old plugin AP | new plugin API | Example -|---|-| Includes | `#include ` `#include ` `#include ` | `#include "gazebo.h"` | Example Class Inheritance | All plugins derives from `gazebo::Controller` | Sensor plugins derive from `gazebo::SensorPlugin` Model plugins derives from `gazebo::ModelPlugin` World plugins derive from `gazebo::WorldPlugin` System plugins derive from `gazebo::SystemPlugin` | Example Constructor | constructor is called with an `Entity* parent` pointer | No arguments for the constructor. Pointer to the parent object is provided during loading | Example Loading | `LoadChild(XMLConfigNode *node)` Plugin parameters are accessed through the `XMLConfigNode` pointer. | `Load(gazebo::SensorPtr _parent, sdf::ElementPtr _sdf)` Pointer to parent entity and to the plugin parameters. | Example Initialization | `InitChild` | `Init` | Example Unloading | `FiniChild` | N/A: Move your code into the destructor. | Example Parsing Parameters | `gazebo/Param.hh` | sdf/interface/Param.hh sdf/interface/SDF.hh | Example Plugin Registration Macros |`GZ_REGISTER_DYNAMIC_CONTROLLER( std::string plugin_name, [Class name] )` | `GZ_REGISTER_SENSOR_PLUGIN( [class name] )` `GZ_REGISTER_MODEL_PLUGIN( [class name] )` `GZ_REGISTER_WORLD_PLUGIN( [class name] )` `GZ_REGISTER_SYSTEM_PLUGIN( [class name] )` | Example


 * 1) Example ##

An example of plugin conversion.