How to Install ROS Noetic in Ubuntu

ROS, stands for Robot Operating System, is an open-source framework that helps researchers and developers easily build and reuse code between different robotics applications without a deep understanding of the hardwares and algorithms.

You can say that ROS is a collaborative global community of engineers, developers and hobbyists who all work together to contribute their own code to make robotics more accessible and available to everyone.

ROS Noetic Ninjemys is the latest ROS 1 LTS Release primarily targeted at Ubuntu 20.04, released back in May 2020. ROS 2 (codename Foxy) contains new sets of packages that can be installed alongside ROS 1 to ease migration to a more secure platform. ROS 2 takes advantage of new technologies and newly updated APIs asked for by the community.

This article is going to show you how to install ROS Noetic on your Ubuntu 20.04 system. The guide is also applicable to many other Linux distro based on Ubuntu, such as Linux Mint or Pop! OS.

Install ROS Noetic on Ubuntu 20.04

Update all packages

Before installing any new package or software application, it is suggested that you refresh your system cache. To do this, run the below-mentioned command to update the apt packages list of the Debian repository.

sudo apt update

Add ROS software repository

After updating all the packages, you can move on to installing ROS Noetic. ROS Noetic is hasn’t been added to the official Ubuntu repositories. This means you have to add their package repository into your system in order to install ROS Noetic. Run the following command to allow software from packages.ros.org to be installed.

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
Code language: JavaScript (javascript)

Next, we are going to add ROS public key into the system so that it can verify the origin of the software.

curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
Code language: JavaScript (javascript)

If you encounter error messages beginning with curl: command not found, you may need to run the following command to install curl before retry adding the public key again.

sudo apt install curl

Install ROS Noetic on Ubuntu

Now we can begin installing ROS Noetic itself, given that ROS package repository is properly set up.

There are three ROS variation for you to choose :

  • ros-noetic-ros-base contains ROS packaging, build, and communication libraries. No graphical interface utilities.
  • ros-noetic-desktop contains everything in ros-noetic-ros-base plus tools like rqt and rviz
  • ros-noetic-desktop-full (Recommended) : Everything in ros-noetic-desktop, and 2D/3D simulators and 2D/3D perception packages.

It is recommended to install the ros-noetic-desktop-full which contains almost every features an ordinary user may need.

sudo apt-get install ros-noetic-desktop-full -y
Code language: JavaScript (javascript)

The ROS repository also contains all packages from the ROS Index, therefore you cna install a specific package directly using the following syntax:

sudo apt install ros-noetic-PACKAGE_NAME
ROS Noetic running in Ubuntu

Important : Set up Bash for ROS Noetic

ROS loads a bunch of things at startup using a setup.bash script located in /opt/ros/noetic/. Originally, you must source this script every time you want to use ROS in a Bash shell (default Ubuntu terminal) using the following command:

source /opt/ros/noetic/setup.bash

If you don’t do this, trying to run roscore will bring you to this error :

ROS Noetic not set up properly

Doing this over and over is pretty unproductive. You can configure Bash to automatically source this script every time a new terminal window or shell is launched. Run the following command to do that. You may have to restart your system afterwards for the new setting to take effect.

echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc source ~/.bashrc
Code language: PHP (php)

If you use ZSH as your terminal shell, you can set it up for ROS Noetic using this command :

echo "source /opt/ros/noetic/setup.zsh" >> ~/.zshrc source ~/.zshrc
Code language: PHP (php)

We hope that the article helps you successfully set up ROS Noetic in Ubuntu 20.04. You may be interested in our other Linux software roundups, including 8 Best Open Source CMDB software, Best Linux Video Converters or Best Python Graphics Libraries. If you have any suggestion, please feel free to leave a comment below.

Click to rate this post!
[Total: 1 Average: 4]

Leave a Comment