Exploring how to get started with ROS TurtleSim as fast as possible using a single Docker container.
A single command is needed to build a working environment. From this repository root, where Dockerfile
is:
docker build . -t easyturtle
The command ends with a local image tagged easyturtle
.
Running the image executes is often just:
docker run --rm --interactive --tty --name easyturtle easyturtle
Tests on Ubuntu 18 through 22 have required:
docker run --rm --interactive --tty --env DISPLAY=$DISPLAY --net host --name easyturtle easyturtle
Tests on MacOS and Ubuntu 20 often require explictly authorising access to X11:
xhost + 127.0.0.1
: This will start an X11 server if needed, and allow the container to connect.xhost + local:
, for testing, xhost +
is also available but not recommended (security issue, important to reactivate after usage with xhost -
).Notes:
--rm
is just to delete the container after use (too simple an application and no state anyway).--interactive --tty
is to be able to allow controling the turtle with the keyboard.--net host
sets the container on the same network as the host machine, so the container can access the X11 server.docker run easyturtle
.Keeping focus on the shell window running the container, you can use the arrows to move the turtle around.
TurtleSim is a simple application, yet relying on the ROS infrastructure, with the core and topic. Just running this simple application requires a few steps:
roscore
in some background.Tutorials usually lead to 3 shells open, assuming ROS runs well on the host OS.
Trying to keep simple things simple, containers can be pretty attractive. They may not be appropriate for production environments in this way, yet offer to pack and use conveniently (well, assuming a Docker engine is available), and should bridge learning deeper ROS concepts.
The first trials for this repository are based on nice resources:
The first Dockerfile
is basically a turnkey version of their work.
screen
for systemd
or else.kinetic
, but not exposed at this point.