A ROS Node may publish data to any number of topics and simultaneously have subscriptions to any number of topics

Topics is one of the main ways in which data is moved between nodes therefore between different parts of the system

Useful commands

ros2 topic list - Running this command in the shell returns a list of all the topics currently active in the system

adding a -t flag returns the same list of topics but with the type appended in brackets

ros2 topic echo <topic_name> - See the data being published on a topic

ros2 topic info <topic_name> - Topics don’t have to be 1 to 1 communication, they can be one to many, many to one, or many to many

ros2 topic info <topic_name> --verbose

Returns:

  • Node names and namespaces of publishers and subscribers
  • Topic type
  • QoS profiles