Unit 04 · lesson

Echo Live Messages

A topic can exist without you seeing its data.

ros2 topic echo lets you subscribe from the CLI and print messages as they arrive.

Echo movement commands

Run:

ros2 topic echo /turtle1/cmd_vel

At first you may see nothing.

Return to the teleop terminal and press an arrow key. The echo terminal should print a message with linear and angular fields.

The official tutorial shows a structure like:

linear:
  x: 2.0
  y: 0.0
  z: 0.0
angular:
  x: 0.0
  y: 0.0
  z: 0.0

Values change with commands.

Echo pose instead

Try:

ros2 topic echo /turtle1/pose

Move the turtle and observe the stream.

Do not assume every field means what you think it means yet. Record field names and changing values first.

CLI tools become graph participants

The official tutorial notes that the echo command itself creates a ROS node/subscription while it is running. rqt_graph may therefore show an additional CLI-created participant.

That is an important systems idea: observation tools can become part of the graph they observe.

Checkpoint

Write:

Topic echoed:
What triggered new data:
Fields observed:
What changed:
What stayed constant: