Setting up ROS2 - Weber-State-Submarine-Project/Submarine GitHub Wiki

Installing ROS2 Jazzy

Due to the Pi 5 only supporting Ubuntu 23.1 and up, we are forced to used ROS2 Jazzy instead of Humble. Please note that these steps were done on Ubuntu 24.04. ROS2 Humble? might work,

Step 1: Set Locale

locale  # check for UTF-8

sudo apt update && sudo apt install locales
sudo locale-gen en_US en_US.UTF-8
sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
export LANG=en_US.UTF-8

locale  # verify settings

Step 2: Ensure that the Ubuntu Universe repository is enabled.

sudo apt install software-properties-common
sudo add-apt-repository universe

Step 3: Add the ROS 2 GPG key with apt.

sudo apt update && sudo apt install curl -y
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg

Step 4: Add the repository to your sources list.

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 > /dev/null

Step 5: Install Development Tools

sudo apt update && sudo apt install ros-dev-tools

Step 6: Update your apt repo

sudo apt update

Step 7: ROS 2 packages are built on frequently updated

sudo apt upgrade

Step 8: Desktop Install

sudo apt install ros-jazzy-desktop

Setting Up .bashrc

Enter the .bashrc file and add the following line at the bottom

source /opt/ros/jazzy/setup.bash