0
$\begingroup$

Why are plugins generally compiled as shared libraries & not as static libraries in Gazebo (at least in gazebo-classic that I know of)? (I'm inclined to think static libraries would make the execution a little bit faster. Is this correct?)

What design aspects were considered while making this decision?

Thanks!

$\endgroup$

1 Answer 1

1
$\begingroup$

The way it is, there is one gazebo executable and every plugin (being an official plugin installed e.g. from a binary package, or a custom plugin that you compiled yourself) can be loaded at runtime.

Afaik this is not possible with static libraries, i.e. you'd have to link that library into the executable on each change or addition of a plugin.

Wrt. speed of execution: I'm not so familiar with Gazebo Classic, but for sure for Gazebo Sim (i.e. 'new Gazebo') several design choices have been made to make it very flexible, e.g. wrt.:

  • Supporting choice of rendering engine,
  • Supporting choice of physics engine,
  • Decoupling between simulation server and gui,
  • Etc.

It is clear that this to a certain extent implies a trade-off between performance and flexibility. I.e. if it had been chosen instead to support only one rendering enging, one physics engine, no decoupling between server and gui, this would have resulted in a more computationally efficient implementation. But this would have come at the expense of loss of functionality.

In any case, wrt. your question: I think the benefit of shared libraries outweighs the possible performance loss, which I think is minimal, especially if you compare it to the impact of other design choices of Gazebo.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.