Change ROS_IP Address to build

Hello,

I am trying to build a project with a different ROS_IP Address than 127.0.0.1 because my ROS node is running on another computer.
It works when I press Play but I can't find where to change that in the Build Settings (if that's even where I am supposed to change it).

Thank you !
Kam0ss

Hi, this setting is in the Robotics/Ros Settings menu.
Alternatively you can place a ROSConnection component in your scene and change the setting there.

Hi,

I have modified the setting in the Robotics/ROS Settings menu but the parameter doesn't seem to stick.
And I get this error while changing the Address :
7585360--940348--upload_2021-10-19_13-57-37.png

And I just noticed this comment in the code in the file mentionned in the error :
7585360--940354--upload_2021-10-19_13-59-5.png
So I guess, I'll have to wait for a future update ? Or is there a way I can do it myself ?

[EDIT]

I added the ROSConnection script in my ROSConnection component, I didn't realize I could do it this way before, thanks !

I seem to have two ROS connections :
7585360--940375--upload_2021-10-19_14-26-28.png

I will test it later as I don't have the second computer with ROS and will let you know if everything works !

Thank you !

Hi, I'll make a ticket to clean up that commented out code, but it shouldn't cause any problems - it's the next line PrefabUtility.SavePrefabAsset(prefab.gameObject) that actually saves the data.

I'm not sure why you're getting the error that you're getting - HUDPanel is certainly a MonoBehaviour. It suggests to me that your project is failing to compile; are you getting any other errors in your console?

I edited my post before seeing your answer, I think it will work.

I don't have any other error and this error happens just when I am typing the new address, and it stops when I am done typing.

Interesting. I would guess you're getting two ros connections because you're calling ROSConnection.GetOrCreateInstance very early in the startup process, maybe during an Awake function? If you move that to a Start function it should work.
(The ROSConnection in your scene will register itself as the global ROSConnection during its Awake, which happens before Start. After that has happened, calling GetOrCreateInstance will return the one from the scene, instead of creating a new one. Actually, thanks for bringing this to my attention, I'll make it work better.)

Ok, I see why the error is appearing; the HudPanel class is defined in a file called HUDPanel.cs, and under certain conditions Unity is case sensitive about that.

[quote=“LaurieUnity”, post:6, topic: 859141]
Interesting. I would guess you’re getting two ros connections because you’re calling ROSConnection.GetOrCreateInstance very early in the startup process, maybe during an Awake function? If you move that to a Start function it should work.
(The ROSConnection in your scene will register itself as the global ROSConnection during its Awake, which happens before Start. After that has happened, calling GetOrCreateInstance will return the one from the scene, instead of creating a new one. Actually, thanks for bringing this to my attention, I’ll make it work better.)
[/quote]

It looks like it’s working and I have just one connection, the other day must have been just a bug.

Thanks for the help !