Show EOL distros:
Package Summary
This package provides detailed tutorials for using actions.
- Author: Melonee Wise
- License: BSD
- External website: http://pr.willowgarage.com/wiki/actionlib_tutorials
- Repository: ros-pkg
- Source: svn https://code.ros.org/svn/ros-pkg/stacks/common_tutorials/tags/common_tutorials-0.1.2
Package Summary
This package provides detailed tutorials for using actions.
- Author: Melonee Wise
- License: BSD
- External website: http://pr.willowgarage.com/wiki/actionlib_tutorials
- Source: svn https://code.ros.org/svn/ros-pkg/stacks/common_tutorials/branches/common_tutorials-0.1
Package Summary
This package provides detailed tutorials for using actions.
- Author: Melonee Wise
- License: BSD
- External website: http://pr.willowgarage.com/wiki/actionlib_tutorials
- Source: svn https://code.ros.org/svn/ros-pkg/stacks/common_tutorials/trunk
Package Summary
The actionlib_tutorials package
- Maintainer: Daniel Stonier <d.stonier AT gmail DOT com>
- Author: Melonee Wise
- License: BSD
- Bug / feature tracker: https://github.com/ros/common_tutorials/issues
- Source: git https://github.com/ros/common_tutorials.git (branch: None)
Package Summary
The actionlib_tutorials package
- Maintainer status: maintained
- Maintainer: Daniel Stonier <d.stonier AT gmail DOT com>
- Author: Melonee Wise
- License: BSD
- Bug / feature tracker: https://github.com/ros/common_tutorials/issues
- Source: git https://github.com/ros/common_tutorials.git (branch: hydro-devel)
Package Summary
The actionlib_tutorials package
- Maintainer status: maintained
- Maintainer: Daniel Stonier <d.stonier AT gmail DOT com>
- Author: Melonee Wise
- License: BSD
- Bug / feature tracker: https://github.com/ros/common_tutorials/issues
- Source: git https://github.com/ros/common_tutorials.git (branch: indigo-devel)
Package Summary
The actionlib_tutorials package
- Maintainer status: maintained
- Maintainer: Daniel Stonier <d.stonier AT gmail DOT com>
- Author: Melonee Wise
- License: BSD
- Bug / feature tracker: https://github.com/ros/common_tutorials/issues
- Source: git https://github.com/ros/common_tutorials.git (branch: hydro-devel)
Package Summary
The actionlib_tutorials package
- Maintainer status: maintained
- Maintainer: Daniel Stonier <d.stonier AT gmail DOT com>
- Author: Melonee Wise
- License: BSD
- Bug / feature tracker: https://github.com/ros/common_tutorials/issues
- Source: git https://github.com/ros/common_tutorials.git (branch: indigo-devel)
Package Summary
The actionlib_tutorials package
- Maintainer status: maintained
- Maintainer: Daniel Stonier <d.stonier AT gmail DOT com>
- Author: Melonee Wise
- License: BSD
- Bug / feature tracker: https://github.com/ros/common_tutorials/issues
- Source: git https://github.com/ros/common_tutorials.git (branch: indigo-devel)
Package Summary
The actionlib_tutorials package
- Maintainer status: maintained
- Maintainer: Daniel Stonier <d.stonier AT gmail DOT com>
- Author: Melonee Wise
- License: BSD
- Bug / feature tracker: https://github.com/ros/common_tutorials/issues
- Source: git https://github.com/ros/common_tutorials.git (branch: indigo-devel)
Package Summary
The actionlib_tutorials package
- Maintainer status: maintained
- Maintainer: Daniel Stonier <d.stonier AT gmail DOT com>
- Author: Melonee Wise
- License: BSD
- Bug / feature tracker: https://github.com/ros/common_tutorials/issues
- Source: git https://github.com/ros/common_tutorials.git (branch: noetic-devel)
Viewing the Code
actionlib_tutorials is a series of tutorials for using the actionlib client API. You can browse these tutorials by installing common_tutorials and roscd-ing to the actionlib_tutorials package, i.e.
$ apt-get install ros-$ROS_DISTRO-common-tutorials $ roscd actionlib_tutorials
and viewing what is there. Many of these tutorials are also discussed in the wiki tutorials:
Workspace Setup
If you have not yet created a workspace in which to complete the tutorials, click here for some brief instructions .
Show EOL distros:
Create a file named ~/tutorials.rosinstall with the following content:
- other: { local-name: workspace }
To overlay on the ROS distro you are using:
rosinstall ~/tutorials /opt/ros/$ROS_DISTRO>> ~/tutorials.rosinstall
To use this workspace whenever you open a new terminal setup your ROS environment by typing:
source ~/tutorials/setup.bash
Sourcing this file adds ~/tutorials/workspace to your ROS_PACKAGE_PATH.
Any packages you create in that directory will be found by rospack.
An alternative to source your script file is to add it to your .bashrc, but remember that this will persist in your .bashrc into the future, and you can only have one environment setup. For more on what this is doing see this page
Create a catkin workspace like so:
$ source /opt/ros/$ROS_DISTRO/setup.bash $ mkdir -p ~/tutorial_ws/src $ cd ~/tutorial_ws $ catkin_init_workspace src $ catkin_make
And now source the setup file from the result-space, so that packages you add to this workspace's src folder will be findable by rospack, and the built binaries by rosrun and roslaunch:
$ source devel/setup.bash
Before starting any of the actionlib tutorials take the time to create a scratch package to work in and manipulate the example code. Create a sandbox package with the following dependencies:
$ cd %YOUR_CATKIN_WORKSPACE%/src $ catkin_create_pkg actionlib_tutorials actionlib message_generation roscpp rospy std_msgs actionlib_msgs
(If you're not familliar with creating catkin packages, see Creating_a_catkin_Package tutorial (in that page, don't forget to choose catkin as build system).
$ roscd tutorials $ roscreate-pkg learning_actionlib actionlib roscpp rospy roslib std_msgs actionlib_msgs
Make sure that the learning_actionlib directory is included in your ROS_PACKAGE_PATH. Uncomment rosbuild_genmsg() in the learning_actionlib/CMakeLists.txt and build it:
$ rosmake learning_actionlib
(Note: These tutorials require common-0.5.0 or greater)
Beginner Tutorials
In C++
- 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.
- 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.
In Python
- 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.
- Writing a Simple Action Client (Python)
This tutorial covers using the action_client library to create a Fibonacci simple action client in Python.
Execution
- Running an Action Client and Server
This tutorial covers running the Fibonacci server and client then visualizing the channel output and node graph.
- Send a Goal to Action Server without Action Client
This tutorial shows ways of send a Goal to an Action Server without the need of create an Action Client.
Intermediate Tutorials
- 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.
- 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.
- 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.
Advanced Tutorials
- Writing a Callback Based SimpleActionClient
Example of using callbacks for program flow that's more complicated than a simple, linear script.