Basic concepts and system architecture of ROS Installation and simple testing of ROS

Publisher:QingfangLatest update time:2023-11-15 Source: 车路漫漫Author: Lemontree Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Author: Li Manman

Source: WeChat public account [The road is long]

Preface: I always think it is very mysterious. What is it? Just the name alone makes me hesitate. But ROS is inextricably linked to , as a data bridge between simulation software and intelligent driving, ROS is unavoidable, so I still have to bite the bullet and take a look. Then I will explain it to you in plain language, and it would be best if I could give you two small examples, which would be a great merit.

This article will help you understand the core concepts of ROS and lay a solid foundation for the subsequent study of "using the ROS framework to integrate controlled algorithms into the autonomous driving simulation platform."

1. Introduction to ROS

ROS (Robot Operating System) is an open source framework that connects loose components and provides an architecture for them. Although ROS is called an operating system, it must be installed on an operating system such as this one to run. Its function is only to connect the real operating system (such as Linux) and the ROS application developed by the user (such as the perception, planning, decision-making and other modules of autonomous driving), so it can also be regarded as a middleware, building a communication bridge between ROS-based applications.

So, to put it simply, ROS is a distributed communication framework that helps program processes communicate more conveniently.

In order to understand the application of ROS more vividly, here is a very good one found from other platforms for everyone to learn.

2. Core concepts of ROS

Before formally learning ROS, let's first introduce several features of ROS, namely the meta-operating system, distributed communication mechanism, loosely coupled software framework, rich open source function library, etc., to help everyone establish some intuitive understanding.

ROS is a meta-operating system in the field of robotics. In other words, it is not a real operating system, and its underlying task scheduling, compilation, device drivers, etc. are still completed by its native operating system Ubuntu/Linux.

ROS is actually a sub-operating system, or software framework, running on Ubuntu/Linux, but it provides operating system-like functions such as hardware abstraction, function call, and process management. It also provides functions and tools for acquisition, compilation, and cross-platform.

The core idea of ​​ROS is to make the software functions of the robot into nodes, and the nodes communicate by sending messages to each other. These nodes can be deployed on the same host, on different hosts, or even on the Internet. The master node in the ROS mechanism is responsible for managing and scheduling the communication process between each node, and also provides a service for configuring the global network.

ROS is a loosely coupled software framework that uses a distributed communication mechanism to achieve process communication between nodes. The software code of ROS is organized in a loosely coupled manner, with a flexible development process and easy management and maintenance.

3. From ROS1 to

In 2007, a robot company called Willow Garage released ROS. ROS combines many advantages such as open source, free, high reuse, low coupling, and rich tools. Once launched, it quickly attracted a large number of researchers and suppliers to join, forming a stable and diverse robot ecology. ROS has naturally become the mainstream software framework in the field of robotics and is still popular today.

In the more than ten years since the birth of ROS, robot-related software, hardware and ROS community have undergone tremendous changes. In addition, the original ROS has some inherent design defects. Under the superposition of various internal and external factors, the old ROS has become incapable of meeting the requirements in many application scenarios. In this context, the official launched a new generation of robot operating system in 2017 - ROS2 (different from the old ROS, i.e. ROS1). ROS2 is based on a new design framework, retaining the advantages of ROS1 and improving its defects to adapt to the new needs of the new era.

ROS2 is a new generation of robot operating system, not just ROS1 with enhanced functions.

So, let's just learn ROS2 directly.

4. ROS Release

ROS was originally developed based on the Ubuntu system. The release version names of ROS also follow the same rules as Ubuntu, that is, the version name consists of two English words with the same first letter, and the first letter of the version is selected in ascending alphabetical order. The following list is a brief description of the different release versions of ROS2.

Distributions release date Maintenance end date
Iron Irwini May 23, 2023 November 2024
Iron Irwini May 23, 2023 November 2024
Humble Hawksbill May 23, 2022 May 2027
Galtic Geochelone May 23, 2021 November 2022
Foxy Fitzroy June 5, 2020 May 2023
Eloquent Elus November 22, 2019 November 2020
Dashing Diademata May 31, 2019 May 2021
Crystal Clemmys December 14, 2018 December 2019
Bouncy Bolson July 2, 2018 July 2019
Ardent Apalone December 8, 2017 December 2018

