> For the complete documentation index, see [llms.txt](https://huang-jason.gitbook.io/ros/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://huang-jason.gitbook.io/ros/pkg-actionlib.md).

# PKG - actionlib

## actionlib

Service can: send a request to a node to perform some task, and also receive a reply to the request.

actionlib = Service + ***long executing time (ability to cancel the request or get periodic feedback)***

Example:

* moving the base to a target location
* performing a laser scan and returning the resulting point cloud
* detecting the handle of a door

## Client-Server Interaction

The ActionClient and ActionServer communicate via a "ROS Action Protocol", built on top of ROS **messages**.

The client and server provide a simple API for users to request goals (on the client side) or to execute goals (on the server side) via function calls and callbacks.

![](https://548312962-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lq83PzYaksJkirwod4I%2F-Lq83Un_qn4pNS1_E1_u%2F-Lq83VR4T-31iJNWhtlN%2Fclient_server_interaction.png?generation=1569962723946658\&alt=media)

### Goal

ActionServer -> goal (msg) -> ActionClient

### Feedback

ActionServer -> goal (msg: progress) -> ActionClient

### Result

When completion of the goal, ActionServer -> goal (msg: once) -> ActionClient

## .action file

```yaml
# Define the goal
uint32 dishwasher_id  # Specify which dishwasher we want to use
---
# Define the result
uint32 total_dishes_cleaned
---
# Define a feedback message
float32 percent_complete
```
