-
Notifications
You must be signed in to change notification settings - Fork 2
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
Try to run two parallel simulations of a gz-sim-yarp-plugins-enabled robot #147
Comments
Potential refactoring of singletonsWhile thinking on how to implement this issue, I continue to stumble upon the fact that I don't like the singletons we have for every plugin. I try to explain the main points I have in mind:
This suspect of useless code duplication made me think to potential alternatives involving different levels of code refactoring:
@traversaro what do you think about it? Do you have any other solutions in mind? |
How does the robotinterface plugin work in this case? If you use the PolyDriver pointer instead of the gz::sim::Server pointer, you can't use it to filter the devices that belong to a given gz server. |
Yes you're right, I got confused, it is the address of the server (or any other unique property of it) that has to be used to filter the plugins. |
I'm trying to find a way to get the pointer to the actual I report here some questions I found related to launching parallel Gazebo (classic) simulations:
|
As an additional experiment I tried to launch from two terminals the same single pendulum world. The result, as shown in the recording, is that by default the two Gazebo GUIs that open are simulating the same world. If I pause one simulations also the other pauses, so they're completely linked. 2024-04-15_14-48-46.mp4 |
Probably we can use a pointer to another structure that is unique for every server, for example |
By the way, apparently there is a test that tries to run two parallel servers, see https://github.com/gazebosim/gz-sim/blob/gz-sim8/test/integration/multiple_servers.cc . |
Yep and that is also similar to the test I've implemented in https://github.com/robotology/gz-sim-yarp-plugins/blob/f0d224658bd884cd8836a9eda798092ba7eea778/tests/controlboard/ControlBoardOnMultipleGazeboInstances.cc This can be a sign that this could be accomplished. |
We can use the existing test infrastructure, and we should use a model without any nws as otherwise launching two different nws with the same ports will fail.
The text was updated successfully, but these errors were encountered: