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:
$ 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
- Pythonでコールバックを用いてシンプルなアクションサーバーを書く
このチュートリアルではシンプルアクションサーバーを用いてフィボナッチアクションサーバーを実装します。この例ではアクションサーバーはフィボナッチ数列を生成し、ゴールは数列の大きさ、フィードバックは計算された数列、リザルトは最終の数列とします。
- Pythonでシンプルなアクションクライアントを書く
このチュートリアルではアクションクライアントライブラリを用いてフィボナッチシンプルアクションクライアントをPythonで書きます。
- コールバックを用いてシンプルなアクションサーバーを書く
このチュートリアルではsimple_action_serverライブラリを用いてフィボナッチアクションサーバーを作ります。この例のアクションサーバーではフィボナッチ数列を生成し、ゴールは数列の大きさとし、フィードバックはそれまでの実行結果の数列とし、リザルトは最終的な数列とします。
- シンプルなアクションクライアントを書く
このチュートリアルではsimple_action_clientライブラリを用いたフィボナッチアクションクライアントを作ります。この例をプログラムではアクションクライアントを作ってアクションサーバーへゴールを送ります。
- 使用Execute Callback编写一个简单的行为服务器
这个教程涵盖了使用simple_action_server库来创建一个Fibonacci行为服务器。这个行为服务器教程会生成一个Fibonacci序列、目标的顺序序列、自身计算的反馈序列和最后序列的结果。
- 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.
- 编写一个简单行为客户端
这个教程涵盖了使用simple_action_client库来创建一个Fibonacci行为客户端。这个示例程序创建一个行为客户端并且发送一个目标到行为服务器。
- 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.
- 运行行为客户端和服务器
本教程涵盖了运行Fibonacci服务器和客户端,随后通过可视化工具查看输出通道和节点图。
- 使用Execute Callback (Python)编写一个简单的行为服务器
本教程涵盖了使用simple_action_server库来创建一个Fibonacci行为服务器,以Python的形式。这个行为服务器示例会生成一个Fibonacci序列、目标序列、完成反馈序列和最终结果序列。
- 编写一个简单的行为客户端(Python)
本教程涵盖了使用action_client库和Python创建一个Fibonacci简单行为库。
- 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.
- アクションクライアントとサーバーを実行する
このチュートリアルではフィボナッチサーバーとクライアントを実行し、チャンネルの出力とノードのグラフをビジュアライズします。
- 不用行为客户端向行为服务器发送目标
教程展示了一些通过不创建行为客户端向行为服务器发送一个目标的方法
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.
- 使用目标回调方法(Goal Callback Method)编写一个简单的行为服务器
本教程涵盖了使用simple_action_server库来创建一个平均行为服务器。该示例展示了如何使用行为来处理或反应从ros节点中传来的数据。行为服务器平均来自ros节点的数据,目标是将多组示例去平均,反馈是简单数字、简单数据、当前平均和当前标准差,以及平均后的结果和简单数字请求的标准差。
- 编写一个简单客户端线程
本教程涵盖了使用simple_action_client库来创建一个平均行为客户端。示例程序循环一个线程,创建一个行为客户端,然后发送目标到行为服务器。
- 使用其他节点运行行为服务器和客户端
本教程涵盖了使用其他节点运行一个平均服务器和客户端,然后可视化查看输出通道和节点图。
- 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.
- ゴールコールバックメソッドを使ったシンプルなアクションサーバを書く
このチュートリアルは、simple_action_serverライブラリを使ってデータを平均化するアクションサーバについて扱います。この例はROSノードから入ってくるデータを処理またはデータに反応するためのアクションの使い方を示します。アクションサーバはROSノードからのデータを平均化し、ゴールはサンプル数で平均し、平均するサンプルの数であり、フィードバックはサンプル数、サンプルデータ、現在の平均、および現在の標準偏差で、結果はサンプルの要求された数の平均と標準偏差です。
- スレッドのシンプルなアクションクライアントを書く
このチュートリアルは、simple_action_clientライブラリを使って、平均化するアクションクライアントの作成を扱います。このサンプルプログラムはスレッドを回し、アクションクライアントを作成し、ゴールをアクションサーバーに送ります。
- アクションサーバとクライアントを他のノードとともに実行する
このチュートリアルは、平均化するアクションサーバとクライアントを他のデータノードと共に実行し、チャネルの出力とノードグラフを可視化について扱います。
Advanced Tutorials
- Writing a Callback Based SimpleActionClient
Example of using callbacks for program flow that's more complicated than a simple, linear script.
- 编写一个基于SimpleActionClient的回调函数
相比一个简单的线性脚本,使用回调函数的示例程序流会更复杂。