Creating a custom action interface
To create an action interface, we first need to clearly define what we need to achieve with the action. Then, we can add the interface to the my_robot_interfaces
package (in this section, we will continue using the packages we created in the previous chapters).
Defining the application and the interface we need
In the application that we will write in this chapter, the action server will be responsible for counting until a given number, with a delay between each count, so that we can simulate that the action takes some time and doesn’t return immediately. The client will have to send a number to the server so that the server can start to count. When the server finishes, it will send the result (last reached number) back to the client.
For example, let’s say the client sends the number 5 to the server, and there’s a delay of 0.5 seconds. The server will start to count from 0, up to 5, and wait 0.5 seconds between each...