October 24, 2026
the-robot-operating-system-2-powering-the-next-generation-of-intelligent-machines

The dream of sophisticated, autonomous robots capable of complex interactions with their environment and humans has long captivated engineers and enthusiasts alike. However, for decades, the journey from concept to reality was often hampered by a fundamental challenge: the lack of a standardized, efficient communication framework for robotic components. Until the late 2000s, roboticists frequently found themselves "reinventing the wheel," dedicating valuable time and resources to developing bespoke messaging schemes for each new robot project. This iterative and inefficient approach consumed more effort in foundational software architecture than in actual robot functionality, significantly slowing innovation.

Hands On with ROS 2: Nodes, Topics, and Services

The Genesis of a Robotics Revolution

The turning point arrived in 2006, when two visionary Ph.D. students at Stanford’s Salisbury Robotics Lab, Eric Berger and Keenan Wyrobek, embarked on a mission to address this pervasive issue. Their solution was the creation of the Robot Operating System (ROS), an ambitious project aimed at standardizing communication among diverse robot components. Their groundbreaking work quickly caught the attention of Scott Hassan, the founder of the influential Willow Garage incubator. Recognizing the transformative potential of ROS, Hassan extended an invitation to Berger and Wyrobek to further develop their framework within Willow Garage’s innovative program.

Hands On with ROS 2: Nodes, Topics, and Services

Over the subsequent three years, the team at Willow Garage meticulously refined ROS, transforming it into the foundational software framework for their ambitious PR2 robot. The PR2, a successor to Stanford’s earlier PR1, became a significant research platform, demonstrating advanced capabilities in navigating human environments and interacting with objects. Its development and the concurrent maturation of ROS marked a pivotal moment, establishing a robust, open-source middleware that would democratize robotics development and accelerate research globally. Willow Garage’s commitment to open-source principles not only fostered a vibrant community but also ensured that ROS, initially a research tool, would evolve into an industrial standard.

Understanding ROS: More Than Just an Operating System

Hands On with ROS 2: Nodes, Topics, and Services

Despite its name, ROS is not a traditional "operating system" akin to Windows, macOS, or Linux. It does not directly control hardware or possess a kernel for managing processes and memory allocation. Instead, ROS functions as an open-source robotics middleware framework, built atop a conventional operating system (predominantly Linux). Its primary role is to facilitate inter-process communication in a multiprocessing environment, offering a rich collection of computational libraries. These libraries address common robotics challenges, such as the Transform Library 2 (TF2) for managing complex coordinate frame transformations, a critical aspect of robotic spatial awareness.

The architectural design of ROS, particularly its reliance on a full operating system and multiprocessing capabilities, means it is not ideally suited for simple, single-purpose robots like basic vacuum cleaners or maze solvers. Its true value emerges in scenarios demanding scalability and complexity: when multiple sophisticated components must operate cohesively and communicate seamlessly. In such environments, ROS dramatically reduces development time and mitigates the frustrations associated with custom communication protocols, potentially saving hundreds of hours of engineering effort.

Hands On with ROS 2: Nodes, Topics, and Services

The Evolution to ROS 2: Addressing Modern Robotics Demands

The first iteration of ROS, while revolutionary, encountered certain technical limitations, particularly in its underlying messaging layers. These challenges became more pronounced as robotics applications demanded greater real-time performance, support for embedded systems, enhanced security, and robust distributed deployments. Recognizing these evolving needs, the ROS team initiated the development of ROS 2 in 2014. This second generation was designed from the ground up to overcome the limitations of its predecessor, offering improved real-time control, better support for multi-robot systems, enhanced security features, and native integration with modern communication standards.

Hands On with ROS 2: Nodes, Topics, and Services

The transition from ROS 1 to ROS 2 reached a significant milestone with ROS 1 achieving its end-of-life (EOL) status on May 31, 2025. This signifies that ROS 1 will no longer receive official updates or support, firmly establishing ROS 2 as the de facto standard for contemporary robotics development.

