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

Docker and ROS

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

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
2

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

ruffsl gravatar image

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

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.

https://docs.docker.com/engine/refere...

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:
http://wiki.ros.org/ROS/NetworkSetup

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.
https://docs.docker.com/compose/netwo...

edit flag offensive delete link more

Question Tools

2 followers

Stats

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

Seen: 1,874 times

Last updated: Jun 20 '18