Can a service block an action?

The Face-recognition system will provide a Service . Your ROS program will call that service and WAIT until it gives you the name of the person BB-8 has in front of it.
The navigation system will provide an Action . Your ROS program will call the action to move the robot somewhere, and WHILE it’s performing that task, your program will perform other tasks, such as complain about how tiring C-3PO is. And that action will give you Feedback (for example: distance left to the desired coordinates) along the process of moving to the coordinates.

@staff The above quote is from ROS Basics in C++ chapter. Its said that when a program run a Service, it will pause the program till a result is achieved. Does this mean that an action server node running in the background, say a navigation program, will be paused until the result for the service is achieved? or do they work independently of each other?

Your action and service servers should be independent - you can implement them as different scripts for better control. Then your main program can be another script that interacts with the service and action.

That way, neither is blocking the other, but your main script can be blocked depending on which of them you call, and how you call them (you can also make a blocking call to an action).

If you are calling both from the main script, you need to wire your logic such that you are not blocked unnecessarily - e.g call the action and while waiting for it call the service.

This topic was automatically closed after 13 hours. New replies are no longer allowed.