KIT-ISAS / iviz

Utilities for visualizing and working with ROS data using C# and Unity. Part of the ROBDEKON project.
MIT License
121 stars 27 forks source link

Older Versions of ROS (Indigo/Kinetic) Support? #11

Closed tgroechel closed 3 years ago

tgroechel commented 3 years ago

I'm able to get iviz to connect (Win 10 Unity) to a laptop's roscore (Ubuntu 18.04/melodic).

I've been having issues with other laptops/robots, however, using 14.04/Indigo and 16.04/Kinetic. I run roscore on the laptops/robots and make sure to set ROS_MASTER_URI , ROS_HOSTNAME, and ROS_IP to whichever ip they are assigned (have tried a combination of hostname/ip changes with no success).

On the Unity side, in the iviz UI AR Scene, I get the following error:

RpcConnectionException Error while calling RPC method 'getSystemState' at http://A.B.C.D:11311/ // removed ip from log to post online, I do have this correct though I believe as I can get it to work with a different IP/melodic
IOException Partner closed connection
UnityEngine.Debug:LogWarning (object)
Iviz.Core.Logger:InternalImpl (string,System.Exception,System.Text.StringBuilder) (at Assets/Core/Utils/Logger.cs:144)
Iviz.Core.Logger:Internal (string,System.Exception) (at Assets/Core/Utils/Logger.cs:103)
Iviz.Ros.RoslibConnection/<Connect>d__28:MoveNext () (at Assets/ROS/RoslibConnection.cs:214)
System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder`1<Iviz.Roslib.RosClient>:SetException (System.Exception)
Iviz.Roslib.RosClient/<CreateAsync>d__47:MoveNext ()
System.Runtime.CompilerServices.AsyncTaskMethodBuilder:SetResult ()
Iviz.Roslib.XmlRpc.NodeServer/<DisposeAsync>d__15:MoveNext ()
System.Runtime.CompilerServices.AsyncTaskMethodBuilder:SetResult ()
Iviz.XmlRpc.TaskUtils/<AwaitNoThrow>d__12:MoveNext () (at C:/Users/telepresence/Documents/Unity/iviz/iviz_xmlrpc/TaskUtils.cs:271)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder:SetResult ()
Iviz.XmlRpc.HttpListener/<DisposeAsync>d__17:MoveNext () (at C:/Users/telepresence/Documents/Unity/iviz/iviz_xmlrpc/HttpListener.cs:93)
System.Threading._ThreadPoolWaitCallback:PerformWaitCallback ()

I can't seem to pin down the connection issue/don't have a great networking background. I'm guessing this is a ros_comm issue that has changed from kinetic -> melodic. I can't really upgrade my robots sadly. Any idea where to look would be greatly appreciated.

tgroechel commented 3 years ago

Looks like this may something specific in the included Unity dll and/or getSystemState calls. I was able to pub/sub from a separate dotnet project with the iviz_utils project added to the sln :) I'll post whatever I find and do a PR if there is any straightforward change to make.

akzeac commented 3 years ago

Yes, sorry. The HTTP library wasn't honoring the 'connection: close' header entry sent from Kinetic, so it was surprised by the host suddenly closing the connection. The fix was already in iviz_utils, but the dlls weren't copied to Unity. I think it should work now.

tgroechel commented 3 years ago

Thanks!