ROS2 in Docker
DPRG Workshops
Introduction
This page and its subpages contain the curriculum, exercises and other supporting data for a series of workshops aimed at teaching DPRG members how to use ROS2 in their robots for logging and analysis purposes.
The scope of the workshops is what seems most useful to DPRG members, who broadly use Windows PCs (but not exclusively), and who often use microcontrollers like Arduino running a subsumption stack as the main robot computer. What seems useful is to provide tools for logging data and analyzing it during or after an operation or mission.
Workshops ARE:
ROS2 running in docker on RPi and on Windows or Linux PC. Windows uses a VM.
RPi running Bookworm or Bullseye (64-bit OS) release of Raspberry Pi OS (Note: participants may require a new SD card)
PC running Windows 10 or 11, or a recent Linux release
Docker container configuration, building, management
Package management for packages in the container (apt, Dockerfile)
How to capture bag files
How to use analysis tools: terminator, CLI commands, swri_console, rqt_*, plotjuggler, rviz, foxglove-studio
How to create and build ROS2 SW packages on RPi
How to add instrumentation to your robot code
Custom debug messages
micro-ROS on Arduino and ESP32
C++ and python for coding
Workshops ARE NOT:
How to build a broadly ROS-based robot
ROS1
ROS2 running natively on RPi or PC
Simulation with gazebo
Robot algorithms
Hardware
git, or other development tools generally
OO concepts and practice in C++, Python (though these will be used)
Series 1 Meeting Schedule
Meeting Wednesdays at 7pm central, Google Video call link: https://meet.google.com/fij-brwz-owf
Context
The context diagram below shows the scope of the workshop series: the software running on the telemetry RPi and the laptop. The specific learning objective is to learn how to build and use ROS2 tools in a telemetry-gathering and analysis use case. This use case is chosen because it provides broad exposure to ROS2 and knowledge and experience that is potentially broadly useful, while avoiding peeling the "make your robot a ROS2 robot" onion. Because of this goal, certain topics will not be covered: services, actions, and the nav and other stacks.
Workshop Proposed Structure
These proposed workshop-series structure and logistics are:
Workshop format: leader explains concepts then guides/helps participants to do exercises that give them the knowledge & experience intended
4 - 6 weekly sessions of 2-3 hours each - done in 6 weeks
Paul Bouchier leads sessions, demonstrates each learning item, and helps participants get through problems.
Workshops meet virtually on Google meetup and are recorded. Recordings are posted on DPRG 's YouTube channel and website (hopefully). Participants pick a convenient time to meet for the wokrshops, and manage any variations.
The DPRG RBNV meetings held on Tuesdays, at 7:30pm central) include a short segment used for coordination of the upcoming workshop. Paul Bouchier will present the segment, which will be used to coordinate whatever needs addressing, but RBNV is a separate meeting and will not be a rehash of the workshop.
Workshops generally consist of a short tutorial segment on concepts, followed by the leader demonstrating and assisting completion of hands-on exercises. Once the exercises have been completed, assistance will be given to participants who hit snags - others are free to leave.
Participants provide their own hardware
In the workshop, participants must stick to the "recipe". Experimentation with alternate methods or approaches needs to be done separately outside of this workshop. Paul has tested the recipes given in the workshop but can't test all possible variations on the recipes.
Sessions are limited to 4 - 8 participants. (If the series is successful it is likely to be repeated.) This limiitation is intended to facilitate keeping the workshops manageable and to avoid getting bogged down, or wasting participant's time.
Workshop sessions will be announced on the DPRG website (dprg.org) and in RBNV. Anyone may join as an observer and may follow-along with the exercises, but the workshop will only be paused (and then only briefly) for problems encountered by participants, not for observers. Participants are the focus of the workshops.
A short attempt will be made to help participants overcome any issues, but if unsuccessful, issues will be deferred until the end of the workshop, when everyone else has left.
Observers are incidental, and may ask questions (this will likely benefit the group as a whole) but observer's problems will not be investigated during the workshop.
Workshops
We configure the laptop and an RPi to enable remote access and prepare for docker installation. We test remote access.
Video from Workshop 1 (warning: 3 1/2 hours of rather wandering workshop): here Chat link: here
HW required:
Laptop capable of displaying GUIs and terminal windows from the RPi (minimum). Capable of running ROS2 in docker (desirable). The minimum level would be a laptop running VNC to the RPI. A better level would be an Ubuntu native machine or VM capable of running a docker with ROS2 in it.
RPi with minimum 16GB SD card. Any RPI that can run Raspberry Pi OS (not Raspbian) should work. It must run the 64-bit OS. Examples are: Raspberry Pi 4 or 5, RPi 3 (less desirable), RPi zero 2W (slow).
Adapter to connect SD card to laptop
Serial console socket and connectors to RPi 40-pin header (desirable)
USB-Serial cable (3.3V) (desirable).
Mini or micro-HDMI adapter to adapt RPi to monitor. A USB hub may be required to connect keyboard and mouse to RPi
Content outline
Configure laptop.
Update RPi FW
Install the right OS (Bullseye or Bookworm)
Configure serial console
Configure RPi with all the settings needed for remote use
We discuss docker concepts, and install it on laptop and RPi. We test launching docker on laptop and on RPi.
Content outline
Docker concepts: virtual env, images, containers, layers. shell & docker_exec. Containers as short-term resources. Process model. Mounted volumes. Networking model. Serial port access
How docker, RPi, and PC fit into the robot environment
Laptop & RPi pre-configuration: .bashrc
Install docker on laptop and RPi
git clone workshop docker repo and build the ros2_x86_linux and ros2_rpi containers
Scripts, aliases and basic docker commands
Launch container & run a ROS2 command on RPi
Customize container (add nano, apt-get and Dockerfile). Look at the contents of Dockerfile
Configure vs-code for remote editing
Delete container., perform system prune, review other docker commands
Content outline
Review ROS2 concepts: networking, DDS, micro-ROS, X-windows, vnc
ROS2 CLI Tools tutorials:
Turtlesim
Do Nodes & topics tutorials
CLI, gui tools and terminator
Launching nodes
Logging and bags, bag recording and playback
Bag analysis
Content outline
Do ROS2 Client Library tutorials related to publishing telemetry:
Colcon build package, create workspace, create package
Writing a simple publisher and subscriber (C++ or python)
Creating custom msg file, Implementing custom interfaces
Modify a telemetry-output package
Create custom message
Create launch file to run it all
Console output
ROS2 interface to Robot MicroController Workshop(s)
Content outline
uROS: supported environments, constraints
Other techniques for capturing robot data into the ROS2 environment
examples
Post-workshop Project
Add a ROS telemetry node running on an RPi to your personal robot. (You should know how by now.)