A remote procedure call (RPC) lets a program invoke a procedure in another process or computer over a network. The client sends parameters, the server executes the procedure, and the server returns a value. Unlike an ordinary function call, the operation depends on network communication and can block while processing completes. section 4.6 section 4.2
In ROS, RPCs are called services. A service has one server and may have multiple clients, with each client request handled separately. Services suit sporadic requests, especially when the client needs confirmation that the server received and acted on the request. Streaming data such as camera images, joint positions, or pose updates is better suited to topics. section 4.6
Treat a networked procedure as a distributed operation rather than a local function:
- Allow for latency, unavailable receivers, delivery failure, changing topology, and network overhead. section 4.2
- Choose services for request-and-response interactions; choose topics for decoupled, ongoing streams. section 4.6
- Evaluate throughput, scalability, overhead, and temporal behavior in addition to communication functionality. section 4.2
A ROS 2 boolean service
A server can expose a std_srvs/srv/SetBool service, receive a request, set response.success and response.message, and return the response. A client constructs SetBool.Request(), assigns request.data, calls the service asynchronously, and processes the response in a callback. The same request can be tested from the command line with ros2 service call or through the RQt Service Caller plugin.







