Svashasan Logo
Simulated data

Robotics and Middleware · ROS 2 concept

ROS 2 Node

Also known as ROS node, composable node, lifecycle node, managed node

BeginnerSource-checked · awaiting technical reviewLast reviewed 6 December 2026

A participant in the ROS 2 graph that handles a specific task, such as driving a sensor, running an algorithm or commanding an actuator, and communicates with other nodes through topics, services and actions.

Explanation

Nodes are the basic units of computation in ROS 2. A node can be any combination of publisher, subscriber, service server or client, and action server or client, and its behaviour can be configured at runtime through parameters. The network of nodes and the connections between them is called the ROS graph.

Nodes can communicate within the same process, between processes or between machines, and nodes written in different languages interoperate through shared interface definitions. With the default DDS-based middleware, nodes find each other through distributed discovery. Each node advertises itself within its ROS domain (set by ROS_DOMAIN_ID), re-advertises periodically and announces a clean shutdown. Nodes with different domain IDs do not discover each other.

Several nodes can be composed into one process for lower overhead and, optionally, more efficient intra-process communication. Managed (lifecycle) nodes add explicit states so resources are initialised, activated, deactivated and cleaned up in a controlled way. Splitting a system into too many fine-grained nodes increases discovery traffic, latency and configuration effort.

How it works

In code, a node is created from the client library's node type, either directly or by subclassing it. Its constructor declares parameters and creates publishers, subscriptions, timers, and service and action endpoints. While the node runs, its callbacks execute as messages, requests or timer events arrive. The middleware registers the node's endpoints for discovery so that matching peers can connect.

Automotive applications

  • Wrapping a sensor driver
  • Running a perception or localisation algorithm
  • Bridging a vehicle CAN interface to ROS topics
  • Supervising system health

Example

A can_bridge node reads vehicle speed and steering angle from SocketCAN and publishes them on /vehicle/status. It also offers a service to reset odometry and exposes a parameter for the CAN interface name, so the same node runs on test benches and in the car.

An illustrative example: any figures in it are worked numbers, not measurements.

References

  1. Nodes (ROS 2 documentation source) (opens in a new tab)

    Open Robotics / ROS 2 documentation project · Project documentation · Summary; About nodes; Discovery; source of the docs.ros.org rolling page; docs.ros.org blocked automated access · retrieved 6 December 2026

    “A node is a participant in the ROS graph that handles a specific task.”
  2. Composition (ROS 2 documentation source) (opens in a new tab)

    Open Robotics / ROS 2 documentation project · Project documentation · source of the docs.ros.org rolling page; docs.ros.org blocked automated access · retrieved 6 December 2026

  3. Managed nodes (ROS 2 documentation source) (opens in a new tab)

    Open Robotics / ROS 2 documentation project · Project documentation · source of the docs.ros.org rolling page; docs.ros.org blocked automated access · retrieved 6 December 2026

Definitions are original summaries. Standards text is not reproduced; follow the links for the official publications.