Home | Tutorials | Wiki | Issues
Ask Your Question
1

How to organize models, plugins & simulations?

asked 2019-09-27 05:59:59 -0600

yaqwsx gravatar image

updated 2019-10-15 02:50:47 -0600

chapulina gravatar image

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?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2019-10-15 03:04:53 -0600

chapulina gravatar image

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")
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2019-09-27 05:59:59 -0600

Seen: 139 times

Last updated: Oct 15