ROS2 Beginner's Guide: A Deep Dive into the Core Middleware for Robot Development

A beginner-friendly guide to ROS2 — what it is, why it matters, and how to choose the right version.
This guide introduces ROS2 as a middleware SDK for robot development, clarifying that it runs on top of Linux rather than being a traditional OS. It explains the key differences between ROS1 and ROS2, highlights why ROS2's DDS-based decentralized architecture is superior, and offers practical advice on choosing the right stable version for learning and production use.
The Era of Intelligent Robots Has Arrived
From humanoid robots dancing gracefully on the Spring Festival Gala stage, to robotic vacuums quietly tidying our homes, to service robots gliding through hotel corridors delivering meals — intelligent robots are no longer the stuff of science fiction. They've become a genuine part of our everyday lives. As the often-repeated saying goes: "The future is already here."
Since the 1970s and 80s, driven by continuous advances in computing, sensors, and electronics, robotics has entered a golden age of rapid development. More importantly, robots are rapidly expanding beyond traditional industrial manufacturing into a much broader range of domains — home services, medical care, education and entertainment, search and rescue, military applications, and beyond.
This evolution is the result of synchronized progress across sensors, computing power, and algorithms. Early industrial robots relied on precise physical programming and fixed trajectory control. Modern intelligent robots, by contrast, integrate key technologies such as SLAM (Simultaneous Localization and Mapping), computer vision, and deep learning. SLAM enables a robot to move through an unknown environment while simultaneously building a map of its surroundings and determining its own position — this is precisely the core capability that allows robotic vacuums to autonomously plan their cleaning paths. The maturation of these technologies is what gives robots genuine environmental awareness and autonomous decision-making ability, rather than just being "mechanical arms that move."

There's an important conceptual distinction worth clarifying here: traditional industrial robots (like the robotic arms in automobile factories) can efficiently perform repetitive tasks, but they are fundamentally "brainless" — they simply execute pre-programmed instructions one by one. A robot only truly enters the realm of "intelligent robotics" when it gains the ability to perceive, make decisions, and adapt — for example, when a robotic vacuum can independently map its environment, plan a path, and avoid obstacles.
Artificial Intelligence Gives Robots a "Soul"
If hardware provides the body, then software gives the intelligent robot its soul. The explosive growth of artificial intelligence in recent years has opened up entirely new opportunities for robotics.

AIGC technologies — represented by ChatGPT, DeepSeek, and ERNIE Bot — are all branches of artificial intelligence. Their value goes far beyond generating conversation; they can "give robots a brain," enabling robots to understand and execute human intentions far more flexibly. This combination of "robots + AI" is actually driving the real-world implementation of an emerging concept: Embodied AI.
Embodied AI refers to the deep integration of AI's cognitive and reasoning capabilities with a physical entity (the robot's "body"), enabling the robot to perceive, learn, and execute tasks through continuous interaction with the real physical world — rather than relying solely on a pre-programmed rule set. The emergence of large language models has given robots unprecedented natural language understanding and instruction-following capabilities. You can simply tell a robot in plain language, "Put the cup on the table into the kitchen," and it can autonomously break down the task and plan the actions needed. This "robots + AI" combination is widely believed to be poised to spark a profound industrial revolution — much like how mobile internet transformed the way we live.
The gradual transition of robots from mechanically executing instructions step by step, to functioning as intelligent agents with genuine cognitive and judgment capabilities, is precisely the most exciting direction in the robotics industry today.
So What Exactly Is ROS?
On the software side of robotics, one of the hottest technologies is the Robot Operating System (ROS) — and it's the central subject of this tutorial series.
ROS Is Not a Traditional Operating System
Many beginners get confused right here: despite having "Operating System" in its name, ROS is not a traditional operating system.

