Gazebo | Ignition | Community
Ask Your Question

Gazebo AI Logic and Scripting

asked 2021-05-20 14:29:29 -0600

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.


I'm new to Gazebo and really want to use it. However I'm overwhelmed with learning this API and all the tools that go into it. I've been following the tutorials for the XML scripting which is great but I've hit a wall in learning Gazebo and I do not know what to look into next.

My goal is to use Gazebo to create a multi-agent system and test out different coordination methods. Gazebo seems great for that. But I do not know how to script the models in the simulation. So for terseness I'll ask what I really want to know and hopefully someone can help.

  • How do you script models? Is it a python or C++? Where can I learn the API for either?
  • How do I pull data from a Gazebo simulation and feed it to a agent / model for processing. How to do I/O Gazebo simulations?
  • Do I need to learn / use ROS with Gazebo or can I create my own agents? Cons and pros of this with Gazebo?
  • Is everything in Gazebo done with plugins? Is the limit to what you can do with a plugin like graphs, output, logfiles, high level run time sim control?

To me and correct me if I'm wrong, Gazebo allows for physicals based simulations of agents / modules / robots of which are scripted and do computations outside of the Gazebo simulation but can be scripted to "tick" in simulation spaces?

I'm really interested in Gazebo I just don't know where to find more information on model scripting and I'm getting hung up in the beginner tutorials when I need more advanced information.

I would really appreciate any advice, resources, recommendations, or suggestions.

Thank you for your time.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2021-05-27 02:40:23 -0600

m.bahno gravatar image

In my opinion, most common use case is Gazebo combined with ROS. Since they share common history in development, they are quite tightly connected and they work together well.

In general, Gazebo is used for defining the physics, models and some base functionality (via Gazebo plugins written in C++). Then, ROS is used for most of I/O, data processing, logic, agent planning/control, etc. In ROS you can use both C++ and Python, just pick what you prefer. I would discourage you from trying to use Gazebo plugins for create graphs or high level control. Plugins are meant to be used more for low-level, regular and quickly processed tasks (joint regulation, collision detection, sensors, ...). For example graphs can be really easily done by already existing tools like rqt_graph and others. ROS has its own logging mechanism and I could continue.

Try to check out some existing projects which use both ROS and Gazebo plugins to achieve the goal and get inspired by the structure.

This is probably not a complete answer, but I hope it will clear some things for you.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2021-05-20 14:29:29 -0600

Seen: 101 times

Last updated: May 27 '21