How to build and structure a Gazebo plugin for ROS

asked 2015-05-02 10:01:22 -0500

Cerin gravatar image

How do you build a custom Gazebo model plugin for controlling joints from ROS Indigo?

This similar question has a useful answer, but it's a bit old now and its links to articles explaining the API change are long dead.

I'm finding a lot of unclear and contradictory information. The ROS Gazebo tutorials all say they're obsolete. This Gazebo ROS plugin tutorial at first sounds exactly like what I'm looking for, but it has the following problems:

  • It uses SDF and the <plugin> tag, when all other ROS documentation/tutorials/tools assume URDF/Xacro which has no <plugin> tag, so I have no idea how to reference the plugin from URDF. Some examples I've seen use the <gazebo_ros> tag while others use <gazebo>. Which should I use?
  • It doesn't explain how to incorporate the plugin into a project. Should a plugin be managed as a separate standalone piece of code or located in your project tree? If I have the packages myrobot_description and myrobot_gazebo, which package should it go in? It's unclear from looking at the gazebo_plugins source.
edit retag flag offensive close merge delete