ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Docker and ROS

asked 2018-05-17 11:37:18 -0600

matt27110 gravatar image

Hello everyone,

As ROS works through TCP/IP communications, can we connect ROS nodes that are running on the host OS to nodes that are running into Docker containers ?

(so we can still have ROS without Docker on Windows communicating with ROS with Docker on a separate computer using Linux based OS)

Thank you in advance !!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-06-19 15:00:40 -0600

ruffsl gravatar image

updated 2018-06-20 14:33:30 -0600

There are a few ways to network ROS with docker. I'm not as familiar using containers on a windows host, but when using a linux host, I either use Docker's software defined networking features, or just bind the host's networking interfaces directly to be shared with the host running container.

The simplest of the two here would be just to pass -net=host argument to docker's run command when starting the container, the ROS networking is rather transparent and mimics how you normally use ROS as if it was running directly on host:

host: Use the host's network stack inside the container.

This is also useful if you have a mix of ROS processes running in the container and in the host, such as when you'd like to run rviz natively from the host os rather than deal with piping it's GUI display from inside a container.

When using docker container with windows or mac os hosts, i.e. using a small hypervisor to host the linux kernel, this then adds your average VM networking complexities. E.g. just accommodating ROS standard network setup:

If you'd like to use docker's software networking feature, I'd recommend configuring the system using docker-compose. This is more useful if you are managing multiple ROS networks/masters on a single machine.

edit flag offensive delete link more

Question Tools



Asked: 2018-05-17 11:37:18 -0600

Seen: 1,815 times

Last updated: Jun 20 '18