The classic operating systems we're familiar with include:
- Mobile: Android, iOS, HarmonyOS
- Desktop/PC: Windows, Linux, macOS
These are true operating systems — they manage hardware resources, schedule processes, provide file systems, and handle other low-level foundational services. ROS is more accurately described as an SDK (Software Development Kit) — a collection of software libraries and tools designed specifically for building robot applications, and completely open-source and free to use.
In other words, ROS itself runs on top of a real operating system (typically Linux), playing the role of middleware — providing developers with communication mechanisms, a toolchain, and a standardized development framework that dramatically reduces the complexity of robot software development.
For its underlying communication implementation, ROS2 uses the industrial-grade standard protocol DDS (Data Distribution Service) as its foundation. DDS is a publish-subscribe communication middleware widely used in fields with extremely high requirements for real-time performance and reliability, such as aerospace, defense, and finance. By leveraging DDS, ROS2 achieves true decentralized communication between nodes — no longer relying on a central "Master node" to coordinate all communication as ROS1 did. This significantly improves system robustness and real-time responsiveness. Additionally, DDS provides flexible Quality of Service (QoS) configuration, allowing developers to set different transmission reliability and latency policies for different data types (such as sensor data or control commands), making ROS2 far better suited for industrial-grade and commercial deployment scenarios.
ROS1 vs. ROS2: Why You Should Choose ROS2
After years of development, ROS has evolved into two major version families: ROS1 and ROS2.
ROS1 is currently being gradually replaced by ROS2. This doesn't mean ROS1 is completely abandoned — the industry is simply making a smooth transition toward ROS2. As the next-generation version, ROS2 significantly outperforms ROS1 in architectural design, communication mechanisms (with DDS introduced at the underlying level), real-time performance, and cross-platform support. ROS1's centralized Master architecture can easily become a single point of failure as the number of nodes grows, whereas ROS2's decentralized design fundamentally addresses this vulnerability, making it far more suitable for real production environments.
The trajectory is clear: ROS1 will gradually fade out, while ROS2 is on the rise. For developers, the trend is unmistakable. Choosing to start learning with ROS2 is the forward-looking, practical choice.
Version Selection: Why Compatibility Matters So Much
Many beginners overlook a critical issue — version compatibility. Since its first release, ROS2 has launched new distribution versions almost every year, and each version has a clear end-of-life (EOL) date.

Understanding ROS2's versioning strategy requires understanding its close coupling with Ubuntu operating system versions. ROS2 follows a release strategy synchronized with Ubuntu LTS (Long-Term Support) versions: whenever Ubuntu releases a new LTS version (every two years), the ROS2 community releases a corresponding new distribution, providing approximately five years of long-term maintenance and security update support. This strategy draws on the version management experience of mature open-source ecosystems, ensuring that industrial users and research institutions can continue to receive feature updates and security fixes without frequent version migrations — while still prioritizing system stability. This also explains why different organizations and projects often run different versions of ROS2 — each has chosen the most appropriate stable version within their own system's lifecycle.
Why the emphasis on versions? Because different versions are not directly compatible with each other. If you try to run a project developed for one version in a different version's environment, you'll typically run into a variety of errors. At that point, you have two options: either switch your ROS version, or modify the configuration to make it compatible with your current version. Fortunately, many open-source project docs provide compatibility guides, so always read the documentation carefully when you encounter issues.
Practical Version Selection Advice
- Versions no longer under maintenance (older distributions) are not recommended for learning or production use;
- Actively maintained stable versions are the top choice for both learning and production environments;
- The Rolling development version continuously tracks the latest features but is less stable than official releases — not suitable for beginners.
For those starting from scratch, a stable version is more than sufficient. To ensure consistent, reliable program execution, this tutorial series will use the latest stable distribution throughout, and all example code is written against that version.
Summary
In this lesson, we clarified three core concepts: the intelligent robot era is profoundly transforming industries across the board, ROS's essential role as an SDK (middleware) for robot development, and the key principles for choosing the right ROS2 version. These form the foundation for all the hands-on development work that follows.
Now that you understand what ROS really is, why you should learn ROS2, and how to choose the right version, the next step is setting up your development environment and officially embarking on your ROS2 robotics development journey.
Key Takeaways
Related articles

Dual-Layer Knowledge Graphs: How AI Safeguards Continuity in 500,000-Word Novels
CanonPulse AI uses dual-layer knowledge graphs to detect plot holes across 500,000-word novels while protecting intentional twists, solving narrative debt for serial fiction creators.

Dual-Layer Knowledge Graphs: How AI Safeguards Continuity in 500,000-Word Novels
CanonPulse AI uses a dual-layer knowledge graph to detect plot holes across 500K+ word novels while protecting intentional twists — shifting AI writing tools from generation to consistency maintenance.

The Era of AI Capability Overhang: Why You Need to Reset Your Ambition Every 3 Months
Understanding Capability Overhang in the AI era: when model capabilities far exceed application imagination, how teams should reset feasibility boundaries quarterly to avoid ceding advantages to competitors.