ros2 / ros2_documentation

ROS 2 docs repository
https://docs.ros.org/en/rolling
Creative Commons Attribution 4.0 International
556 stars 1.07k forks source link

Need example Docker invocation for distributed ROS systems #3976

Open slowrunner opened 1 year ago

slowrunner commented 1 year ago

There is great documentation on installing ROS 2 in a Docker container and running the demo_nodes talker/listener for a single container or two containers but lacks documentation of the needed parameter (--net=host) for ROS 2 in a container to communicate with distributed ROS 2 nodes.

The ROS 2 invocation to allow non-local topic communication is:

sudo docker run -it --net=host osrf/ros:humble-desktop

fujitatomoya commented 1 year ago

Can you elaborate a bit why --net=host is required to the tutorial? i think it does not have to be using host network interface, but using docker bridge can allow the ROS 2 applications in the containers to communicate each other? binding host network would be more problem if the user's physical network does not support multicast?