examples_rclpy_executors.listener module

class examples_rclpy_executors.listener.Listener(*args: Any, **kwargs: Any)

Bases: Node

A node with a single subscriber.

This class creates a node which prints messages it receives on a topic. Creating a node by inheriting from Node is recommended because it allows it to be imported and used by other scripts.

chatter_callback(msg)
examples_rclpy_executors.listener.main(args=None)

Run a Listener node standalone.

This function is called directly when using an entrypoint. Entrypoints are configured in setup.py. This along with the script installation in setup.cfg allows a listener node to be run with the command ros2 run examples_rclpy_executors listener.

Parameters:

args – Arguments passed in from the command line.