Skip to content

Raspberry Pi Setup

OS Installation

  1. Download Raspberry Pi OS (64-bit) from raspberrypi.com/software
  2. Flash to SD card with Raspberry Pi Imager
  3. Enable SSH and set Wi-Fi in the imager's advanced settings before writing

ROS 2 Humble Installation

bash
sudo apt update && sudo apt upgrade -y
sudo apt install software-properties-common
sudo add-apt-repository universe
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key \
  -o /usr/share/keyrings/ros-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] \
  http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" \
  | sudo tee /etc/apt/sources.list.d/ros2.list
sudo apt update
sudo apt install ros-humble-ros-base python3-colcon-common-extensions

Auto-source ROS 2

bash
echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc
source ~/.bashrc

Enable I²C & SPI

bash
sudo raspi-config
# Interface Options → I2C → Enable
# Interface Options → SPI → Enable

TIP

Use static IP on the Pi so your dev machine always finds it at the same address. Set it in /etc/dhcpcd.conf.

Released under the MIT License.