ROS 2 follows a similar release model to Linux distributions, with a new distribution — a versioned set of ROS packages — released approximately once a year. Each release is given a whimsical, alliterative name featuring a turtle, progressing through the alphabet. For instance, the latest release, Kilted Kaiju, debuted in May 2025. However, for many long-term projects and stability, developers often gravitate towards Long Term Support (LTS) releases. Jazzy Jalisco, for example, offers LTS until 2029, making it a reliable choice for ongoing development and the focus of many introductory tutorials. Each ROS distribution is meticulously pinned to specific versions of operating systems (e.g., Jazzy Jalisco officially supports Ubuntu 24.04 and Windows 10 with Visual Studio 2019) to ensure full compatibility and proper functioning of its myriad underlying libraries.

Hands On with ROS 2: Nodes, Topics, and Services

Core Communication Paradigms in ROS 2

At the heart of ROS 2’s architecture are its fundamental communication primitives, designed to enable modular and distributed robotic applications:

Hands On with ROS 2: Nodes, Topics, and Services
  1. Nodes: In ROS 2, applications are logically segmented into independent executable processes known as nodes. Each node is responsible for a specific task, such as reading sensor data, executing complex algorithms, or controlling motors. The independence of nodes offers significant advantages: enhanced fault tolerance (a crash in one node doesn’t necessarily bring down the entire system), parallel execution, and language independence, allowing developers to choose the most suitable programming language for each component. ROS 2 supports Python (via rclpy) and C++ (via rclcpp) natively, with community-supported client libraries for Ada, C, Java, .NET, Node.js, Rust, and Flutter.

  2. Topics (Publish/Subscribe): This communication method employs a broadcast-style messaging model. A publisher node transmits data to a named topic, and the underlying ROS system efficiently delivers this message to all subscriber nodes listening on that specific topic. This one-to-many, asynchronous communication is ideal for streaming data, such as real-time sensor readings (e.g., lidar scans, camera feeds), odometry data, or status updates. ROS 2 introduces Quality of Service (QoS) policies, allowing developers to define parameters like message reliability (guaranteed delivery or best effort), durability (whether messages persist for late-joining subscribers), and liveliness (how long a publisher is considered active), providing fine-grained control over data flow in diverse network conditions.

    Hands On with ROS 2: Nodes, Topics, and Services
  3. Services (Client/Server): When a node needs to request a specific action or piece of information from another node and await a direct response, the client/server model of services is employed. A server node continuously waits for incoming requests, while a client node sends a request to a particular server and blocks until a response is received. This synchronous, request-response pattern is perfect for triggering actions (e.g., "move robot forward by X distance"), setting parameters (e.g., "set camera exposure to Y"), or obtaining one-time data queries (e.g., "get current robot pose"). The interface for services is rigorously defined, ensuring data consistency between client requests and server responses.

  4. Actions (Goal/Feedback/Result): While not explicitly detailed in the tutorial’s code examples, Actions are a crucial communication primitive in ROS 2 for handling long-running, preemptable tasks. An action client sends a goal to an action server, which then processes the goal while providing continuous feedback to the client. Upon completion, a final result is returned. This mechanism is invaluable for tasks like navigating to a target location (where intermediate progress is useful), performing complex manipulation sequences, or executing long-duration sensory processing. Actions combine aspects of both topics (for feedback) and services (for goal and result), making them highly versatile for sophisticated robot behaviors.

    Hands On with ROS 2: Nodes, Topics, and Services

Practical Implementation: Setting Up Your ROS 2 Environment

For newcomers and seasoned developers alike, accessing a pre-configured ROS 2 environment is crucial. The article highlights the use of a Docker image, which encapsulates a full Ubuntu 24.04 instance with ROS 2 Jazzy Jalisco, complete with a graphical interface accessible via KasmVNC and a preconfigured VS Code development environment. This approach eliminates the complexities of manual installation and dependency management, ensuring a consistent and reproducible development setup across macOS, Windows, and Linux host machines.

Hands On with ROS 2: Nodes, Topics, and Services

The process involves:

  1. Installing Docker Desktop.
  2. Cloning a provided GitHub repository (introduction-to-ros).
  3. Building the Docker image using docker build -t env-ros2 ..
  4. Running the Docker container, exposing necessary ports (e.g., 3000 for the web interface).
  5. Accessing the Ubuntu desktop in a browser via https://localhost:3000.
  6. Using VS Code within the container, which maps the host’s workspace directory for persistent code changes.

Building and Running Your First ROS 2 Nodes

Hands On with ROS 2: Nodes, Topics, and Services

The tutorial guides users through creating a ROS 2 package, the fundamental unit of code organization. This involves using ros2 pkg create --build-type ament_python my_first_pkg to generate a Python-based package. Within this package, developers create Python files for publisher and subscriber nodes, defining their respective Node subclasses, create_publisher() or create_subscription() methods, and callback functions.

For instance, a MinimalPublisher node would use self.create_publisher(StringType, 'my_topic', 10) to publish StringType messages to my_topic with a queue size of 10. A MinimalSubscriber node would use self.create_subscription(StringType, 'my_topic', self._listener_callback, 10) to listen to the same topic. Crucially, package.xml is updated to declare dependencies (e.g., rclpy), and setup.py defines the executable entry points (e.g., my_publisher = my_first_pkg.my_publisher:main). The colcon build tool compiles the package, after which ros2 run my_first_pkg my_publisher and ros2 run my_first_pkg my_subscriber can be used in separate terminals to demonstrate inter-node communication. The rqt_graph tool provides a visual representation of these active nodes and topics, aiding in debugging complex systems.

Hands On with ROS 2: Nodes, Topics, and Services

Similarly, for services, a MinimalServer node is created using self.create_service(AddTwoInts, 'add_ints', self._server_callback), which awaits requests for adding two integers. A MinimalClient node uses self.create_client(AddTwoInts, 'add_ints') to send requests and handles the asynchronous response via a future object and a callback.

Broadening the Horizon: Industry Adoption and Future Implications

Hands On with ROS 2: Nodes, Topics, and Services

The impact of ROS extends far beyond academic research. Its open-source nature and robust capabilities have led to widespread adoption in various commercial robotics applications. Companies like Amazon leverage ROS for coordinating vast fleets of warehouse robots, optimizing logistics and material handling. Avidbots integrates ROS into its commercial-grade autonomous cleaning robots, enabling complex navigation, mapping, and task execution in dynamic environments. Omron utilizes ROS for its collaborative TM manipulator arms, facilitating human-robot interaction and flexible manufacturing processes. Beyond these examples, ROS is increasingly found in healthcare (e.g., surgical robots, patient transport), agriculture (e.g., autonomous harvesting, field monitoring), defense, and logistics, underpinning the software infrastructure of diverse robotic solutions worldwide.

The continued development and maturation of ROS 2 carry significant implications for the future of robotics. By providing a standardized, modular, and performant framework, ROS 2 accelerates development cycles, fosters code reusability, and enhances the robustness and reliability of robotic systems. Its emphasis on distributed systems, real-time performance, and security positions it as a critical enabler for advanced applications like cloud robotics, where computational tasks are offloaded to remote servers, and complex multi-robot coordination. Furthermore, the active and growing open-source community surrounding ROS ensures continuous innovation, improvement, and the availability of a vast ecosystem of tools and libraries. Challenges remain, particularly in areas like formal verification for safety-critical systems and seamless integration with emerging AI paradigms, but the trajectory for ROS 2 points towards an increasingly interconnected and capable future for intelligent machines.

Hands On with ROS 2: Nodes, Topics, and Services

This article, originally appearing in Make: Volume 95, provides a foundational understanding of ROS 2, its history, core concepts, and practical application. Written by Shawn Hymel, a renowned course creator and instructor in edge AI and embedded systems, it serves as an excellent gateway for developers looking to dive into the exciting world of advanced robotics.