View on GitHub

ROS with Docker

The following tutorial is a description of how I’ve got started with ROS.

Meanwhile, I use my own Dockerfiles to use ROS (e.g., run demos with Daisy) which saves some time (specifying options, e.g., environment variables, working directory, or installing packages) and uses x11docker for GUI tools (I strongly recommend!).


Usage Examples

Useful Docker commands

$ docker ps
$ docker ps -a
$ docker image ls
$ docker info
$ docker start <name>
$ docker exec -it <name> bash
$ docker stop <name>
$ docker container rm <name>

Inspect ROS nodes

On the host do:

You may create an alias for convenience (in .bashrc or similar):

alias docker_gui="docker run --net=host --user $(id -u) --env DISPLAY=$DISPLAY -v '/tmp/.X11-unix:/tmp/.X11-unix:rw'"

So you can later start a ROS GUI tool by:

$ docker_gui --name rqt_graph ros:melodic-desktop-full rqt_graph

You can then (re-)start rqt_graph by:

$ docker start rqt_graph

Some GUI apps still make troubles (e.g., rviz). You may try x11docker.

Controlling Daisy

On the host do:

In the container do:


2019-02-08 | Denise Ratasich