ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Gazebo Tutorials for creating a plugin?

asked 2011-08-19 06:35:14 -0500

SAK gravatar image

updated 2011-09-07 02:55:12 -0500

I have created some sensors and i want to make plugins of these sensor like the one defined in gazebo_plugins page

Are there any guidelines or tutorials for creating Gazbeo plugins?

edit retag flag offensive close merge delete


I need to create the plugins from the files i have made. I didn't found any tutorials about making plugins for ros
SAK gravatar image SAK  ( 2011-08-20 01:25:18 -0500 )edit
We have not been advertising much about plugin creation due to the fact that we are re-working a lot of the internal structures in gazebo on kforge. What do you need the plugin to do?
hsu gravatar image hsu  ( 2011-08-24 18:14:01 -0500 )edit

@hsu I have a question here: and I need custom plugin to actuate joints. I have seen some; But, I am having a hard time understanding function calls. Thanks for time and consideration.

PrasadNR gravatar image PrasadNR  ( 2016-12-18 12:03:44 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2011-08-24 19:37:00 -0500

hsu gravatar image

updated 2012-01-18 06:55:15 -0500

For now, the best thing to do is to follow the template provided in gazebo_plugins or mimic any of the examples in gazebo_plugins. Also take a look at gazebo configuration page to see how to setup plugin paths in your own packages.

Please keep in mind, plugin API's will change soon in F-Turtle, and will require some significant migratory changes/rewrites.

Proceeding on with the current setup, if you take a look at the template presented, there are 4 relevant member functions,

  • constructor - this is called once when the plugin is instantiated in Model::Load(...)
  • InitChild() - this is called once during Model::Init()
  • UpdateChild() - this is called once per Model::Update() call
  • FiniChild() - this is called once when a Model / Body is deleted, or simulator is shutting down, before destruction happens
  • destructor

The new plugin API for gazebo 1.0.0 RC to be released with Fuerte is described on the new gazebo wiki. Conversion from old plugin to the new format requires rewrite work described here.

edit flag offensive delete link more


i have created IR and sonar sensors, using the above functions (following the GazeboRosLaser). now i want to release that files in the form of plugins ( there are a large number of files like sonar.gazebo.xacro, sonar.urdf.xacro, sonarsensor, changes done to gz.h and
SAK gravatar image SAK  ( 2011-08-25 02:50:27 -0500 )edit
Now i want to place all these in a package, so if someone wants , he/she can use it.
SAK gravatar image SAK  ( 2011-08-25 02:51:19 -0500 )edit
@sak hello sak,i would be interested in your sonarsensor plugin,Did you have success? how can i use your sonar plugin in gazebo? greets
hmmm gravatar image hmmm  ( 2012-01-08 00:16:41 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2011-08-19 06:35:14 -0500

Seen: 4,085 times

Last updated: Jan 18 '12