listener

This file is ai generated. Do not edit this file directly. Instead, edit the node source code and run the generate-node-docs command to update this file.

Description

A simple ROS2 node that subscribes to string messages on the chatter topic and logs them to the console. This demonstrates basic subscriber functionality in Python.

Subscribers

  • Topic: /chatter

    • Type: example_interfaces/msg/String

    • QoS: Queue size of 10

    • Description: Receives string messages and logs them

Example Usage

# Run the listener node
ros2 run demo_nodes_py listener

The listener will print received messages in the format:

[INFO] [listener]: I heard: [<message_data>]

To test with a talker:

# Terminal 1: Run listener
ros2 run demo_nodes_py listener

# Terminal 2: Run talker
ros2 run demo_nodes_py talker