All these tutorials assume that you have setup your tutorial workspace. If you have not done so click here.
Setting up the ROS tutorial workspace
This describes how to setup your environment for tutorials.
Create a file named ~/tutorials.rosinstall with the following content:
- other: { local-name: workspace }To overlay on cturtle:
rosinstall ~/tutorials /opt/ros/cturtle ~/tutorials.rosinstall
To overlay on boxturtle:
rosinstall ~/tutorials /opt/ros/boxturtle ~/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 is to add this 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
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:
$ roscd tutorials $ cd workspace $ 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
- 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.
- Running an Action Client and Server
This tutorial covers running the Fibonacci server and client then visualizing the channel output and node graph.
- 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.
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.






