ROS2: Unable to send images using ros2 topics

Hi.

I am trying to send video from my webcam (approximately at 30 fps) to another device in the same network. Both devices are connected via husarnet.

I followed all the instructions available here - Using Husarnet & ROS 2 | Husarnet

I am also able to view the /chatter topic as given in the above tutorial. I am using FastDDS with the default configuration xml created by husarnet.

I ran the following commands-

PC1-
ros2 run image_tools cam2image

PC2-
ros2 run image_tools showimage

After going through the documentation of FastDDS available here - 15.3. Large Data Rates — Fast DDS 2.12.0 documentation, it seems we need to do some changes in the xml file.

Could you help in creating the new xml file?

PS- If I do not use husarnet and follow the above process by setting the same domain ID for both the PCs connected to the same network, I am able to clearly view the video on PC2.

Looking forward to your reply.

Hi @amit , please take a look at this example showing you how to use Husarnet in a ROS 2 system where robot is sending compressed camera images to the laptop: GitHub - husarion/rosbot-telepresence: Real-Time Internet Control and Video Streaming with ROSbot 2R / 2 PRO.

Please review all branches, because each of them presents how to achieve the same goal over Husarnet VPN, but with different setups.

Best,
Dominik

Hi @dominik ,

Thank you for your reply. I did test what was mentioned in the above GitHub repo. With that I am able to send compressed images. However, I am not able to send the raw images even when both the computers are on the same WiFi network.

To test the issue, I uninstalled husarnet, and sent the same image by connecting to the same router and setting the ROS_DOMAIN_ID parameter. It works flawlessly.

Could you guide where I am going wrong in using husarnet?

To give you context, I want to transfer the video and depth stream coming from a realsense depth camera. I had tried this in ROS1 using husarnet, and it worked flawlessly.

Hi @amit , have you tried tips from Useful tips section?

Especially this one:

sudo sysctl -w net.ipv6.ip6frag_time=3 # 3s
sudo sysctl -w net.ipv6.ip6frag_high_thresh=134217728 # (128 MB)

Best,
Dominik

Yes. After running this, I was able to view images received on compressed image topic. However raw images and depth stream are still not working.

Also, ifstat -i hnet0 command shows KB/s of out as 10,000+ .

@dominik Please let me know if you have any other resource for solving this.

@amit , have you tried reducing the size of the raw image? Also what htop shows where you are sending large raw images?

Yes. Reducing the image size and using compressed image works. However raw image or depth topic doesn’t.

htop shows this-

As mentioned before-

To test the issue, I uninstalled husarnet, and sent the same image by connecting to the same router and setting the ROS_DOMAIN_ID parameter. It works flawlessly.

How can this work with husarnet installed? Do I have to make any changes to XML?

@dominik Any update regarding this?

Hi @amit , maybe try with Husarnet and ROS 2 Router? Please take a look at one of our latest blog posts: ROS 2 Router for Remote Robotics and Topic Filtering | Husarnet