Add start_paused option to GzServer#872
Open
Cnoobmaster69 wants to merge 3 commits into
Open
Conversation
Signed-off-by: CarlosCortes <carlos.eduardo.cortes.cecc@gmail.com>
Signed-off-by: Carlos Cortes <110703826+Cnoobmaster69@users.noreply.github.com>
Signed-off-by: Carlos Cortes <110703826+Cnoobmaster69@users.noreply.github.com>
ahcorde
requested changes
Mar 30, 2026
ahcorde
left a comment
Collaborator
There was a problem hiding this comment.
can you add a test ?
do you mind target rolling ? then we can backport this feature to older distros
Author
Thanks @ahcorde. I’ll retarget this to rolling and add a basic test in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new
start_pausedoption toGzServerso simulations can start in a paused state.This wires the option through the launch and action layers so it can be used from both Python and XML launch flows, and passed down to
gzserverexecution viaServer::Run(..., paused).Closes #800
Changes
start_pausedoption in GzServerros_gz_sim/src/gzserver.cpp.paused=falsebehavior with the new start_paused parameter.Exposed and propagated
start_pausedthrough:ros_gz_sim/launch/gz_server.launch.pyros_gz_sim/launch/gz_server.launchros_gz_sim/launch/ros_gz_sim.launch.pyros_gz_sim/launch/ros_gz_sim.launchros_gz_sim/ros_gz_sim/actions/gzserver.pyIn
ros_gz_sim/src/gz_simulation_interfaces/gazebo_proxy.cpp:SerializedStepMap::statsThis keeps pause behavior consistent during startup/synchronization flows.
Motivation
Currently,
GzServerdoes not expose a straightforward way to start the simulation in a paused state, even though this can be useful for workflows such as:This PR adds that missing option while keeping the existing default behavior unchanged unless
start_pausedis explicitly enabled.Manual validation
Tested on the
jazzybranch.Validated the following flow manually:
launch
gz_serverwithstart_paused:=trueverify the simulation starts paused through:
/stats/gzserver/get_simulation_stateunpause through
/world/<world>/controlverify that simulation resumes and behaves normally afterward (included additional entities)
I also verified that the default behavior remains unchanged when
start_pausedis not set.Notes
I have not added automated tests yet.
I’d appreciate guidance on the preferred integration / launch test location in ros_gz_sim for this behavior.