Getting ready

The actionlib package consists of ActionClient and ActionServer, which communicate via a "ROS Action Protocol" built on top of ROS messages via function calls and callbacks.

The following diagram shows the interaction between the client and server applications:

Client-server interaction

We have to define a few messages that are action-specific, through which the client and server can communicate.

These are defined as goal, feedback, and result messages:

  • Goal: We will introduce the notion of a goal as tasks that are accomplished using actions which can be sent to ActionServer by ActionClient. For example, in the case of a mobile robot, the goal would be to choose the next pose ( x, y, z, phi, chi, theta), which has information about where the mobile robot should move to in the world.
  • FeedbackActionServer provides a feedback message to ActionClient, which defines a way to tell the incremental progress of a goal periodically. In the case of the mobile robot, this might be the current pose of the robot, along with other information.
  • Result: Upon completion of this goal, ActionServer sends the result message to ActionClient, which is quite different from a feedback message, since it is sent exactly once and is extremely useful in some cases. However, in the case of the mobile robot, the result isn't very important, but it might contain the final pose of the robot.

In the following section, we will learn how to create an action server and client, where the ActionServer generates a Fibonacci sequence, the goal is the order of the sequence, the feedback is the sequence as it is computed, and the result is the final sequence. This also includes ActionClient, which sends a goal to the action server.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.248.24