How to reset gazebo simulation in ROS2

Hello,
I am working on the rosject and I need to reset the world i i.e reset the models to their initial states n case robot behaves unexpectedly. However, after pressing ctrl + R, the robot does not move to the initial position and I have to restart the simulation again and again which takes a lot of time. Is there any command available to reset the gazebo world including the models quickly.

Kind regards,.

You can do that by calling the /gazebo/reset_world service

ros2 service call /gazebo/reset_world std_srvs/srv/Empty "{}"

It shows some error. tells to specify service type. Please check the screenshot below

I have corrected the command. Sorry for the miss.

1 Like

Hello, thanks for the above solution, also I am facing another issue saying python: command not found. I want to run python files directly as part of basic python rosject. How to make python programs run withoput this error. Kind regards,

Try python3 instead of python. If it does not work, please create another post for this.

1 Like

that works. Thank you …

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.