Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Connection to 192.XXX.XX.ab:10000 failed - System.IO.IOException

Discussion in 'Robotics' started by GerenMeric, May 29, 2023.

  1. GerenMeric

    GerenMeric

    Joined:
    May 15, 2023
    Posts:
    47
    Hello there,

    I am trying to send messages from a pc through ROS to another copmputer in the same local network and into Unity via ROS-TCP-Endpoint and ROS-TCP-Connector. I have only set ROS_IP and ROS_MASTER_URI at each device and ROS_IP value in Unity is set to ip of the computer which will run endpoint.launch and Unity (subscriber side). But, when i launch endpoint.launch with
    roslaunch ros_tcp_endpoint endpoint.launch
    and then press the play button in unity, i see that the icon next to the ROS_IP is red and i see the following error in console
    Code (CSharp):
    1. Connection to 192.XXX.XXX.ab:10000 failed - System.IO.IOException: Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host.
    2.  
    3. UnityEngine.Debug:Log (object)
    4. Unity.Robotics.ROSTCPConnector.ROSConnection/<ConnectionThread>d__115:MoveNext () (at Library/PackageCache/com.unity.robotics.ros-tcp-connector@c27f00c6cf/Runtime/TcpConnector/ROSConnection.cs:854)
    5. System.Runtime.CompilerServices.AsyncTaskMethodBuilder:Start<Unity.Robotics.ROSTCPConnector.ROSConnection/<ConnectionThread>d__115> (Unity.Robotics.ROSTCPConnector.ROSConnection/<ConnectionThread>d__115&)
    6. Unity.Robotics.ROSTCPConnector.ROSConnection:ConnectionThread (string,int,single,single,int,System.Action`1<System.Net.Sockets.NetworkStream>,System.Action,Unity.Robotics.ROSTCPConnector.ROSConnection/OutgoingMessageQueue,System.Collections.Concurrent.ConcurrentQueue`1<System.Tuple`2<string, byte[]>>,System.Threading.CancellationToken)
    7. Unity.Robotics.ROSTCPConnector.ROSConnection:<Connect>b__102_0 () (at Library/PackageCache/com.unity.robotics.ros-tcp-connector@c27f00c6cf/Runtime/TcpConnector/ROSConnection.cs:507)
    8. System.Threading._ThreadPoolWaitCallback:PerformWaitCallback ()

    Subscriber PC (Running endpoint, Unity and subscriber):

    • OS: Windows 10
    • IP Address: 192.XXX.XXX.ab
    • ROS_IP (set from cmd): 192.XXX.XXX.ab
    • ROS_IP (set inside Unity): 192.XXX.XXX.ab
    • ROS_MASTER_URI (set from cmd): http://192.XXX.XXX.dc:11311
    • Unity Version: 2021.3.25f1
    • ROS-TCP-Connector Version: 0.7.0-preview
    • ROS-TCP-Endpoint Version: 0.7.0
    • ROS Distro: Noetic
    • Connection Method: WIFI

    Publisher PC (Running roscore and publisher):

    • OS: Linux Ubuntu 18.04
    • IP Address: 192.XXX.XXX.dc
    • ROS_IP (set inside .bashrc with
      export ROS_IP
      ): 192.XXX.XXX.dc
    • ROS_MASTER_URI (set inside .bashrc with export command): http://192.XXX.XXX.dc:11311
    • ROS Distro: Melodic
    • Connection Method: Ethernet

    Could you help me on this issue please?

    Thanks in advance.

    P.S. I tried setting tcp_ip and tcp_port parameters on roslaunch. But, the issue still persists.
     
    Last edited: May 29, 2023
  2. GerenMeric

    GerenMeric

    Joined:
    May 15, 2023
    Posts:
    47
    When, i try to set tcp_ip and tcp_port number to 192.XXX.XXX.ab and to 11311 respectively, i get the following exception: