The Robot Operating System (ROS) is an open-source robotics middleware suite. ROS is not a traditional operating system like Linux or macOS but a collection of software libraries and tools used to build robotic systems and applications. The current Long Term Service (LTS) version of ROS 1 is Noetic Ninjemys. It was released on May 23, 2020, by Open Robotics, the developer of ROS. It will be supported for five years until May 2025. However, in the future, all the official effort will be put into developing ROS 2, which is a major rewrite of the ROS framework.
ROS Noetic Ninjemys was developed for Ubuntu 20.04, so Ubuntu is the recommended Linux OS for installation. Note that Windows and Arch Linux support is still experimental and might not be fully functional. This tutorial explains how to install ROS Noetic Ninjemys from source on a Raspberry Pi. It’s not hard, but it will take a long time to compile everything, so grab a cup of coffee and a book to read while you wait for your machine to compile everything.
Step 1: Preparation of Raspberry Pi
ROS Noetic Ninjemys officially supports the Ubuntu Focal and Debian Buster operating systems. Since the Raspberry Pi OS is a Debian-based operating system, we need to ensure that the Raspberry Pi we’re using runs on Raspbian Buster. The latest version of Raspbian at the time of writing is Bullseye, so you’ll need to downgrade to Raspbian Buster if you’re using the latest version of Raspbian. You can download Raspbian Buster from the Raspberry Pi Foundation’s official Raspbian image archives.
Once the Raspberry Pi is up and running, we can check whether the latest drivers are installed with the following command.
This command updates the list of available packages and their versions.
Once complete, you can reboot your Raspberry Pi by typing the following command.
Step 2: Increasing Raspberry Pi Swap Memory
If you own a Raspberry Pi, you should know that the RAM has a limited capacity. This problem can be solved by simply enlarging the swap memory of the Raspberry Pi. This means that when all of the Raspberry Pi’s RAM is exhausted, it can start using the swap file as memory instead. Raspbian ships with a default swap file size of 100 MB, and in this case, we are simply increasing that to 2 GB.
Run the following command to stop the operating system from using the current swap file.
Next, we need to modify the swap file configuration file. We can open this file using nano by using the command below.
Within this config file, find the following line of text.
Now, set it to a size of 2 GB; make sure you have the said amount of space available on your SD card.
We can now re-initialize the Raspberry Pi’s swap file by running the command below.
To start the operating system with the new swap file, run the following command.
You can now verify the amount of RAM and swap memory available by issuing the following command:
Step 3: Set Up ROS Repository on Raspberry Pi
We set up our machine to accept software from
If the command succeeds, you won’t see any output. However, you can double-check if the repo is added using the
You will see the following output:
Step 4: Set Up Official ROS Keys
Next, we will add the official ROS key to download authentic ROS Noetic Ninjemys packages to our Raspbian Buster.
Step 5: Install Build Dependencies on Raspberry Pi
We are finally ready to install ROS Noetic Ninjemys on our Raspberry Pi. First, we make sure our Debian package index is up-to-date:
Now pick how much ROS you would like to install.
- Desktop-Full Install: Everything in Desktop plus 2D/3D simulators and perception packages.
- Desktop Install: Everything in ROS-Base plus tools like rqt and rviz
- ROS-Base (Bare Bones): ROS packaging, build, and communication libraries. No GUI tools.
There are even more packages available in ROS. You can always install a specific package directly. To find available packages, see ROS Index or use:
We will first install all dependencies:
Here, the dependencies include ROS-specific tools (
ws_tool) and some essential build tools like
Step 6: Set Up ROS Dependency Sources
First, we initialize
rosdep, which is a ROS tool for installing dependencies:
Next, we run
rosdep update to fetch package information from the repositories that are just initialized.
Step 7: Install ROS Dependencies
Before we begin, we will need to create a
catkin workspace by:
Then we use
rosinstall_generator to generate a list of ROS Noetic Ninjemys dependencies for different ROS Noetic Ninjemys variants, such as
ros_comm. I’ll go with installing desktop install here.
Next, we will use the
wstool to fetch all the remote repos:
The command will take a few minutes to download the core ROS packages into the
src folder. If
wstool init fails or is interrupted, you can resume the download by running:
Then before compiling the packages in the src folder, we install all system dependencies using
Step 8: Compiling ROS Packages
Once it has completed downloading the packages and resolving the dependencies, you are ready to build the catkin packages.
It takes a long time to compile these packages so you can work on something else in the meantime. Once the packages have been compiled, you should see the following output:
Step 9: Verify ROS Installation on Raspberry Pi
First, let’s source the bash.
Let’s try some ROS commands to ensure the installation has finished successfully. A simple way to check the functionality of ROS is to use the
turtlesim simulator that is part of the ROS installation.
Open a new terminal and run the following command:
Start a new terminal prompt and run the below command in the terminal:
Open up yet another terminal window. Run the following:
Click the mouse in the last container window you created so that it has focus. Use the arrow keys to move the turtle around the screen. If everything goes right, you will obtain the following result on current terminal:
Congratulations! 🎉 We are done with the ROS installation!