Unit 04 · lesson
List Topics and Their Types
Start Turtlesim and teleop in sourced terminals:
ros2 run turtlesim turtlesim_node
ros2 run turtlesim turtle_teleop_key
In a third sourced terminal:
ros2 topic list
You should see topics including /turtle1/cmd_vel, /turtle1/pose, /rosout, and /parameter_events.
Ask for types too
The official beginner tutorial uses:
ros2 topic list -t
Now each topic is paired with a type, for example:
/turtle1/cmd_vel [geometry_msgs/msg/Twist]
Why the type matters
Publishers and subscribers need to agree on the data structure moving through the topic.
A topic name alone does not tell you whether the data represents velocity, an image, a string, or something else.
Build a topic inventory
Record three topics:
| Topic | Type | My current guess about its role |
|---|---|---|
The guess column is intentionally a guess. The next commands will let you replace guesses with evidence.
Checkpoint
Which command answers:
"What typed topic paths are active right now?"
Use the exact command, not a prose description.