Unit 05 · lesson

Diagnose Service Calls

Service failures become easier if you inspect name → type → interface → server in that order.

Wrong service name

Check:

ros2 service list -t

If the name is not listed, typing more YAML will not fix it.

Wrong service type

Ask:

ros2 service type /spawn

Use the returned type rather than guessing.

Wrong request fields

Inspect:

ros2 interface show turtlesim/srv/Spawn

Compare your YAML keys and value types to the request side of the interface.

No server

Use:

ros2 service info /spawn

If the expected service server is not present, ask whether the node providing it is actually running.

Valid request rejected by application logic

The Turtlesim tutorial demonstrates that trying to create another turtle with a name already in use produces an error.

That is different from a malformed ROS service request. The request can be structurally valid and still violate application rules.

Checkpoint

Create four failure labels:

DISCOVERY FAILURE
TYPE/INTERFACE FAILURE
SERVER AVAILABILITY FAILURE
APPLICATION-LEVEL REJECTION

Give one service example for each.