ROS 2 for Robotics Products: Architecture and Practical Use
ROS 2 is an open-source framework that structures robot software as many small programs, called nodes, that exchange data through a middleware layer. It provides drivers, navigation, manipulation and tooling that would take years to build alone. Moving from a research prototype to a product, though, needs attention to architecture, communication settings and security. This article explains the core concepts and the practical points that matter for shipping systems.
At a glance
- Nodes
- Units of computation that each do one job, such as a driver, planner or controller.
- DDS
- The publish-subscribe middleware standard ROS 2 uses for discovery and transport by default.
- QoS
- Quality of service settings for reliability, durability and history depth.
- Lifecycle
- Managed nodes with defined states for controlled start-up and shutdown.
The problem
Prototype systems tend to grow into dozens of nodes started by sprawling launch files, with settings scattered across them. Start-up order becomes fragile and nobody is sure which configuration is running on a given robot.
Communication problems can be silent. A subscriber requesting reliable delivery will not connect to a best-effort publisher, and robots sharing a network discover each other unless their domains are separated.
Treat topics and their QoS settings as interfaces. Design them, document them and version them.
Topics, services and actions
Topics carry continuous streams such as sensor data and commands, from any number of publishers to any number of subscribers. Services handle short request-and-response exchanges. Actions handle long-running goals with feedback and cancellation, and are built from topics and services.
The middleware is pluggable through the ROS middleware interface, with several DDS implementations and, in recent distributions, Zenoh available. Behaviour and tuning differ between implementations, so choose one, test with it and keep it fixed for the product. Composing several nodes into one process can also cut copying and latency for high-rate data.
What good looks like
Map the system as nodes and interfaces, choosing topics, services or actions for each exchange and setting QoS deliberately.
Use lifecycle nodes and centralised parameter files so start-up, configuration and shutdown are predictable.
Pin a long-term support distribution and your dependencies, and enable security if the robot shares a network.
| Pattern | Shape | Use for |
|---|---|---|
| Topic | Publish-subscribe, many to many | Sensor data, state and streamed commands |
| Service | Request and response | Quick queries and configuration changes |
| Action | Goal, feedback, result and cancel | Long tasks such as navigating to a pose |
| Parameter | Named values held by a node | Configuration and tuning |
| Reliable | Best effort | |
|---|---|---|
| Delivery | Retries lost samples | May drop samples |
| Latency under packet loss | Can grow | Stays low |
| Lossy wireless links | Can back up | Degrades gracefully |
| Missed commands | Unlikely | Possible |
What it changes
Clear Structure
Each node has one job and documented interfaces.
Reliable Start-Up
Managed lifecycles bring the system up in a known order.
Reuse
Standard drivers and packages shorten development.
Maintainability
Pinned versions keep every robot running known software.
Where to go next
Use ROS_DOMAIN_ID or network separation to keep robots and test benches from discovering each other unintentionally.
Keep hard real-time control in dedicated firmware or a real-time controller, with ROS 2 commanding it at a higher level. This keeps tight loops independent of the operating system scheduler and the network.
Problems this prevents
- Silent QoS mismatches between nodes
- Robots discovering each other on a shared network
- Unpinned dependencies changing between builds
- Security left disabled in the field
Discuss your project
Email support@aavico.com or use Get in Touch when the website finishes loading.