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).
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.
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 :
And I just noticed this comment in the code in the file mentionned in the error :
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 :
I will test it later as I don’t have the second computer with ROS and will let you know if everything works !
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?
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.