2.2. ROS Installation

Note

The following installations steps work for a Ubuntu 24.04 amd64 version and for the Ubuntu 24.04 arm64 server image for the Raspberry Pi.

2.2.1. Preparation

  1. Make sure you have a UTF-8 supported locale with

    $ locale
    

    If not, refer to the ROS documentation.

  2. Enable universe repository

    $ sudo apt install software-properties-common \
    && sudo add-apt-repository universe
    
  3. Add the key

    $ 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
    
  4. Add sources

    $ 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
    
  5. Update

    Warning

    This is critial!

    $ sudo apt update && sudo apt upgrade -y
    

2.2.2. Installation

Note

Choose the installation option depending on your needs. Probably it’s not reasonable to install ros-jazzy-desktop-full on an Ubuntu server image for the Raspberry Pi.

  1. Install ROS

    sudo apt install ros-jazzy-desktop-full
    
  2. Install development tools

    $ sudo apt install ros-dev-tools python3-pip
    

2.2.3. rosdep Initialization

$ sudo rosdep init && rosdep update

Note

Do not execute rosdep update with root privileges. This would lead to permission issues.

2.2.4. Source the ROS Setup

$ echo 'source /opt/ros/jazzy/setup.zsh' >> ~/.zshrc \
&& . ~/.zshrc