How to organize models, plugins & simulations?
I am new to Gazebo. I want to create a model of my robot (with all plugins), several simulations and put them in a GitHub repo so my coworkers and users can run them.
In the ideal situation, I have models, plugins and simulations directories containing corresponding files. The files need to reference each other, so they use relative paths. However, it seems that relative paths are not supported by Gazebo. I have found out, I can use environment variables to set paths for each item (models, plugins...). However, this requires to export these variables which either:
user has to add manually (too complicated for newbies)
I have to provide a startup script (unintuitive for user "who just want to open Gazebo simulation" - especially when upon invoking Gazebo, it does not shows errors about missing files and silently fails).
What is the best workflow to organize models? Is there a preferred one?
Asked by yaqwsx on 2019-09-27 05:59:59 UTC
Answers
Among ROS users, it's common to create a package that holds your models, worlds and plugins. Then with the help of gazebo_ros_pkgs
, it's possible to launch Gazebo running those worlds and making model and plugin paths available automatically. Here's an example.
For pure Gazebo projects, I recommend a pattern such as this one. That is:
- Models under
/models
- Worlds under
/worlds
- Plugin source code under
/src
(and if you want to install headers, put them under/include/project_name
) - Use CMake to:
- build plugins and install their shared libs
- install models and worlds (and other resources as needed)
- generate a
setup.sh
file which can be sourced to correctly set all the necessary paths (i.e. your "startup script")
Asked by chapulina on 2019-10-15 03:04:53 UTC
Comments