Embodied AI Glossary中文

Topic (ROS)

话题Essential

A named channel for continuously streaming data between ROS nodes, working on a publish/subscribe model.

A topic is the most commonly used communication mechanism in ROS. Every topic has a name and a fixed message type; publisher nodes continuously send messages to the topic, and subscriber nodes receive them, with neither side needing to know who the other is — a single topic can have multiple publishers and multiple subscribers. This suits a continuous stream of data, such as images, lidar point clouds, joint states, or velocity commands. By contrast, a service is a one-shot request-response call (a client sends a request, the server processes it and replies with a result), suited to a query or a single triggered action; an action is for a longer-running task that needs progress feedback partway through, or the ability to be cancelled, such as navigating to a point. Together these three form the basis of ROS communication, and a newcomer should get comfortable with topics first.

ExampleA base-driver node subscribes to the /cmd_vel topic (a Twist-type velocity command); a keyboard teleop node publishes velocities to that same topic, and the base moves accordingly.

Also called
ROS Topic
Related
Node (ROS) · Service (ROS) · Action (ROS Action) · Message (msg / srv / action interface) · Publish-Subscribe · cmd_vel Topic (geometry_msgs/Twist velocity command)
Sources
ROS 2 Documentation: Understanding topics
ROS Wiki: Topics

See it in the full glossary →