liveBook · Manning

ROS node

As explained in Robotics for Programmers

A ROS node is a process or executable that participates in ROS communication by publishing, subscribing, or providing other interfaces.

A ROS node is a self-contained executable that uses the ROS middleware API. It represents a major robot function as a separate process rather than placing every capability in one monolithic program. Nodes can publish, subscribe, provide services, use actions, and access parameters. section 4.4 section 4.8

This structure resembles a service-oriented software system: independent components exchange typed data through named interfaces. A node may contain any number of publishers and subscribers, while the ROS middleware delivers topic messages without requiring publishers and subscribers to know one another directly. Nodes and their connections form the ROS graph, and ROS packages contain the node executables. section 4.4

A publisher and subscriber pair

A Python publisher subclasses rclpy.node.Node, initializes itself as my_ros_pub, creates a publisher for the String message type on my_topic, and publishes once per second from a timer callback. A second node creates a subscription to the same topic and logs each received message. After registering both executables in a package, ros2 run starts them as separate processes. section 4.4

Figure 4.5 A ROS graph consists of multiple independent nodes that communicate by publishing and subscribing to topics, relying on the middleware to deliver messages based on shared topic names and message types.
CH04 F02 bihlmaier ros topics

Use the ROS graph diagram to trace independent nodes and the topic connections through which the middleware routes typed messages. section 4.4

A practical ROS node typically involves:

  • A client library such as rclpy for Python or rclcpp for C++, connected to common ROS communication libraries. section 4.4
  • Publishers and subscribers that exchange messages through named, typed topics. section 4.4
  • A package, executable entry point, build step, and ros2 run command for deployment. section 4.4

How Robotics for Programmers covers it

How deep it goes
Explains node structure, topic relationships, Python construction, packaging, building, and execution, while deferring deeper middleware internals.
Examples
Demonstrates paired Python publisher and subscriber nodes exchanging timed String messages on my_topic.
What it assumes
Assumes basic programming knowledge and introduces the ROS 2 middleware, client-library API, packages, topics, and command-line workflow.
What you can do after
Builds and runs simple Python ROS nodes that publish or subscribe to typed topics.
How it connects
Connects nodes with topics, services, actions, parameters, packages, client libraries, and the ROS graph.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Robotics for Programmers. The section links point to the parts of the book it draws on.