Workflow of service server

Im trying to understand service client, service and service servers conceptually based on session 6. Is the following diagram accurate?

someone “calls” the service (in this case from an independent terminal). The service computes a function and sends it in a particular format (in this case “Empty”) to the service server. What is the function of the service server? To hold and publish information as the service requests? In this scenario it is publishing to a topic /cmd_vel which will push information the robot on how to move?

My main confusion is the role of the service server. Can you just subscribe to the service and cut out the service server? Also, want to know if my understanding of the workflow is accurate

The summary states : * Service Server: This is what PROVIDES the functionality. Whatever you want your Service to do, you have to place it in the Service Server." . So then should the “service” be housed the service server’s node in the diagram?

Hi @r.franklinismail,

I think the confusing part here is the “Service”, which in itself is just a generic term for the functionality. It’s not a component or node.

The main parts are the Service Client and Service Server, which are both ROS nodes:

  • The Service Server provides the functionality, just as a web service provides to web clients (browsers in most cases).
  • The Service Client consumes the functionality. In this case, it can be a python script or a simple command that calls the service from the terminal.
1 Like

very helpful! thank you!

1 Like