Hello there!
Im trying to disconnect from ROS and then reconnect. I
m using de Disconnect() function, but when I create a new RosConnection instance, the HUD shows two connections and log the following message:
ROSConnection.GetOrCreateInstance().Disconnect();
What else do I have to do to disconnect from ROS properly?
You shouldn’t create a new RosConnection instance, just call Connect (or press the Connect button in the hud) when you want to connect again.
But I`m unloading the scene that contains the RosConnection instace, so it should be destroyed right?
Also when I call the GetOrCreateInstance method, if a RosConnection instance exists, it should be return and not create a new one, shouldn`t it?
Hmm. Ideally yes, that should work, but if it’s causing problems I suggest you set DontDestroyOnLoad on your RosConnection and just keep the same connection from scene to scene.
1 Like
Ok, gonna try this. Thank you!