API Event Types Overview?

asked 2017-08-08 10:20:38 -0500

Phydeaux gravatar image

If I am writing a plugin and want a method to be called periodically, I can register it as a callback using (e.g.) event::Events::ConnectWorldUpdateBegin, as shown in this tutorial.

However, checking the API reference for more information about this function shows that there are many similar functions: ConnectWorldUpdateBegin, ConnectWorldUpdateEnd, ConnectStep, ConnectBeforePhysicsUpdate, etc., as well as others whose names are (I hope) self-explanatory, such as ConnectAddEntity. The function descriptions are all of the form "Connect a callback to the [name of function] signal."

I am left with several questions:

  • When is it appropriate to add a callback to the various event types?
  • In what order are they triggered?
  • What is the difference between (e.g.) a 'step' and a 'physics update'?

Is there some overview of the events that occur during a Gazebo iteration that I can read? More generally, is there any documentation of Gazebo other than the tutorials?

edit retag flag offensive close merge delete


Regarding the order of triggering, there is no documentation to my knowledge, but many events are triggered in World class (see source code, especially Update() method). If you read the code, it may answer your third question. As for your first question, I've seen many callbacks in plugins and also used them myself without problems. IMHO it is designed to be used with callbacks.

m.bahno gravatar imagem.bahno ( 2022-03-09 02:18:02 -0500 )edit