-
Notifications
You must be signed in to change notification settings - Fork 298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider warning users if there is already a Gazebo server running in the background #2806
Comments
Hi @arjo129, I have a potential code ready to fix this. But first, I would need to test if It works. How do I test it ? |
I recommend spinning up a second instance of gazebo sim in the background as a server only process.
Then spin up gz sim on a new terminal
|
Hi @arjo129 , I'm using ubuntu 24.04(on a different machine(not docker)), and previously I had gz harmonic installed. Is this the correct version, If I am not wrong it's the harmonic version right ? |
I recommend following the source install instructions here. Make sure to source the correct directory and don't have a gazebo classic installation. You can use docker on ubuntu as well, personally I use distrobox to create isolated docker containers so that my host system is not tainted. However its up to you to choose what you'd like to use. |
I am running into a issue where - I’ve figured out why this is happening. Both servers are running at the same time, and the client (gz sim -g) chooses the server that responds first. currently I have added a functionality to accept -g "file name" as an argument and only launch the give file name(previously it didn't use to consider 'file name' as an argument.) though while doing so, it is sometimes able to launch the passed gui and sometimes it doesn't because There’s no way to tell the client which server to connect to when there are multiple instances active, so it sometimes connects to the “shapes” world and sometimes to the “default” one. any ideas on how do I fix that ? |
I think there is an edge case that if the user launches multiple gz sim servers with the same world name, e.g. shapes.sdf, they would still run into the same issue though |
Indeed, I had observed that. I believe that determining how to receive the appropriate server name feedback from the service call would be crucial in resolving this issue. I am currently looking into this matter. At present, the code will only launch the gui of the file passed in as filename, provided that the server names are different. (Although it fails to launch at times because when the world name is requested by the line - https://github.com/GauravKumar9920/gz-sim/blob/f60df980d50534cf366f29b7372d6debad4b4a56/src/gui/Gui.cc#L475C13-L475C74 it sometimes returns the correct list of files and sometimes does not.) p.s - Please note that I have created a pull request to demonstrate the modifications I have made thus far. However, it is not currently in a stage where it can be merged. |
The diff you've submitted is really big for a relatively small change. Couple of things I'd suggest are to breakdown this problem into smaller chunks.
|
Thank you @arjo129 for clarifying, I was previously trying to fix the issues relating to gz-sim '-s' and '-g' commands, I will help with #2809 once done with this : ) Since the scope of this pr is just to warn the user of multiple running servers I will make the changes accordingly.. |
Desired behavior
When users close the Gazebo GUI, the server can sometimes continue running in the background. This, combined with the ability to launch multiple Gazebo simulations, leads to confusion when a new gz sim client instance is started. To improve usability, the Gazebo quick start screen should detect existing running servers and present them to the user before launching a new one. Additionally, enhancing the gz sim -g command to accept a world name argument would allow users to target specific running simulations.
Alternatives considered
Implementation suggestion
Additional context
See #2805
The text was updated successfully, but these errors were encountered: