Service (ROS 2)
Definition
A ROS 2 communication mode based on request and response: a client node sends a request, a server node performs a computation and returns the result. The client generally waits for the response, so services are reserved for quick operations. For a long task, or one that must be interruptible, an action is used.
Checked on against the references below. · Written with AI · checked against the sources Source: Official ROS 2 documentation (Jazzy), “Services”.
Concrete examples
Booster Robotics publishes a ROS 2 interface package that provides message and service definitions for robot control. Its repository lists an “Agent” service, for exchanging strings, and an “RPC” service, for more complex data exchanges.
What it changes for you
For developers, a service name should have only one server, while the number of clients is not limited. If two servers share a name, the documentation says it is undefined which one will receive client requests.
Not to be confused with
In the documentation, a service definition has a request and a response, while an action definition has a request, a response and progress feedback, which the action server sends while the action runs. The action server should also react to cancellation and preemption requests.
Additional material checked on .