ROS2 multicast in Docker running on Windows

asked 2023-06-20 08:37:32 -0500

paulvp gravatar image

updated 2023-06-20 11:24:13 -0500

gvdhoorn gravatar image

I am trying to perform ros2 multicast send in a Ubuntu (22.04) docker container running in Windows host, and ros2 multicast receive on a different PC natively running Ubuntu 22.04. I do this since, I wish to deploy a docker image that can run on both Windows and Ubuntu (considering versions other than 22.04). However, I am failing to achieve this, which on investigation I find the issue being on the Windows side.

Can anyone help me on this ?

Setup in brief:

  • Windows 11 Machine with Docker installed
  • Ubuntu 22.04 with ROS2 installed
  • Docker Image is Ubuntu 22.04 with ROS2 Humble installed
  • Run a container of this image in Win 11 machine with --net=host
  • Run ros2 multicast receive in Ubuntu machine.
  • In the bash of this Ubuntu container, run ros2 multicast send.

Ideally the receiving end should get a "Hello World".

Thanks in advance.

edit retag flag offensive close merge delete

Comments

Quick note: is docker on Windows still running inside a VM (it's been a long time since I checked it). If it is (and HyperV would still count as a VM) you might need to configure the networking in a way that allows multicast traffic to pass and/or map required ports.

Unfortunately Docker and networking is never trivial.

gvdhoorn gravatar image gvdhoorn  ( 2023-06-22 04:55:59 -0500 )edit

Docker desktop in Windows runs on WSL2 (Windows Subsystem for Linux) which is essentially a virtualization like HyperV. I tried to keep the WSL's eth0 IP address and the gateway same as that of my static IP of the host (Windows) machine. And also forced the ROS2 to communicate through this eth0 interface of WSL. Maybe I am missing something - especially I am told that multicast may not be so straight forward. If you are aware of how to do this, could you please let me know the steps. Thanks in advance, for the help.

paulvp gravatar image paulvp  ( 2023-06-22 05:11:52 -0500 )edit