liveBook · Manning

Sink node

As explained in Robotics for Programmers

A ROS subscriber is a ROS node entity that receives messages of a specified type from a topic.

A ROS subscriber is a node entity that receives messages of a specified type from a named topic. Publishers and subscribers remain decoupled: middleware delivers matching messages without requiring either side to know the other's location. section 4.4 section 4.2

A subscriber connects four practical pieces:

  • Topic name: identifies the logical channel, such as detected_objects or my_topic. section 4.4 section 4.2
  • Message type: must match the publisher's type, such as ObjectList or std_msgs/msg/String. section 4.4 section 4.2
  • Callback: runs when a message arrives and receives the message content as an argument. section 4.2 section 4.4
  • Middleware and node: manage delivery and allow nodes to communicate across different deployments. section 4.2 section 4.4

A minimal rclpy subscriber

A Python node creates a subscription with the message class, topic name, callback, and queue-depth argument: self.subscription_ = self.create_subscription(String, 'my_topic', self.sub_callback, 10). The callback logs msg.data, while rclpy.spin(node) keeps the node processing incoming messages. 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 view to see independent nodes connected through topic names and message types, with middleware providing delivery. section 4.4

How Robotics for Programmers covers it

How deep it goes
Defines topics, types, callbacks, middleware decoupling, and rclpy setup, but does not detail callback scheduling internals.
Examples
Uses detected_objects planning, a String subscriber, a counter exercise, custom FooBar messages, and topic-name typo diagnosis.
What it assumes
Assumes ROS nodes, topics, publishers, and message types while demonstrating subscriber construction and callback use.
What you can do after
Operate/configure a subscriber with rclpy, ros2 CLI, callbacks, message types, and topic-inspection tools.
How it connects
Connects ROS nodes, topics, publishers, message types, callbacks, middleware, and the ROS graph.

Also explained in

Compare how 7 books explain sink node →

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.