O que é um sistema operacional de robô (ROS)?

What is a Robot Operating System (ROS)?

Typically, when we talk about robotics, the first thing that comes to mind are robotic manipulators equipped with end effectors, driven by actuators, guided by sensors and controlled by microcontrollers. Mechanical hardware always impresses viewers, but it's the underlying robotic software that brings these magnificent machines to life. Most small robots are programmed from scratch, which can be tedious when a robotic application is large or multifaceted. In software development, large software applications are managed with the help of a software development kit. Likewise, extensive robotics software development requires a framework – the Robot Operating System (ROS) is an open source initiative that provides this framework.

ROS Turtle Bot

Despite its name, ROS is not an operating system. It is a software framework for developing robotic software that includes a set of different tools and libraries useful in developing robotic applications. Since its inception, ROS has been tuned to work on Ubuntu Linux. Most development tools, drivers, libraries, and algorithms were designed to operate on Unix-like systems. Still, many ROS libraries and developer tools can be used on Mac OSX and Microsoft Windows. Ubuntu has been a natural choice for ROS because the framework relies primarily on open source dependencies.

In this article, we will define the Robot Operating System (ROS), how it works, and why it is useful.

What is ROS?
The RO software development framework is an open source project started in 2007 at Stanford University under the title “Switchyard”. In 2008, the project was carried out by a start-up, Willow Garage. In 2013, Willow Garage formed the Open Source Robotic Foundation (OSRF) and made ROS an open source project.

Robotics involves control theory, computer vision, machine learning, embedded electronics and artificial intelligence. Robot applications are complex software that involve multiple disciplines. ROS organizes a robotic application into packages and provides a hardware abstraction layer that allows you to develop robotic software independently of the underlying hardware. The framework also provides a message passing middleware where robotic data can be communicated between different processes and even other machines. Being a flexible structure, ROS can program any robotic functionality. The most significant advantage of ROS is that ROS applications with all possible robotic functionalities can be executed on any robot, regardless of its hardware components.

Why ROS?
There was a huge void for a generic robotics software framework. ROS filled this gap and introduced a modular, platform-independent approach to developing robotic applications. Because it is free and open source, anyone can use, modify, debug, and contribute to ROS. It can also be used in any industrial application without any license fees. Many universities are actively involved in robotics research involving ROS. As a community-driven project, ROS is continually growing and evolving, and community support ensures that ROS is bug-free, robust, and inclusive of all emerging features and functionality.

The framework supports popular programming languages ​​including C, Python, Java, and Lisp. It already has an interface to several third-party libraries, including Open-CV, Open-NI, OpenRAVE and PCL. ROS packages operate on a hardware abstraction layer, so platform-independent ROS and its packages can be used for any hardware. Because it is very flexible, developers can customize it and choose which components of the ROS framework to incorporate into a robotic project and which libraries they want to interface with.

ROS allows engineers to quickly create, test, and deploy agnostic robotic software that can be reused on any other robot. ROS is integrated with open source simulators like Gazebo and other proprietary simulators including V-REP. ROS code can be easily tested using a built-in framework called “rostest”. The application code remains modular, well-organized, reusable, scalable, and hardware independent.

How ROS works
A ROS application is organized into metapackages – a collection of packages for specific functionality. For example, a mobile robot may have a navigation system for manipulating metapackets. Packages are the building blocks of any ROS software and consist of nodes/processes associated with datasets and configuration files. A node is simply a process that uses the ROS API to communicate within the robotic system and is created with the help of client libraries. Robotic software in ROS is a collection of nodes where each node is responsible for a specific function. For example, one node may be responsible for navigation, another may be responsible for collecting sensor data, and another may be responsible for hardware interfacing.

A ROS application, therefore, can be considered a collection of nodes. These nodes must communicate with each other and exchange data or provide services for robotic functioning. There is an intermediate node called ROS Master that connects all the nodes and establishes data communication between them. The variables used in data communication are stored in a parameter server coupled to the ROS master. Each variable has a scope and can be accessible by one or more nodes.

ROS file system

Data is communicated between nodes in the form of ROS messages. There are two ways to communicate messages between nodes: topics and services. Topics are a publish and subscribe method of transmitting data between nodes and are named buses to which nodes can register as publishers or subscribers. When a node publishes a ROS message about a topic, it is sent to the ROS master. Nodes registered as subscribers to the same topic receive the publisher URI from the ROS master and thus receive the publisher's message as soon as it is published. Once the nodes are connected point-to-point, the ROS master has no further role to play. Nodes can communicate point-to-point ROS messages between each other without passing through the ROS master. This is somewhat similar to the MQTT protocol, except that messages are always passed between nodes through the intermediary in MQTT. Here, the role of the ROS master is fulfilled as it connects all the nodes point to point.

Services are a request-response method for communicating ROS messages between nodes. A node requests data from another node. The other node acts as a service provider running a service routine. When it receives a request from another node, it executes the service routine and transfers the results via ROS messages. ROS messages on a node are stored in message files with the .msg extension. Service definitions on a node are stored in service files with the .srv extension. There is a manifest file called package.xml inside the application that stores all the information about the application name, version, author, required packages and dependencies.

ROS computational graph

ROS includes utilities called “Bags” that record and replay ROS messages and are useful in simulating and inspecting robotic data.

ROS Distributions
ROS distributions are a versioned collection of ROS packages. They are similar to Linux distributions. Each distribution consists of a few core packages whose stable versions are maintained until the end of the distribution's life. ROS distributions are built with compatibility with Ubuntu Linux. Versioning of ROS distributions is also done simultaneously with Ubuntu Linux releases because ROS distributions have mostly open source dependencies that work and depend on Linux. Here you can find documentation for some of the active ROS1 and ROS2 distributions.

