I am developing an application which integrates ROS2 galactic and NDI SDK to publish a video feed from a camera in a simulator (UE4) onto a ROS2 image topic. The simulator (UE4) is continuously streaming the camera at 30Hz, and my application is simply receiving a frame at maximum 20Hz. This is achieved by subscribing to a topic which publishes at a given Hz, triggering a callback function in my application to get a video frame. The data from the frame is then passed onto a sensor_msgs::img::Image, and then published as a topic.
When testing the application, I’m using an image display in rviz2 to visualize the published Image. This works as intended, but I’m experiencing very slight lags when looking at the published video.
ros2 topic hz $TRIGGER_APPLICATION displays 20Hz at a steady rate.
ros2 topic hz $SIMULATOR_IMAGE displays 11.0Hz - 13.6Hz. Additionally,
ros2 topic bw $SIMULATOR_IMAGE displays a constant message size of
8.29 MB, which is exactly the amount of allocated memory used to store an Image (1920 * 1080 * 4).
However, when executing
ros2 topic hz $SIMULATOR_IMAGE OR
ros2 topic bw $SIMULATOR_IMAGE, my network traffic spikes, reaching ~800 Mb/s, bringing down the office network.
Note that the message size I’m publishing from my application is still
I have ran manual profiling tests, where I can verify that NDI is working as intended, not causing delays and/or resource problems.
I have read up on https://discourse.ros.org/t/ros2-galactic-dds-problems/25654 and https://discourse.ros.org/t/unconfigured-dds-considered-harmful-to-networks/25689, which describes the issue I’m having - only that I’m experiencing network shutdown when running ros2 topic commands on one specific topic, and a varying display rate when expecting a stable one.
I also want to add that my application manages to fetch the video frame and publish the message very quickly, and should be more than able to publish at >= 20Hz. The issue seems to be somewhere on the ROS2-side of things, which is why I’m reaching out to the forum. I am guessing it has something to do with multicasting, however networking is a thorn in my side, and I want to assume as little as possible