Setting up your Raspberry Pi 5
This section will walk you through configuring the Raspberry Pi 5 with Ubuntu, Docker, and Ros2.
Requirements
- Raspberry Pi 5
- Micro SD Card (64GB+ preferred).
- Micro HDMI to HDMI cable.
- USB connected keyboard.
- USB connected mouse.
1. Flashing the SD Card
- Download the Raspberry Pi imager
- Select
Raspberry Pi 5as the board - Select
Other general-purpose OS->Ubuntu->Ubuntu Desktop 24.04.1 LTS (64-BIT) - Select your micro SD card.
- Click save + wait.
- Once flashed, plug your micro SD card into your Pi and connect peripherals.
2. Install Docker
- Follow the Ubuntu setup instructions on first boot. We recommend naming your profile
hexapod-<lastname>on the systemhexapod<lastname>. If you run into issues setting up the pi, skip the Wi-Fi connection step until the system is fully configured. - Follow the instructions at Install Docker Engine on Ubuntu - Install using the
aptrepository. - Once installed follow Linux post-installation steps for Docker Engine to run Docker commands without root privileges.
- Run
apt install docker-compose.
3. Download the Docker Image
- Download the code from one of our Hex# repositories. This code does not need to live anywhere specific. Then navigate into the
non_real_time/containerdirectory - Run
./build.sh. - Run
./init_dev.shor./init_prod.shdepending on interfaces required.
4. Run setup script to install other dependencies and create custom cronjobs
- Navigate to your
non_real_timedirectory - run
sudo ./setup.sh
5. Edit boot file to give access to dev port
- open file with sudo permissions
sudo nano /boot/firmware/config.txt - add this line to the bottom of the file
dtoverlay=uart0,ctsrts - be sure to save your changes!
6. Connect Xbox Core (Series S, X, etc) Controller
- Controllers must have their firmware updated via the Xbox Accessories Windows app to be identified by recent Ubuntu releases.
- Once updated, the controller can be connected via Ubuntu's bluetooth UI.
Docker Container
This section discusses setup and use cases of our docker container
1. Initial setup
- Assure docker and docker-compose are installed on your system and that docker commands can be used without privilege escalation
- Navigate to the container directory
non_real_time/container/ - Build the container with
./build.sh(if you are having issues with this, try pasting the .sh file contents and running from cmd line) - Follow the below Development Usage or Production Usage instructions depending on your use case
2. Development Usage
- Start the container with
./init_dev.sh - Create shells running inside the container with
./new_dev_shell.sh - When shutting down use
./stop_dev.sh
Important Notes:
- When started with
./init_dev.shthe container will be running in idle mode until stopped with./stop_dev.sh - For changes to go into effect in development the container does not need to be rebuilt after the initial build, but to move to production, it will be
- Make sure all code that is intended to run during container operation resides in the src directory
- Make sure any system packages or python packages installed get added to
setup/system-requirements.txtorsetup/python-requirements.txtfor those packages to be included into the container at the next build - For help with running or launching our ros2 nodes and packages please see the Ros2 Packages and Nodes section of our Useful Commands wiki
3. Production Usage
- Start the production container with
./init_prod.sh