Gazebo | Ignition | Community
Ask Your Question

Plugin order of execution

asked 2017-02-02 11:16:20 -0500

GlenH gravatar image

updated 2017-02-02 11:17:02 -0500

I'm trying to use Boost IPC mechanisms to communicate between an external application and some gazebo plugins. I'm not using the transport layer because speed is critical for my application, and IPC mechanisms give me about a 2x increase in simulation speed over using topics. We're going to be running many, many thousands of simulations inside a Monte Carlo method, and a 2x speed increase will potentially shave days off the running time.

Getting the IPC synchronization correct for this is tricky, of course, and I'm running into issues that have to do with the order in which the plugins are executed. My questions:

1) is there any way to specify an order of execution for multiple plugins?

2) Do the plugins execute in the same thread? If I (for instance) block on a mutex inside one plugin, will the entire simulation halt, or do the other plugins run?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-02-02 12:12:50 -0500

chapulina gravatar image

1) I believe plugins (of the same type) are loaded in the order they're specified in the SDF file, but I could be mistaken.

2) Functions such as Plugin::Load run directly in the physics thread, and therefore have the potential for blocking simulation, as stated in the documentation.

If you are connected to any events, such as the world update event for example, that will also be blocking.

I believe that the best way to not block some Gazebo thread is to spin your own thread from the plugin, or to use a standalone program instead of a plugin.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-02-02 11:16:20 -0500

Seen: 611 times

Last updated: Feb 02 '17