Duckiedrone Containers
Contents
Duckiedrone Containers#
The Duckiedrone software is not a single monolithic program. It is a set of smaller programs, each doing one job and handing its result to the next.
Each of those programs is delivered as a Docker image, and a running copy of an image is called a container, so the software on a Duckiedrone is a set of containers rather than an installed application. This modular architecture and reliance on containerization improve reproducibility.
Containers are grouped into Docker Compose files called stacks. A newly flashed Raspberry Pi image provisions robot/basics. The standard dts duckiebot update ROBOT_NAME command then runs stack up for robot/basics, duckietown/duckiedrone, and ros2/duckiedrone. The remaining stacks are optional, separate, or legacy.
To see what is running, log into the Duckiedrone and list the containers:
ssh duckie@ROBOT_NAME.local
docker ps
After a standard update, this list normally includes the containers from the three default stacks, plus containers from any separately started stacks.
Stacks#
Stack |
Contents |
Deployment |
|---|---|---|
|
Container management and the key-value store |
Fresh image and standard update |
|
Message backbone, sensor drivers, simulation support, device services |
Standard update |
|
ROS 2 transport and bridges |
Standard update |
|
Altitude functionality |
Separate stack; not selected by the standard update |
|
The front, left, right and top ToF sensors |
On request only |
|
Tools for inspecting the Duckiedrone |
On request only |
|
Legacy ROS 1 interface, rosbridge, and command multiplexer |
Legacy; not selected by the current updater |
|
Legacy PID, state-estimation, and visual-odometry services |
Legacy; not selected by the current updater |
The containers started by each stack are grouped below:
robot/basics
portainer
kvstore
duckietown/duckiedrone
dtps
driver-camera
driver-tof-bottom
dt-px4
mavlink-proxy
dashboard
files-api
code-api
device-proxy
device-health
device-online
wifi-access-point
ros2/duckiedrone
zenoh-router
ros2-camera
ros2-tof-bottom
ros2-mavros
ros2-px4-calibration
ros2-rosbridge-websocket
ros2-core/duckiedrone (separate, not selected by the standard update)
altitude
duckiedrone/extra_sensors (on request only)
driver-tof-front
driver-tof-left
driver-tof-right
driver-tof-top
ros2-tof-front
ros2-tof-left
ros2-tof-right
ros2-tof-top
duckiedrone/extra_tools (on request only)
ros2-foxglove-bridge
ros1/duckiedrone (legacy)
ros-interface
ros1-rosbridge-websocket
fly_commands_mux
core/duckiedrone (legacy)
pid-controller
state-estimator
visual-odometry
Run the following stack-management commands from a base station with the Duckietown Shell. They manage the Duckiedrone through its remote Docker endpoint. To bring one up:
dts stack up -H ROBOT_NAME -d duckiedrone/extra_sensors
To take the same stack down again:
dts stack down -H ROBOT_NAME duckiedrone/extra_sensors
The -H flag names the Duckiedrone and -d detaches, so the command returns instead of streaming the logs of every container.
Message backbone#
Two containers provide the message backbones used by the current stacks.
Container |
Role |
|---|---|
|
A switchboard used by drivers and other DTPS-enabled containers to exchange data |
|
Connects the ROS 2 containers. The current Duckiedrone ROS 2 containers use |
Sensor drivers#
Driver containers read the Duckiedrone’s sensors. Each one reads a device and publishes its data to the switchboard.
Container |
Role |
|---|---|
|
Captures camera data and publishes it through DTPS |
|
Reads the downward-facing ToF sensor, which measures height above the ground, and publishes it through DTPS. PX4 uses this sensor as its configured height source |
ROS 2 bridges#
The switchboard is not ROS 2. These containers translate: each one reads from the switchboard and republishes the same data as ROS 2 topics, so that ROS 2 code can use it.
Container |
Role |
|---|---|
|
Republishes the camera feed as a ROS 2 topic |
|
Republishes the downward ToF sensor reading as a ROS 2 topic |
|
Talks to the flight controller and exposes it to ROS 2. Used to read the Duckiedrone’s state, send it commands, and arm it |
|
Provides PX4 calibration workflows, including gyroscope and level-horizon calibration |
|
Lets the Dashboard, running in a browser, talk to ROS 2 |
Simulation#
The base stack declares two simulation-related containers. dt-px4 is explicitly for virtual Duckiedrones; the role of mavlink-proxy depends on the deployed robot configuration.
Container |
Role |
|---|---|
|
Runs PX4 in software for a virtual Duckiedrone instead of using a physical flight controller |
|
Routes MAVLink traffic where the deployed configuration uses it |
Device services#
These containers provide the Duckiedrone’s web interfaces and back-end services.
Container |
Role |
|---|---|
|
Runs the on-board Dashboard, the web interface used to fly and monitor the Duckiedrone |
|
Gives other tools access to the device’s |
|
Handles over-the-air software updates for the device |
|
Makes the device’s other APIs and services reachable from one place |
|
Reports on the health of the device |
|
Connects the device to the Duckietown cloud |
|
Runs the Duckiedrone’s own Wi-Fi network |
|
Stores small pieces of data that other containers need to remember |
|
A web interface for managing the containers on the device |
Optional sensors#
A Duckiedrone’s standard PX4 configuration uses the downward-facing sensor as its height source, so driver-tof-bottom and ros2-tof-bottom are included in the default stack set. The front, left, right, and top sensors are not included by default and start only when requested.
Container |
Role |
|---|---|
|
Reads the front-facing ToF sensor and publishes it to the switchboard |
|
Reads the left-facing ToF sensor and publishes it to the switchboard |
|
Reads the right-facing ToF sensor and publishes it to the switchboard |
|
Reads the top-facing ToF sensor and publishes it to the switchboard |
|
Republishes the front ToF sensor reading as a ROS 2 topic |
|
Republishes the left ToF sensor reading as a ROS 2 topic |
|
Republishes the right ToF sensor reading as a ROS 2 topic |
|
Republishes the top ToF sensor reading as a ROS 2 topic |
To start them:
dts stack up -H ROBOT_NAME -d duckiedrone/extra_sensors
The containers in this stack use Docker’s unless-stopped restart policy. After creation, they restart after a reboot unless explicitly stopped or the stack is taken down.
To stop them:
dts stack down -H ROBOT_NAME duckiedrone/extra_sensors
Optional tools#
Some containers are useful while developing or debugging, but neither flying the Duckiedrone nor serving the Dashboard needs them. They are not selected by the standard update and start only when requested.
Container |
Role |
|---|---|
|
Exposes the ROS 2 topics to Foxglove, used to visualize and record flights |
To start them:
dts stack up -H ROBOT_NAME -d duckiedrone/extra_tools
To stop them:
dts stack down -H ROBOT_NAME duckiedrone/extra_tools