ROS Installation
The robot's computer runs ROS Noetic on Ubuntu 20.04 Focal Fossa (Raspberry Pi Setup). ROS Noetic reached its end of life in May 2025, at the same time as the standard support of Ubuntu 20.04; Ubuntu MATE's own support for 20.04 ended in April 2023. This project still uses them, and the ROS package server keeps the final Noetic packages, so the installation below works. A container for the robot, to run Noetic on a newer host OS, is planned in diffbot#109, and the way to ROS 2 in diffbot#107.
All in one for Remo: raspi-setup.sh
The diffbot repository's raspi-setup.sh runs the commands of this page and of Packages Setup in one go, for Remo. On the robot:
1 2 | |
The sections below explain what the script does. Hardware Interfaces is still needed: it gives your user access to I2C and the serial port. For DiffBot, follow the pages: its camera driver needs the extra steps on Raspberry Pi Camera, which the script doesn't do yet.
Install ROS Noetic
The key that signs the ROS packages expired on 1 June 2025 and was renewed. The ros-apt-source package sets up the package source together with the current key, as the ROS signing key migration guide recommends.
Robot set up before June 2025? Remove the old package source first
Older instructions, including the ROS wiki and earlier versions of this page, add the package source to /etc/apt/sources.list.d/ros-latest.list and the key with apt-key. If your robot has that file, sudo apt update fails because the key from back then has expired (EXPKEYSIG). Remove the old entry and key before the commands below, as the migration guide describes:
1 2 | |
Download and install ros-apt-source:
1 2 3 4 | |
The second command asks GitHub for the latest version of ros-apt-source. GitHub answers 60 such requests per hour from one IP address, for example for a classroom behind one router. If dpkg reports that the file isn't a Debian archive, try again later, or set the version by hand, for example export ROS_APT_SOURCE_VERSION=1.3.0, and repeat the last two commands.
Then install ROS for the robot, ros-noetic-robot, without the GUI tools: RViz, Gazebo and rqt run on your PC, in the dev container. Install the tools to set up and build the workspace with it, among them the C++ compiler (build-essential), and python-is-python3, which nodes written with rospy need:
1 2 | |
Load ROS in every new terminal:
1 2 | |
Dependencies: rosdep
rosdep installs the system dependencies that ROS packages list in their package.xml. Set it up once:
1 2 | |
Noetic is past its end of life, so a plain rosdep update skips it, and rosdep install then can't find the ROS packages. --rosdistro noetic includes it.
The dependencies of diffbot's packages are installed later, once they are in the workspace: see Packages Setup.
Build Tool: catkin_tools
To work with ROS we will use catkin_tools
instead of catkin_make. catkin_tools provide commands such as catkin build which we will use instead of catkin_make because the catkin_tools are more actively developed than catkin_make
ref.
Note
It is recommended to use catkin_tools instead of the default catkin when building ROS workspaces.
catkin_tools provides a number of benefits over regular catkin_make and will be used in the documentation.
All packages can be built using catkin_make however: use catkin_make in place of catkin build where appropriate.
catkin_tools came with the python3-catkin-tools package above. Create and initialize a workspace, catkin_ws, with the commands from the catkin_tools quick start. ROS is already loaded through ~/.bashrc:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | |
Command Overview of catkin_tools
To create packages, which will be covered in the next posts in more depth, we will use catkin create pkg PKG_NAME.
Building the workspace is done with catkin build.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | |
Environment Setup
Finally the newly built packages have to be loaded in the environment using source.
1 | |
Tip
To avoid tediously typing the above source command, it is convenient to create an alias in your ~/.bashrc or ~/.zshrc similar to the following:
1 | |
1 | |
bash, zsh, etc.).
In case you are unsure, you can check with the echo $SHELL command which will most likely output /bin/bash.
Info
Instead of source it is possible to use the . command instead. Don't confuse it though with the current directory, which is also represented as ..
Next, on the robot: Hardware Interfaces, for access to USB, GPIO and I2C.
Resources
Although the catkin tutorial uses catkin_make it provides a helpful guide to create a workspace
Comments
Comments are GitHub Discussions, shown with giscus. Loading them connects to giscus.app (hosted by Vercel, USA) and GitHub (USA); you need a GitHub account to comment.