Unit 01 · lesson

Packages, Nodes, Graphs, and Interfaces

Now connect the nouns.

Package → executable → node

When the beginner documentation launches Turtlesim, it uses:

ros2 run turtlesim turtlesim_node

Read that command from left to right:

ros2 run
  package: turtlesim
  executable: turtlesim_node

After the executable starts, the running system contains a node named:

/turtlesim

Those names are related, but they are not the same thing.

A node should have a job

ROS 2 encourages nodes with modular purposes.

For example:

/teleop_turtle
  publishes movement commands

/turtlesim
  receives movement commands
  updates simulation state
  publishes pose and sensor information

The running relationship between those nodes is part of the ROS graph.

Interfaces describe data shape

Communication needs structure.

If one node publishes velocity data and another node subscribes to it, both sides need to agree on what the message looks like.

Later you will run:

ros2 interface show geometry_msgs/msg/Twist

and see fields for linear and angular velocity vectors.

That interface is a contract for message structure.

Services and actions have their own interface structures too.

Do not memorize every interface

That is not the skill.

The skill is knowing how to ask ROS:

What type is this topic/service/action?
What fields does that type contain?

Then use the answer.

Build the first system map

Draw:

PACKAGE
  ↓ provides
EXECUTABLE
  ↓ creates
NODE
  ↓ participates in
ROS GRAPH
  ↓ uses
INTERFACES + COMMUNICATION

Add one real Turtlesim example next to every box except the graph itself.

Checkpoint

Why would a troubleshooting session go badly if you use the words package, executable, and node as if they mean the same thing?