ROS-leaning-(2)-ActionLib

来源:互联网 发布:数据库内找账号密码 编辑:程序博客网 时间:2024/06/05 05:24
  • Actionlib tutorial

    The actionlib stack provides a standardized interface for interfacing withpreemptable tasks. Examples of this include moving the base to a target location, performing a laser scan and returning the resulting point cloud, detecting the handle of a door, etc.

    In any large ROS based system, there are cases when someone would like to send a request to a node to perform some task, and also receive a reply to the request. This can currently be achieved via ROSservices.

    In some cases, however, if the service takes a long time to execute, the user might want the ability tocancel the request during execution or get periodic feedback about how the request is progressing. The actionlib package provides tools to create servers that execute long-running goals that can be preempted. It also provides a client interface in order to send requests to the server.
    1. Viewing the Code
      $ apt-get install ros-%DISTRO%-common-tutorials$ roscd actionlib_tutorials

    2. Workspace Setup
      $ cd %YOUR_CATKIN_WORKSPACE%/src$ catkin_create_pkg actionlib_tutorials actionlib message_generation roscpp rospy std_msgs actionlib_msgs

    3. Beginner Tutorials
      1. Writing a Simple Action Server using the Execute Callback

        This tutorial covers using the simple_action_server library to create a Fibonacci action server. This example action server 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.

      2. Writing a Simple Action Client

        This tutorial covers using the simple_action_client library to create a Fibonacci action client. This example program creates an action client and sends a goal to the action server.

      3. Running an Action Client and Server

        This tutorial covers running the Fibonacci server and client then visualizing the channel output and node graph.

      4. Writing a Simple Action Server using the Execute Callback (Python)

        This tutorial covers using the simple_action_server library to create a Fibonacci action server in Python. This example action server 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.

      5. Writing a Simple Action Client (Python)

        This tutorial covers using the action_client library to create a Fibonacci simple action client in Python.

    4. Intermediate Tutorials
      1. Writing a Simple Action Server using the Goal Callback Method

        This tutorial covers using the simple_action_server library to create an averaging action server. This example shows how to use an action to process or react to incoming data from ros nodes. The action server averages data from a ros node, the goal is the number of samples to average, the feedback is the sample number, the sample data, the current average, and current standard deviation, and the result is the average and standard deviation of the requested number of samples.

      2. Writing a Threaded Simple Action Client

        This tutorial covers using the simple_action_client library to create a averaging action client. This example program spins a thread, creates an action client, and sends a goal to the action server.

      3. Running an Action Server and Client with Other Nodes

        This tutorial covers running the averaging action server and client with another data node then visualizing the channel output and node graph.

    5. Advanced Tutorials
      1. Writing a Callback Based SimpleActionClient

        Example of using callbacks for program flow that's more complicated than a simple, linear script.

      Actionlib Document
      1. Overview
      2. Detailed Description
      3. Client-Server Interaction
      4. Action Specification: Goal, Feedback, & Result
      5. .action File
        1. Catkin
        2. Rosbuild
        3. Results
      6. Using the ActionClient
        1. C++ SimpleActionClient
        2. Python SimpleActionClient
      7. Implementing an ActionServer
        1. C++ SimpleActionServer
        2. Python SimpleActionServer
      8. SimpleActionServer Goal Policies
      9. Tutorials
      10. Report a Bug

    fibonacci_client_server.png

原创粉丝点击