Skip to content

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

  1. Download the Raspberry Pi imager
  2. Select Raspberry Pi 5 as the board
  3. Select Other general-purpose OS -> Ubuntu -> Ubuntu Desktop 24.04.1 LTS (64-BIT)
  4. Select your micro SD card.
  5. Click save + wait.
  6. Once flashed, plug your micro SD card into your Pi and connect peripherals.

2. Install Docker

  1. Follow the Ubuntu setup instructions on first boot. We recommend naming your profile hexapod-<lastname> on the system hexapod<lastname>. If you run into issues setting up the pi, skip the Wi-Fi connection step until the system is fully configured.
  2. Follow the instructions at Install Docker Engine on Ubuntu - Install using the apt repository.
  3. Once installed follow Linux post-installation steps for Docker Engine to run Docker commands without root privileges.
  4. Run apt install docker-compose.

3. Download the Docker Image

  1. 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/container directory
  2. Run ./build.sh.
  3. Run ./init_dev.sh or ./init_prod.sh depending on interfaces required.

4. Run setup script to install other dependencies and create custom cronjobs

  1. Navigate to your non_real_time directory
  2. run sudo ./setup.sh

5. Edit boot file to give access to dev port

  1. open file with sudo permissions sudo nano /boot/firmware/config.txt
  2. add this line to the bottom of the file dtoverlay=uart0,ctsrts
  3. be sure to save your changes!

6. Connect Xbox Core (Series S, X, etc) Controller

  1. Controllers must have their firmware updated via the Xbox Accessories Windows app to be identified by recent Ubuntu releases.
  2. 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

  1. Assure docker and docker-compose are installed on your system and that docker commands can be used without privilege escalation
  2. Navigate to the container directory non_real_time/container/
  3. Build the container with ./build.sh (if you are having issues with this, try pasting the .sh file contents and running from cmd line)
  4. Follow the below Development Usage or Production Usage instructions depending on your use case

2. Development Usage

  1. Start the container with ./init_dev.sh
  2. Create shells running inside the container with ./new_dev_shell.sh
  3. When shutting down use ./stop_dev.sh

Important Notes:

  • When started with ./init_dev.sh the 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.txt or setup/python-requirements.txt for 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

  1. Start the production container with ./init_prod.sh