ROS2 (Robot Operating System 2) is an open-source collaborative framework for robotics software development that provides a data distribution service (DDS) enabling secure, decentralized communication between software components called Nodes. ROS2 supports three primary communication patterns: Publisher-Subscriber for real-time data sharing over Topics, Services for request-response interactions, and Actions for long-running goals with feedback and results. Additional features include configurable parameters for runtime adjustments, Bag files for recording and replaying sensor data, package-based code organization for distribution, and cross-platform compatibility supporting multiple operating systems including integration with ROS1 systems.
ROS2 Robotics Framework Overview: Key Features and Communication Methods
Added:The Robot Operating System framework, aka ROS was created back in 2007 as a means to create a collaborative, open source robotics framework for software developers.
As time went on, industries which began to adopt robotic systems grew tremendously.
Besides just manufacturing, other high-level robotic systems grew an application spaces such as mobile outdoor robotics, drone swarms, and even self-driving cars.
Thus, ROS2 was created as a new and improved version which could scale in these newly founded applications.
This put an emphasis on decentralized communication configurations, as well as being able to apply security settings to your robot data.
So Let's take a look at what ROS2 has to offer.
Let's look at an example robot to use as a reference.
This is a simple mobile robot.
This robot has four wheels.
One motor controls both wheels on the left side of the robot, and another motor controls both wheels on the right side of the robot.
This robot also has a vertically mounted camera which has a motorized base so the camera can turn.
There are also sensors on board to give us information about our robots position.
Here the robot has a GPS sensor and here is an IMU sensor which gives the robots orientation and acceleration data.
So what features does ROS to have to help us program the test robot I have here?
Well, the first feature is a data distribution service, also known as DSS, which is a communication pipeline which can interface with all of our code that is executed.
Code files which utilize ROS functionality are called Nodes.
Here I have two Python scripts which utilize the ROS DDS to send information between them.
The DDS communication pipeline also allows for security configurations so that you can secure the data use send between the Nodes.
Nodes have three primary ways which they can communicate with each other.
The first is through a Publisher Subscriber method.
Let's say we have two Nodes for our robot.
This arrow represents the data flow direction for our ROS DDS communications.
The camera Python Node wants to make available images from our robots camera, so it publishes these images to anyone who wants to listen in or Subscribe to this particular data.
These individual communication pipelines are referred to as Topics.
In this case, we can have a Topic name of 'front camera'.
This note publishes information which is referred to as a message. In this case, the message type is an image.
This architecture is very scalable, such that one Publisher can send messages to multiple Subscribers.
A way to think of this is the way common video streaming websites are organized such that Subscribers are sent new videos when they are published and the channel name is like a ROS Topic name.
Another way to communicate between Nodes is through Services.
For this example, we have a survey Node, which is a service client that sends a request to turn the robot camera 45 degrees.
This request is received by the camera mover Node, which is a service server which after completing the request, we'll send back a response.
In this example, our response is an image the camera took after turning the camera to the desired angle.
The third way for those to communicate with each other are through Actions.
In this example, we have a Node which wants to command our robot to travel to a certain latitude and longitude coordinate to take a picture.
The action server will then process the goal and send progress updates the client.
In this case, we will send back data on how far away the robot is from the goal.
These process updates are referred to as feedback.
Our action server will continue sending feedback to the client until the goal is reached.
In this example, once the goal is reached, our action server will send a picture which the robot took at the goal location.
This is called the result of the Action ROS note also have a parameter feature.
Here we have our mobile robot, but Let's say we had another version of it where the wheel size is increased.
We may need to take this change into account in our code.
Rather than having to edit the code and recompile our project, we can instead utilize a note parameter which allows for configurations for specific variable values within our note.
This parameter can be modified by a user or other Nodes when needed. In this case, we could set a note parameter called wheel radius for our code to reference.
There are going to be times where you want to collect data from your robot in which you will probably want to create a bag file.
A bag file can Subscribe to multiple Topics and record the data as it comes in.
After you are done recording this data, you can play it back and have those recorded messages get published over the same corresponding Topic names.
It is worth noting that ROS code is organized as packages.
These packages will contain all the code for a particular robot functionality.
These packages can then be copied and distribute it to other developers who want to use it.
Then they can use that same set of code for use on their own robot.
Lastly, one of the most notable features of ROS2 for robotic software development is cross platform support.
Unlike most distributions of its predecessor, ROS two allows for other operating systems other than Linux to run ROS and be able to communicate with each other.
ROS also allows for integration with systems developed in ROS 1.
That way you can confidently start utilizing ROS2 without worrying about compatibility with previous projects he developed in ROS 1.
Now, that was a lot to take in.
So Let's review. ROS2 utilizes a data distribution service which has various security configurations to allow communications between our Nodes.
Nodes are executed code which utilize the ROS framework and can be configured via parameters.
One of the ways which Nodes communicate with each other is through a Publisher and Subscriber Architecture, which Nodes publish data over Topics for Subscribers to process.
Nodes can also communicate via Services which one Node sends a request for another Node to process and send a response.
Lastly, not we communicate via Actions in which one Node sends a goal for a second Node to achieve.
The second Node will publish feedback until the goal is reached, and then we'll send a result back.
Bag Files are used to save data being published by the robot, which can later be played back over the same Topics to simulate the data as it was experienced by our robot.
Our code we develop for ROS can be organized into packages which can be easily distributed for other developers to use.
And Lastly, ROS2 incorporates cross-platform support so we can use its features on various operating systems.
Hope you liked the video.
Be sure to Like, Subscribe, and check out my Udemy courses.
Link in the description below.
Up Next

Python for Robotics: ROS Tutorial Day 2
@TheConstruct
27.8K views•2020-03-24

RatSLAM: Biologically Inspired Robot Mapping and Navigation
@milfordrobotics
20.9K views•2012-08-03

How to Build a Self-Balancing Robot: Arduino Nano & MPU6050
@easytechzones
16.8K views•2022-03-09

Introduction to Robotics | Stanford CS223A Lecture 1
@stanford
744.4K views•2008-07-22
Related Study Plans & Knowledge Roadmaps
Structured learning paths in Robotics
![ROS2 Tutorial - ROS2 Humble 2H50 [Crash Course]](https://i.ytimg.com/vi_webp/Gg25GfA456o/maxresdefault.webp)


![[ITA] DAFN 2023 - Robotics lecture 2 - ROS 2: Workflow and basic communication](https://i.ytimg.com/vi/B0SsZyaLRxU/maxresdefault.jpg)





![[7분 클라우드] 리눅스가 뭐야? - 리눅스와 CLI 알아보기](https://i.ytimg.com/vi/6D8jn_8WJzs/maxresdefault.jpg)




















![[ROS2 Q&A] 235 - How to use webots with ROS2](https://i.ytimg.com/vi/ZJ-YlVE3CBw/maxresdefault.jpg)



![Different examples in Webots with ROS2 | Webots ROS2 tutorial series | [Tutorial 2]](https://i.ytimg.com/vi/MOEkD8iWchw/sddefault.jpg)