It should be noted that ROS Noeitc Ninjemys is the final version of ROS1. Future versions of ROS distributions will be based on ROS2. If you are not looking for new features or significant updates, you can use the previous long-term support (LTS) distribution, which at this time is ROS Melodic Morenia. If you are looking for new features and are also comfortable with major updates, use the latest LTS i.e. ROS Noeitc Ninjemys.

Client Libraries
ROS client libraries are used to write ROS nodes. With the help of client libraries, you don't need to write code from scratch; instead, you need to define service callbacks and implement publish-subscribe for the node. Client libraries are available by programming language: roscpp is the client library for writing nodes in C++; rospy is the client library for writing nodes in Python; and roslisp is the client library for writing nodes in LISP.

ROS Tools
ROS distributions include several valuable tools for solving common development problems and automating complex tasks such as simulation and robotic data visualization. Tools can be GUI or command line tools. They are included in the packages. Some of the popular ROS tools involve the following.

RVIZ: This is a 3D viewer useful in creating visual graphs of 2D and 3D values ​​accessed from robotic data. Helps visualize robot models, image data, point clouds, and sensor data.

rosbag and rqt_bag: This is a command-line tool for recording and playing back ROS messages. It is useful in debugging applications and works as a command-line console. Another tool, rqt_bag, provides a graphical interface to rosbag.

rqt_plot: This tool is useful for plotting live scalar values ​​published in ROS topics.

graphic_rqt: This tool helps you visualize nodes/processes running in ROS and the interconnections between them.

Webviz: This is a valuable web-based tool for viewing ROS data and ROS bag files.

Estúdio Dedaleira : Available as a web and desktop application, this is an integrated development environment (IDE) for viewing and debugging ROS data.

ROS Mobile: This Android application is useful for dynamic control and visualization of ROS-based mobile robots.

Command-line tools: Various command-line tools are available, from installing ROS to running and debugging ROS. The rosmake, rosinstall, roslocate, rosdep, rospack/roscd, and rosstack/roscd tools are used during ROS installation. The roslauch, rosrun, and roscore tools are used to run ROS. Therosopic, rosservice, rosnode, rosparam, rosmsg, rossrv, and roswtf tools are used to interact with and debug ROS.

ROS Simulator
ROS is integrated into the open source robotics simulator Gazebo. Gazebo, which can be integrated with ROS via a plugin, is capable of simulating a variety of robot models and includes support for a large number of sensors. Proprietary simulators like Webots and V-REP also support ROS. However, you need to pay a license fee to use them. If you don't want to pay for robotic simulation, Gazebo is enough to maintain ROS compatibility.

We ROS
Nodes are the building blocks of the ROS application. The application is divided into packages. For example, a mobile robot application can be divided into three packages: camera, navigation, and hardware control. Each bundle can contain one or more nodes, although each bundle typically contains only one node. The camera package may include nodes such as camera driver and image processing. It is possible to keep image processing in a different package. The navigation package may consist of nodes for motion planning and trajectory correction. The hardware control package may include nodes for the main control circuit, robot state publishing, and hardware drivers. Nodes interact with each other through topics and services, communicating data necessary for robotic functions. For example, nodes for motion planning and path correction will exchange data with the main control loop node in the hardware control package to enable robot navigation. Some standard functionalities in robotics include navigation, perception, mapping and localization, data logging, visualization, and hardware control.

ROS Hardware
There is broad hardware support for ROS. Many sensors, including 1D rangefinder, 2D rangefinder, 3D sensors, cameras, motion capture, force/torque, RFID, input/output, speed, touch, pose estimation, and environmental sensors, are supported by ROS. You can find a full list of ROS supported sensors here. A list of supported engine drivers is available at this link. If you want to learn more about some featured robots running on ROS, click here.

ROS versions
Currently, there are two main active versions of ROS – ROS1 and ROS2. The ROS Noeitc Ninjemys was the final version of the ROS1. A new version of ROS2 is released every six months and is supported for one year. You can browse the latest ROS distributions here. Note that ROS distributions are installed on Ubuntu Linux or other supported operating systems using command-line tools.

Introduction to ROS
You can get started with ROS on any Linux, Windows or Mac computer. Many robotic applications can be written and tested with the help of the ROS simulator. For real-life implementation, you will need specific hardware components for the automated application. For example, you may need Arduino, motors, motor drivers, and sensors to build a mobile robot, or you may need a camera module for face detection or other features.

Conteúdo Relacionado

A network of sensors is embedded in every vehicle,...
The motor controller is one of the most important...
ESP32-CAM is a compact camera module that combines the...
A evolução dos padrões USB foi fundamental para moldar...
A SCHURTER anuncia um aprimoramento para sua conhecida série...
A Sealevel Systems anuncia o lançamento da Interface Serial...
A STMicroelectronics introduziu Diodos retificadores Schottky de trincheira de...
Determinar uma localização precisa é necessário em várias indústrias...
O novo VIPerGaN50 da STMicroelectronics simplifica a construção de...
A Samsung Electronics, fornecedora de tecnologia de memória avançada,...
O mercado embarcado tem uma necessidade de soluções de...
You have probably come across the term ' drag...
You probably have a support insulator if you've noticed...
You've probably seen stand an insulator sit on power...
You've probably seen shackle insulators enthroned on electricity poles,...
You have probably experienced situations where controlling a circuit...
Back to blog

Leave a comment

Please note, comments need to be approved before they are published.