In ROS (Robot Operating System), services use a request-response pattern. Why is this pattern important for services?
Think about how you ask a question and expect an answer back.
Services in ROS are designed to perform a task and then return a result. This request-response pattern ensures the client knows the outcome of its request.
When a ROS service node receives a request, what is the expected behavior?
Think about how a waiter takes your order and then brings your food.
The service node must process the request and send a response so the client knows the result.
Consider a ROS client node sending a request to a service that is currently not running. What will the client experience?
Think about calling someone who is not answering the phone.
If the service is not running, the client waits for a response that never comes, causing a timeout or indefinite wait.
Which of the following is the correct way to define a service callback function in ROS Python?
The callback must accept the request and return a response.
The service callback takes one argument (the request) and returns a response object.
When a ROS node that provides a service shuts down, what happens to the service?
Think about closing a shop: what happens to its services?
When the node shuts down, ROS unregisters the service so clients cannot call it anymore.
