Author: Jordi Pages, Job Van Dieten
Maintainer: Jordi Pages < jordi.pages@pal-robotics.com >, Job van Dieten < job.1994@gmail.com >
Source: https://github.com/pal-robotics/tiago_tutorials.git
![]() |
Pick & place demo (Python)
Description: This tutorial presents an example on how to perform pick and place tasks based on perception and grasp planning using MoveIt!Keywords: Python
Tutorial Level: INTERMEDIATE
Purpose
This tutorials shows a demo of tabletop pick and place with TIAGo.
Pre-Requisites
bla bla
Execution
Open a first terminal and run the following instrution which launches the simulation used in the demo:
$ roslaunch tiago_pick_demo pick_simulation.launch
In a second terminal run the instruction below which launches the perception node and the pick and place nodes:
$ roslaunch tiago_pick_demo pick_demo.launch
GUI
Those who wish to use the simple GUI format simply run the following command.
$ roslaunch tts tts.launch
Terminal
However if there are users who prefer to run everything through the terminal, add a type argument.
$ roslaunch tts tts.launch type:=terminal
Concepts & Code
The main driving forces behind this tutorial are the actionlib library and the PAL Robotics Text-To-Speech Interface action message.
actionlib
the actionlib_tutorials/Tutorials/SimpleActionClient and actionlib_tutorials/Tutorials/SimpleActionServer(ExecuteCallbackMethod) objects that actionlib provides are easy to work with. The server broadcasts a topic to which other nodes create a client subsequently publishing a goal.In the callback created for the server the parameters passed through the goal message are used to their desired effect. During the process the server publishes feedback to let the client node know where the action is in its process. After either completion or failure of the process, the server sends a result to the client node, indicating the final status of the desired action.
action message
The action message is split into three parts:
- goal
- result
- feedback
Goal
The goal gives the parameters for the action the target process has to execute.
I18nText text TtsText rawtext string speakerName float64 wait_before_speaking
- text
This variable contains an I18nText message, described in fuller detail later.
- rawtext
This variable contains an TtsText message, described in fuller detail later.
- speakerName
- Gives the option to choose between a variety of speakers for the same language, if the platform allows.
- wait_before_speaking
- Indicates how many seconds the platform has to wait before saying the text.
I18nText
string section string key string lang_id I18nArgument[] arguments
- section
- key
- lang_id
- This is the RFC 3006 code to select the language the text will be said in.
- arguments
TtsText
string text string lang_id
- text
- The string of user input that is to be said.
- lang_id
- This is the RFC 3006 code to select the language the text will be said in.
Result
This only gets published after the process is complete or fails, and terminates the action.
string text string msg
- text
- The complete string said by the platform.
- msg
- This string can be used to give any warning or error messages, thrown up by the platform, to the client.
Feedback
Feedback is continuously published while both threads (client and server) continue, allowing the client to process any other information it might need to pre-emptively cancel the goal, process data etc...
uint16 event_type time timestamp string text_said string next_word TtsMark marks
- event_type
- This shows what stage of the process is in. The integer value has 8 definitions