Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Publishing from Unity to ROS at high rates - [Queue Full, Messages getting dropped]

Discussion in 'Robotics' started by rgateragael, May 20, 2022.

  1. rgateragael

    rgateragael

    Joined:
    Oct 21, 2021
    Posts:
    2
    Hello,

    I have been trying to publish ROS image messages at 20Hz from Unity to ROS (being run in a docker container). The first issue I encountered was the following (see snipped).
    upload_2022-5-19_19-49-8.png

    Per the following post (Forum Post #1120414) for ROS packages versions above 0.4.0. the networking layer should be faster and able to handle heavy traffic.

    What I've tried:
    * increasing the buffer size and connections parameters in the server.py file in the ros_tcp_endpoint ROS package to buffer_size=4096, connections=10000 respectively.

    * increasing the k_DefaultPublisherQueueSize (ROSConnection.cs) line 61 to 1000

    * the ROSConnection.cs has a ClearMessageQueue method that should take care of the problem

    The second problem is that the messages are not being received in docker at the same interval as they are being published. See example for when I tried at 2 hz.
    upload_2022-5-19_20-14-0.png
     
  2. LaurieUnity

    LaurieUnity

    Unity Technologies

    Joined:
    Oct 23, 2020
    Posts:
    77
    Hi, if you're using ROS 1, we have a C++ implementation of the Endpoint that may help with these performance issues. Try checking out the "Roscpp" branch of ROS-TCP-Endpoint. (If you're launching it with the launch file it should just work; if you want to use rosrun the command is `rosrun ros_tcp_endpoint endpoint`)

    This version is still somewhat work in progress but should be fully functional. Let us know if you run into any bugs.
     
  3. rgateragael

    rgateragael

    Joined:
    Oct 21, 2021
    Posts:
    2
    Hello @LaurieUnity, thanks a lot for your reply. One thing I failed to mention is that I am using ROS2.
     
  4. Evilschnuff

    Evilschnuff

    Joined:
    Jul 12, 2017
    Posts:
    3
    Will there be an update to the ROS2 branch with the cpp version? I am having similar performance issues with receiving pointclouds.