This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
cs:simulator:plugins [2022/04/15 02:34] Chris Nathman remove writing gazebo plugins |
— (current) | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Writing Gazebo Plugins ====== | ||
- | This section will cover how to write gazebo plugins and how to integrate them with ROS. There are a number of tutorials online as well as examples in the robosub simulator repo but it can all be a little hard to find. Thus I'll mostly just be gathering all the resources here and giving a few tips. | ||
- | For an overview of writing gazebo plugins see [[http://gazebosim.org/tutorials?tut=ros_plugins&cat=connect_ros|here]]. | ||
- | |||
- | To see how ROS integration works with gazebo plugins go [[http://gazebosim.org/tutorials?tut=guided_i6|here]]. | ||
- | |||
- | The best resource to see examples of gazebo plugins in action is our [[https://github.com/PalouseRobosub/robosub_simulator|robosub_simulator]] repo, especially these files: | ||
- | * [[https://github.com/PalouseRobosub/robosub_simulator/blob/master/src/thruster.cpp|Thruster Plugin]] | ||
- | * [[https://github.com/PalouseRobosub/robosub_simulator/tree/master/examples|Model and World Plugin Examples]] | ||
- | |||
- | A couple things to note when working with plugins: | ||
- | * Your GAZEBO_PLUGIN_PATH must contain the path where your plugins are compiled to. By default compiled libraries are put in your ros_workspace/devel/lib folder. This path (and others) are set up in the simulator repo's [[https://github.com/PalouseRobosub/robosub_simulator/blob/master/package.xml#L67|package.xml]]. | ||
- | * Gazebo does not automatically reload plugins when they are recompiled. Unfortunately this means you will have to restart gazebo every time you make a change. | ||
- | * The update loop of the plugin (setup [[https://github.com/PalouseRobosub/robosub_simulator/blob/master/src/thruster.cpp#L127| here]] and defined [[https://github.com/PalouseRobosub/robosub_simulator/blob/master/src/thruster.cpp#L178|here]]) is run every single frame (50+ times/second) so make sure it is optimized. |