[Feature] Pause simulation while dragging interactive markers and via service calls#32
Conversation
| @@ -97,12 +97,15 @@ World::~World() { | |||
| } | |||
|
|
|||
| void World::Update(Timekeeper &timekeeper) { | |||
There was a problem hiding this comment.
I think it might be cleaner here to create a SetPaused(bool) method on World and check World::paused_ rather than looking into InteractiveMarkerManager. I'm just wondering how we handle multiple things wishing to pause simulation (e.g. the pause/resume button idea, or some other system that wishes to pause sim).
The actual pause logic here should work fine.
I think this is it. There may be a more elegant integration if we add runtime simulation speed controls at some point in the future (since that would be related to pause/resume). Currently sim speed can only be configured on launch. |
|
I just finished a I think we should have an independent pause flag for the interactive markers though, otherwise the simulation will resume on a MOUSE_UP, which defeats the use case of pause simulation --> move model --> rotate model --> resume simulation. Besides the special case of the interactive marker dragging, I think a service interface resolves the issue of multiple other entities requesting pauses and resumes. However, it might be good and necessary to be able to explicitly set the pause state as opposed to simply toggling. Maybe three separate services: pause, resume, and toggle? |
|
I like the pause/resume/toggle idea. Maybe abstract IsPaused() to a method that can contain the paused_ (service_paused_ ?) + interactive markers check? That way it's clear what the intent is and we don't put pause specific logic in the update method. |
|
Agreed, and done. |
|
Looks good! I tried it with turtlebot_flatland's |
This PR makes the Update method of the World class skip the plugin, physics, and timekeeper update steps if an interactive marker is currently being dragged.
It seems to work without breaking anything, but I only tested it with the default world launched with server.launch.
Also, is there a more elegant way of pausing the simulation that I am unaware of?