-
Notifications
You must be signed in to change notification settings - Fork 269
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
Allow executing a paused step in SimulationRunner #61
Conversation
@osrf-jenkins run tests |
It seems that the following assertions are failing: |
Friendly ping @azeey @chapulina |
Hi @diegoferigo , this looks like a change of behaviour to me. There could be users starting simulation paused on purpose and choosing when the iterations start being run. Would you be open to targeting this at |
The Similarly, as demonstrated in the failing test I agree that it would be nice to allow executing a paused step, but I think we need a new API for it. I'm not sure what that would like like yet. I need to think about it some more. |
My understanding of the failure is the change of behaviour about how simulator iterations are counted internally:
Awesome, thanks, I'll be waiting further information then! A use case that I found very interesting with single paused steps is to create a server object that starts paused and provides the possibility to get stepped deterministically: ignition::gazebo::ServerConfig config;
config.SetSdfFile("empty.sdf");
config.SetUpdateRate(1000);
ignition::gazebo::Server server(config);
server->Run(/*blocking=*/true, /*iterations=*/1, /*paused=*/true) After this operation, the caller has complete control of the simulation, and it is able to perform either other paused steps (e.g. to insert models and trigger the ECM to add their entities and components) or start running the simulation issuing unpaused commands. It fits gracefully with the idea of having a simulator-as-a-library, and it would simplify dramatically the creation of simulator bindings (gazebosim/gz-physics#3) similar to pybullet and mujoco-py, to name a few. I've been using this branch for a while now, and I'm very happy of the performance.
I can surely change the target branch. Considering also @azeey comments, it seems that new APIs are needed in any case. |
+1, this is an important use case that's currently underserved.
Depending on the APIs, they could be backwards compatible. My main concern is not breaking the current behaviour. If we can support your use case while still keeping the current behaviour by default, it would be great to do it in Citadel. |
In the meantime I updated the PR to target |
Signed-off-by: Diego Ferigo <[email protected]>
Is there any chance to get this merged within the Dome window? For other few weeks I won't have much time for major extensions, but I'd like at least to start the discussion of the actions to take waiting August. |
Hi Diego, sorry for the wait. I'm leaning towards adding new API for ECS iterations (as opposed to simulation iterations) in Dome. This would allow us to maintain the current behaviour, as well as support your use case. Is this something you'd be interested in helping with? Sorry for the back-and-forth, thanks for redirecting this PR to My proposal:
|
Hi @chapulina, no problem, that sounds a good plan to me. I can definitely help with this task 😉 I tried to recap the current status in #51 (comment), please let me know if you already have something more concrete in mind. Closing. |
This PR enables the execution of paused steps as described in #51.
While this is a very small change, I suspect that it's quite delicate. I'd like to start the discussion of what's needed to make it land upstream. Any recommendation about possible tests? I can initially start with something confined as in the linked issue.
Let me know if I have to change the target branch, I initially pointed
ign-gazebo3
.cc @chapulina @azeey
OT
I take advantage of this PR to congratulate with all the team for the massive migration! Having the project in GitHub is amazing and believe it will pay off in the long run, I'm sure the community involvement will increase.