5. How to learn ROS

In order to learn and use ROS well, you need to do a lot of practical operations. Therefore, after quickly understanding the core concepts and paradigms of ROS, you need to combine a lot of practical projects to deeply understand ROS. The main learning resources of ROS are as follows:

Official website: www.ros.org

Source code: github.com

Wiki: wiki.ros.org

: answe.ros.org

6. ROS system architecture

Since the architecture of ROS is relatively complex, in order to make it easier to understand the various concepts encountered later, we will first discuss the system architecture of ROS so that everyone can have a comprehensive grasp of the various concepts in ROS. According to the official statement, the ROS architecture can be understood from the perspectives of computational graph , file system and open source community .

6.1. Understanding ROS architecture from the perspective of computational graphs

The basic unit of executable programs in ROS is called a node. Nodes communicate with each other through a message mechanism, thus forming a network graph, also called a computational graph, as shown in the figure below.

A node is an executable program, also commonly called a process.

Each executable program created in the ROS function package is a ROS node after being started and loaded into the system process, such as node 1, node 2, node 3, etc. in the figure above.

Nodes communicate by sending and receiving messages. The message sending and receiving mechanisms are divided into three types: topic (toc), service (serve), and action (action). For example, in Figure 1-3, nodes 2 and 3, and nodes 2 and 5 use topic communication, nodes 2 and 4 use service communication, and nodes 1 and 2 use action communication. Nodes, topics, services, and actions in the computational graph must have unique names as identifiers.

ROS uses nodes to decouple code and functions, improving the fault tolerance and maintainability of the system. Therefore, it is better to make each node have a specific single function rather than creating a large node that covers everything. If you use the programming node, you need to use the roscpp library provided by ROS; if you use the programming node, you need to use the rospy library provided by ROS.

The master node is responsible for the scheduling and management of the communication process between each node. Therefore, the master node must be started first, and can be started through the roscore command.

Messages are the key to forming a computational graph, and include two parts: message mechanism and message type. There are three types of message mechanisms: topic, service, and action. The data transmitted in each message mechanism has a specific data type (i.e., message type). Message types can be divided into topic message type, service message type, and action message type.

A data packet (rosbag) is a file in ROS that is specifically used to save and replay data in a topic. Some data that is difficult to collect can be recorded using a data packet, and then replayed repeatedly to debug the algorithm performance.

The parameter server can provide easy-to-modify parameters for nodes in the entire ROS network. Parameters can be considered as global variables in the node that can be modified externally. There are static parameters and dynamic parameters. Static parameters are generally used to set the node working mode when the node starts; dynamic parameters can be used to dynamically configure the node or change the node working state when the node is running, such as PID control parameters in the node.

6.2. Understanding ROS architecture from the perspective of the file system

Different components of a ROS program should be placed in different folders. These folders organize files according to different functions. This is the file system structure of ROS, as shown in the figure below.

A workspace is a folder that contains function packages, compiled packages, and compiled executable files. Users can create multiple workspaces according to their needs and develop function packages for different purposes in each workspace. In the figure above, we created a workspace named catkin_ws, which contains three folders: src, build, and devel.

The src folder contains each function package and the CMake configuration file CMakeLists.txt that configures the function package. Here, since the source code in ROS is compiled using the catkin tool, and the catkin tool is based on CMake technology, we will see a CMake configuration file CMakeLists.txt in the src source file space and each function package. This file plays the role of configuration compilation.

[1] [2] [3]
Reference address:Basic concepts and system architecture of ROS Installation and simple testing of ROS

Previous article:Pangu is here! China's first bridge-type explosion-proof heavy-load handling robot rolls off the production line
Next article:Transmission efficiency test of precision reducer for industrial robot

Latest robot Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号