Restart simulation with new arguments without restarting gazebo

asked 2022-06-13 09:57:19 -0500

CESE42 gravatar image


for testing I need to restart my simulation often. The problem I have at the moment is that when I want to run the simulation with new arguments (e.g. a new robot, a new task, ...), I have to restart the simulation completely (close gazebo, restart gazebo with new arguments). This is quite time consuming, so I'm looking for a way to restart the simulation directly without closing gazebo but with new arguments. The initial simulation is started via roslaunch (-> roslaunch simulation simulation.launch arg1:=... arg2:=... ... argn:=... gazebo:=true) I am looking for a way to update arg1 till argn and restart the simulation without closing gazebo.

I know there is 'rosservice call /gazebo/reset_world' or 'rosservice call /gazebo/reset_simulation' but with those commands the initialized simulation just restarts with the same arguments.

I would appreciate any help. Any solution be it over a terminal command or programmatically would help me a lot.

edit retag flag offensive close merge delete


Do you intend to keep the loaded .world file the same and only change the robots spawned in the sim? AFAIK changing the loaded world in a running simulation is not possible.

peci1 gravatar imagepeci1 ( 2022-07-05 16:48:36 -0500 )edit