Robot operating system (ROS) - cactiCode/NTNU-Biped-Robot GitHub Wiki

Introduction

Robot operating system simply known as ROS is an open source-codebase-meta-operative system which is widely used in industry today. It is a collection of different tools and libraries one can use in order to create complex robot movement and behaviour across wide variety of platforms. One of the main purposes of robot operating system is to allow us to simply communicate in between many different interfaces. ROS was built by a team of engineers in order to encourage software development for use on robots. As a result ROS is used in many applications that include complex robot behaviour which would not otherwise be possible to achieve. ROS-Development-BlogPost-01-ARTC+Update

Functionality

System is built in such way that all communication happens through master which is the system core tasked with running and logging commands. Big advantage with this method is that it brings simplicity in the code structure plus it makes it easy to troubleshoot. A specific programming language does not exist, which in tern means that ROS is neutral when it comes to language choice. ROS can read four different programming languages. Those are C++, Python, Octave and LISP. Reason why it is said that ROS is neutral is because it utilizes so called Interface Definition Language as an universal translation tool, used to translate from one language to another.

The main ROS client libraries are geared toward a Linux system, primarily because of their dependence on large collections of open-source software dependencies. For these client libraries Ubuntu distribution of Linux is marked as the best, while other distros such as Fedora are also supported. Operating systems such as macOS and Windows are labeled as "experimental" and are currently under development.

  • Nodes and topics

In order to understand inner workings of robot operating system it is an imperative to understand the concept of nodes and topics. A node is process which performs some computation or a task. Every node has a name that is registered to the master before it can take any other action. Nodes are combined together into a graph and communicate with one another using streaming topics. Reason why nodes are in center of ROS programming is because they are a foundation of every multilayer behavior. These nodes are meant to operate at a fine-grained scale and a robot control system will usually comprise many nodes.

To put it in perspective, one node may control gyroscope, other will control laser rangefinder, third will be tasked of portraying robot movement and position to the operator computer screen etc. Nodes are also making the entire system more robust and flexible. There is an additional crash tolerance as crashes are isolated to a individual node not all of them. Code complexity is widely reduced when nodes are incorporated, more so than trying to program a monolithic system.

Topics or buses as they are also often called, are medium nodes use to send and receive messages. In general, nodes are not aware of who they are communicating with. Instead, nodes that are interested in data subscribe to the relevant topic. There can be multiple publishers and subscribers to a topic and it defines the types of messages that will be sent. The nodes that transmit data publish the topic name and the type of message to be sent.