ROS2 Introduction
ROS2 is the predecessor of ROS, namely Robot Operating System. But ROS itself is not an operating system, but a software library and tool set. The appearance of Ros solved the communication problem of each component of the robot. Later, more and more robot algorithms were integrated into ROS. ROS2 inherited ROS, which is more powerful and excellent than ROS.
1 Design objectives and characteristics of ROS2
ROS 2 has the historical mission of changing the era of intelligent robots. At the beginning of the design, it was considered to meet the needs of various robot applications.
- Multi robot system: In the future, robots will not be independent individuals, and communication and cooperation between robots are also required. ROS2 provides a standard method and communication mechanism for the application of multi robot systems.
- Cross platform: The control platforms used by robots vary greatly with different application scenarios. In order to enable all robots to run ROS 2, ROS 2 can run on Linux, Windows, Mac OS, and RTOS across platforms.
- Real time: The robot motion control and many behavior strategies require the robot to have real-time performance. For example, the robot must reliably find pedestrians in front within 100 ms, or stably complete kinematics and dynamics solutions within a period of 1 ms. ROS 2 provides a basic guarantee for such real-time requirements.
- Productization: A large number of robots have come into our lives, and there will be more and more robots in the future. ROS 2 can not only be used in the robot research and development stage, but also be directly carried in the product to enter the consumer market, which poses a great challenge to the stability and robustness of ROS 2.
- Project Management: Robot development is a complex system engineering. The full process project management tools and mechanisms of design, development, debugging, testing and deployment will also be reflected in ROS 2, which is more convenient for us to develop a robot.
2 ROS vs ROS2
ROS has designed a set of communication mechanisms (topics, services, parameters, actions) to simplify robot development. Through this mechanism, the various components of the robot can be connected. This mechanism designs a node called Ros Master, through which all other components must communicate. Once the master node fails, the communication of the entire robot system will collapse! Therefore, the instability of Ros can not be used to make some high-risk robots like autopilot. In addition, there are the following disadvantages:
*TCP based communication has poor real-time performance and high system overhead
- Not friendly to python 3 support
- Incompatible message mechanism
- No encryption mechanism, low security
ROS2 first removes the master node in ROS. After removing the master node, each node can be found through the nodes of the DDS. All nodes are equal and can communicate with each other one-to-one, one-to-many, and many to many. After using DDS for communication, the reliability and stability have been enhanced.