Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In a multiple world simulation, entities are not unique simulation-wise #801

Closed
diegoferigo opened this issue May 3, 2021 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@diegoferigo
Copy link
Contributor

Description

Disclaimer: I'm aware that multiple world simulations are not yet fully supported #18. This issue tracks an undesired behavior that will show up with the current implementation. Mainly open as a reminder.

In a multi-world simulation, each world is independent from each other. Each world owns a ECM which numbers its entities independently from the other worlds.

The current logic to load plugins passes through the following event:

https://github.com/ignitionrobotics/ign-gazebo/blob/a41cf80049c07977079d0b215398dc4225b63038/include/ignition/gazebo/Events.hh#L59-L60

used, for instance, in SdfEntityCreator:

https://github.com/ignitionrobotics/ign-gazebo/blob/a41cf80049c07977079d0b215398dc4225b63038/src/SdfEntityCreator.cc#L286-L287

The event is connected to SimulationRunner::LoadPlugin.

What I suspect is that it will produce an undefined behavior when multiple SimulationRunner objects are part of a Server, like in the case of simulations with multiple worlds. At first sight, each simulation runner will try to load the same plugin for the same entity, even though it could either not exist or belong to a different type in other worlds.

Note: now that the bullet physics plugin is in a advanced development stage, multiple world simulations with different physics engine do not suffer of #18. I also think that simulating two worlds running DART without ODE as collision detector (#684) should work, however I haven't tried this configuration.

@diegoferigo diegoferigo added the bug Something isn't working label May 3, 2021
@diegoferigo
Copy link
Contributor Author

Mmh nevermind. Inspecting better the code, each SimulationRunner owns also a different EventManager:

https://github.com/ignitionrobotics/ign-gazebo/blob/4e40b36943ebdf02ed73874eb9b9630ec4771974/src/SimulationRunner.hh#L301-L303

This means that when the event is emitted, it will bind the target entity to the correct world. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant