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

(!) Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.

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:

  1. goal
  2. result
  3. 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
  • TTS_EVENT_INITIALIZATION = 1
  • TTS_EVENT_SHUTDOWN = 2
  • TTS_EVENT_SYNCHRONIZATION = 4
  • TTS_EVENT_FINISHED_PLAYING_UTTERANCE = 8
  • TTS_EVENT_MARK = 16
  • TTS_EVENT_STARTED_PLAYING_WORD = 32
  • TTS_EVENT_FINISHED_PLAYING_PHRASE = 64
  • TTS_EVENT_FINISHED_PLAYING_SENTENCE = 128
  • timestamp
    Returns the time at which the feedback was published to the client
    text_said
    Contains all the words said up until the current publication of the feedback.
    next_word
    The next word to be said.
    marks

    Wiki: Robots/TIAGo/Tutorias/Pick_and_place (last edited 2016-09-16 14:00:11 by Jordi Pages)