Actions
A ROS 2 action is basically the same thing as a service (client/server communication), but designed for longer tasks, and when you might want to also get some feedback during the execution, be able to cancel the execution, and so on.
In robotics, we are making robots move. Making a robot move is not something that happens instantly. It could take a fraction of a second, but sometimes a task could take a few seconds/minutes or more. ROS 2 services have been designed for quick execution, for example: a computation, or an immediate action, such as spawning a turtle on a screen. Actions are used whenever a client/server communication might take more time and we want more control over it.
We will dive into actions with more details in Chapter 7. Actions are what I consider to be an intermediate-level concept, not a beginner one, so I won’t start to go too deep right now. Let’s just continue the discovery phase with a very simple example, just to get an idea of...