ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

I think you are looking for the Gazebo ROS plugin (Model Plugin to be exact):

  • https://classic.gazebosim.org/tutorials?tut=ros_gzplugins

Adding a ModelPlugin

In short, the ModelPlugin is inserted in the URDF inside the <robot> element. It is wrapped with the <gazebo> pill, to indicate information passed to Gazebo. For example:

<robot>
  ... robot description ...
  <gazebo>
    <plugin name="differential_drive_controller"

filename="libdiffdrive_plugin.so"> ... plugin parameters ... </plugin> </gazebo> ... robot description ... </robot>

Upon loading the robot model within Gazebo, the diffdrive_plugin code will be given a reference to the model itself, allowing it to manipulate it. Also, it will be give a reference to the SDF element of itself, in order to read the plugin parameters passed to it.

I think you are looking for the Gazebo ROS plugin (Model Plugin to be exact):

  • https://classic.gazebosim.org/tutorials?tut=ros_gzplugins

Adding a ModelPlugin

In short, the ModelPlugin is inserted in the URDF inside the <robot> element. It is wrapped with the <gazebo> pill, to indicate information passed to Gazebo. For example:

<robot>
  ... robot description ...
  <gazebo>
    <plugin name="differential_drive_controller"

filename="libdiffdrive_plugin.so"> ... plugin parameters ... </plugin> </gazebo> ... robot description ... </robot>

</robot>

Upon loading the robot model within Gazebo, the diffdrive_plugin code will be given a reference to the model itself, allowing it to manipulate it. Also, it will be give a reference to the SDF element of itself, in order to read the plugin parameters passed to it.