gazebosim/ros_gz

Auto-play argument

mjforan opened this issue · 2 comments

Desired behavior

In the ROS 1 version of this package (ros_ign), the simulator would "play" as soon as it started running. In the current ROS 2 version I have to hit the play button every time. I can understand how some people would prefer this new behavior, but it is a pain for me. Could this be exposed as a launch argument? I would like to be able to choose if the simulator should start up right away or wait for user input.

The command line parameter exists for gz-sim, but it hasn't been exposed as part of the launch file. It should be relatively straightforward to add here:

return [ExecuteProcess(
cmd=[exec, exec_args, '--force-version', gz_version],
output='screen',
additional_env=env,
shell=True,
prefix=debug_prefix,
on_exit=on_exit
)]

The -r CLI flag will cause the simulation to start as soon as gazebo is loaded.

Thanks for the tip, adding -r to gz_args works.