⌚ Time to complete: 30 min

Planned outcomes

You will have a working ROS Noetic installation on your machine.

Prerequisites

To install ROS Noetic, you will need a machine with Ubuntu 20.04 (Focal Fossa) installed on it.

Steps

  1. Set up sources:

    sudo sh -c 'echo "deb <http://packages.ros.org/ros/ubuntu> $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
    
  2. Set up keys:

    sudo apt install -y curl
    curl -s <https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc> | sudo apt-key add -
    
  3. Update indexes:

    sudo apt update
    
  4. Install desktop version of ROS Noetic (recommended for development Robot Control Servers):

    sudo apt install -y ros-noetic-desktop-full
    

    <aside> ⏳ This will take several minutes to complete, so grab a cup of coffee in the meantime.

    </aside>

  5. Add ROS setup script to your rc file.

    <aside> ℹ️ This will make ROS commands available to you in every terminal session without manual setup.

    </aside>

    # Define variables
    SHELL_NAME=$(basename $(echo $0))  # gets the name of the current shell automatically
    ROS_INIT_ENTRY="# Initialize ROS
    source /opt/ros/noetic/setup.${SHELL_NAME}"
    RC_FILE_PATH=~/.${SHELL_NAME}rc
    
    # Patch RC file (using grep to make sure that the entry is not duplicated)
    grep -xqF ${ROS_INIT_ENTRY} ${RC_FILE_PATH} || echo "\n${ROS_INIT_ENTRY}\n" >> ${RC_FILE_PATH}
    
    # Source the RC file
    source ${RC_FILE_PATH}
    
  6. Install package building dependencies:

    sudo apt install -y \
      build-essential \
      python3-rosinstall \
      python3-rosinstall-generator \
      python3-wstool \
      python3-catkin-tools \
      python3-osrf-pycommon
    
  7. Install and initialize rosdep:

    # Install rosdep
    sudo apt install -y python3-rosdep
    
    # Initialize rosdep
    sudo rosdep init
    rosdep update
    
  8. Done! 🎉

Notes

This guide is based on the official installation tutorial from ROS wiki.