Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags. |
What are Service Pairs?
Description: Detailed explanation about service pairs.Keywords: servicepairs, rocon
Tutorial Level: BEGINNER
Next Tutorial: Create ServicePair Messages
Contents
Definition
Service Pairs implement a request-response messaging pattern for ros systems. In this manner they are similar to traditional ros services, but in implementation they differ in that they can be used in either blocking or non-blocking (sync over async) modes.
This is useful in any ros request-response situation where the time to respond is unknown or non-trivial (ros service callbacks should always be very light) and you do not want the full-blown implementation of a pre-empting messaging pattern like that provided by actionlib.
Implementation
Service pairs utilise a pair of publishers and subscribers to transport the data and a facade pattern with client and server side libraries that hide the direct manipulation of the pubsub pairs behind traditional library api's (this package provides python api's).