0
$\begingroup$

I'm using Gazebo with ROS 1. Every time I re-run my ROS code, I seem to have to quit the Gazebo client and start it up again. Starting up the Gazebo client application takes a long time and I am wondering if there is a way to keep the client GUI application alive and simply reload the simulation or connection to the server.

I'm running the Gazebo client gzclient on macOS while gzserver is on a Ubuntu VM (along with ROS). The connection between the two is fine.

Please let me know how this can be done!

Thank you!

$\endgroup$
3
  • $\begingroup$ Seems like the only way to fully shutdown Gazebo is to Ctrl-C on the command line. Refer gazebo#3892 $\endgroup$ Commented Jan 7, 2022 at 3:16
  • $\begingroup$ I understand that, but the process of starting up a new instance is very slow and I'm wondering if it is possible to just keep it open $\endgroup$
    – Microbob
    Commented Jan 7, 2022 at 23:31
  • $\begingroup$ why don't you ask at a forum that is dedicated to gazebo? $\endgroup$
    – jsotola
    Commented Jan 8, 2022 at 1:38

1 Answer 1

0
$\begingroup$

Gazebo had the ability to reset the world. You can do it from the GUI, or or programmatically.

It sounds like you are starting your ROS code at the same time as the simulation. There's nothing tying those lifetimes together except how you are choosing to launch them. You'll want to refactor your launch process to separately bring up the simulation then bring up your code under test. Then you can reset the world and relaunch you code without restarting the Gazebo instance.

Note that for manual testing unless you need a very specific starting condition most application can be setup to support being brought down and back up. In this case you may want to move more of your system into the persistent launch so that you minimize the amount of the system that you are iterating on and relaunching each time.

$\endgroup$
3
  • $\begingroup$ Thanks for your reply. The reset world button doesn't seem to achieve what I'm looking for, unfortunately. I start the gazebo server through a ROS launch file, then I connect my client to it separately. When I exit the ROS program (which also closes the server), my GUI stays open since it was opened separately, however it is now frozen since it has lost its connection with the server. The GUI however doesn't reset or reconnect to the server after I would relaunching my ROS program again. Any ideas on how I can resolve this? $\endgroup$
    – Microbob
    Commented Jan 9, 2022 at 17:29
  • $\begingroup$ Add i mentioned above, I believe that your best solution will be to keep the simulator running. You may have to adjust the launch files you are using. The Gazebo GUI is relatively thin and the startup effort is connecting and syncing to the gzserver. Thus you want to avoid that resync. You say the reset doesn't do what you want. But if you don't explain what you want or how it fails i can't help you much more. $\endgroup$
    – Tully
    Commented Jan 10, 2022 at 3:12
  • 1
    $\begingroup$ I'm probably not familiar enough with Gazebo to make a more informed post. I'll update once I can figure out how to keep the server going and just reload in my ROS code. Thanks for your help! $\endgroup$
    – Microbob
    Commented Jan 10, 2022 at 5:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.