Skip to Main Content

ROS (Robotic Operating System) Basics

ROS Concepts

The following material introduces the main basic concepts of any ROS system. 

Packages

A package is the top-level module that includes the scripts, tools, processes and all the files required to run a component of a ROS system. In simpler terms you can think of a package as a special folder or directory.

Nodes

Nodes are the processes responsible for performing computations for every component of the robot. Components such as sensors, motor drivers, algorithms and visualization tools will have a dedicated running node. The overall performance of a robot is dependent on the proper communication of its nodes.

Topics

Nodes can subscribe and publish to topics. You can think of nodes as functions and topics as arguments/return values. A very basic example is a robotic car with multiple nodes, one responsible for its distance sensor, one for its navigation algorithm, and a node for its motor driver. The distance sensor node can publish its information to a topic called obstacle_detection. The navigation algorithm can subscribe to this topic and use its data, along with other component topics, to compute its navigation plan. The navigation algorithm will publish to a topic called robot_movement. The motor driver node can then subscribe to this topic and establish whether the robot’s motors can move forward or not.

Master

A master needs to be active to facilitate the communication between nodes and topics. A master takes place as a “server” running on a terminal window in your machine. Without the master it would be impossible for all nodes to find each other.

Libraries

ROS includes three main client libraries that are designed for different applications and developers. Libraries can ease the process of writing nodes in ROS. The main libraries that will be used in most projects are roscpp and rospy which are C++ and Python client libraries. The third library is called roslisp and it is a LISP client library utilized for developing other libraries.

Distributions

ROS distributions are essentially versions of ROS. Distributions allow for compatibility with newer hardware/software, however, using the latest ROS distribution can have its negatives as it might not be compatible with older robots. ROS typically releases new distributions according to Ubuntu releases. The following table shows recent ROS distributions and their corresponding Ubuntu release, Melodic and Noetic are installed in the makerspace.

Distribution

Ubuntu Compatibility

ROS Noetic

Ubuntu 20.04

ROS Melodic

Ubuntu 18.04

ROS Kinetic

Ubuntu 16.04