http://www.luxai.org/assets/qtrobot-together.png

LuxAI QTrobot

QTrobot, is a commercial available toddler-like humanoid robot built by LuxAI S.A. It is a socially engaging and interactive robot with a wide areas of application. QTrobot is currently being used for emotional training of children with autism, post-stroke rehabilitation and elderly cognitive and physical rehabilitation.

QTrobot Interface

The QTrobot (LuxAI) interface aims to facilitate accessing basic robot functionalities leveraging a set of user-friendly ROS interfaces. Each robot’s functionality can be accessed in blocking and non-blocking mode using ROS publish/subscribe and Service/Client interfaces. For the time being, the following interfaces have been implemented:

  • Robot Emotion : implements robot facial emotion

  • Robot Speech : implements robot text to speech functionality

  • Robot Audio : implement a simple player to play standard audio files

  • Robot Gesture : implements robot gesture control

  • Robot Behavior : implements more complex behaviors by combining the robot basic functionality

For each of above-mentioned functionalities, there are two different set of language-independent interfaces:

  1. A set of ROS Subscribers to allow non-blocking call to the interface
  2. A set of ROS Services for blocking and more sophisticated interfaces

Naming convention

All the QTRobot ROS interfaces have '/qt_robot/...' prefix in front of their names. The word follows the prefix is the name of the main service (e.g. '/qt_robot/speech/...'). Each interface may have more sub-services (methods) which come after the main service name. For example:

/qt_robot/speech/say    : implements say() method of QTrobot TTS
/qt_robot/speech/config : implements configure() method of QTrobot TTS

For user’s convenience we have given the same name to the service and subscriber for each QTrobot ROS interface. That means one can access, for example, the speech functionality using ROS service call or publish/subscribe via the same interface name (e.g. '/qt_robot/speech/say'). Please notice that some of the complex services (e.g. speech configuration for language, pitch,…) are accessible only via ROS service call.

Accessing QTrobot interface from bash

You can access each Robot functionality via its publish/subscribe or Service/Client interfaces. For example to use robot 'Speech' functionality you can try the following:

Using ROS Publisher

$ rostopic pub /qt_robot/speech/say std_msgs/String "data: 'I am QT'"

Using ROS Service

$ rosservice call /qt_robot/speech/say "message: 'I am QT.'"

Accessing QTrobot interface from a python script

[Non-blocking mode] The following example shows how to access QTrobot Speech functionality using ROS publish/subscribe method from python:

   1 import rospy
   2 from std_msgs.msg import String
   3 
   4 # create a publisher
   5 speechSay_pub = rospy.Publisher('/qt_robot/speech/say', String, queue_size=10)
   6 ...
   7 # publish a text message to TTS (non-blocking)
   8 speechSay_pub.publish("Hello! I am QT!")

[blocking mode] And the following example, re-implements the previous one using ROS Service/Client method from python:

   1 import rospy
   2 from std_msgs.msg import String
   3 from qt_robot_interface.srv import *
   4 
   5 # create a service clients
   6 speechSay = rospy.ServiceProxy('/qt_robot/speech/say', speech_say)
   7 ...
   8 # call the service (blocking)
   9 resp = speechSay("Hello! I am QT.")

/!\ Notice: All QTrobot service interfaces returns the status of the call upun success or failure. For example to check whether a call to a service was successful in python, you can check the return value resp.status.

List of available interfaces

Currently the following interfaces have been implemented:

Functionality

Interface prefix

Description

Speech

/qt_robot/speech/...

robot text to speech functionality

Audio

/qt_robot/audio/...

simple standard audio file player

Emotion

/qt_robot/emotion/...

robot facial emotion

Gesture

/qt_robot/gesture/...

robot gesture control

Behavior

/qt_robot/behavior/...

more complex behaviors by combining the robot basic functionality


Speech Interface

This interface implements QTrobot text to speech functionality. The current TTS supports the following languages:

  • en-US (american english)
  • en-GB (british english)
  • es-ES (spanish)
  • fr-FR (French)
  • de-DE (German)

Subscribers

Interface Name

Data Type

Description

/qt_robot/speech/say

'std_msgs/String' (text)

Read a text using built-in TTS

Services

Interface Name

Service Name

Parameters

Description

/qt_robot/speech/say

'speech_say'

message

Read a text using built-in TTS

/qt_robot/speech/config

'speech_config'

'language', 'pitch', 'speed'

Configure TTS

(!) Default language is 'en-US', pitch is '140' and speed is '80'.


Audio Interface

Play a standard audio file (e.g. wav, mp3). The audio file can be given using its complete name (with the file extension) such as happy.mp3 or simply without the file extension: happy. In the second case, the player first looks for happy.mp3 to play and if it is not found it then tries with happy.wavand so on.

(!) The default path for the audio files is '~/robot/cuddie/main/data/audios/'

Subscribers

Interface Name

Data Type

Description

/qt_robot/audio/play

'std_msgs/String' (audio file name)

Play an sudio file

Services

Interface Name

Service Name

Parameters

Description

/qt_robot/audio/play

'audio_play'

'filename', 'filepath'

Play an audio file given by its filename and filepath

(!) To play the audio file from the default path, pass an empty string to filepath param.


Emotion Interface

Change the robot facial emotions such as 'ava_happy', 'ava_sad', etc.

Subscribers

Interface Name

Data Type

Description

/qt_robot/emotion/show

'std_msgs/String' (emotion name)

Show a facial emotion given by its name

Services

Interface Name

Service Name

Parameters

Description

/qt_robot/emotion/show

'emotion_show'

'name'

Show a facial emotion given by its name

(!) The complete list of emotion files can be found in '~/robot/cuddie/main/data/emotions/'.


Gesture Interface

Plays recored robot gesture (arms, head) such as 'happy', 'discust', etc. The complete list of gesture files can be found in ~/robot/cuddie/main/data/actions/.

Subscribers

Interface Name

Data Type

Description

/qt_robot/gesture/play

'std_msgs/String' (gesture name)

Play a robot gesture given by its name

Services

Interface Name

Service Name

Parameters

Description

/qt_robot/gesture/play

'gesture_play'

'name', 'speed'

Play a robot gesture given by its name and speed (default 0.5)

(!) The default value for speed is 0.5 and it is the default speed with which the gesture got recorded.

/!\ Notice: if the speed param value is 0 the default speed will be used to play the gestures.


Behavior Interface

This interface implements higher-level and more complex behaviors by combing robot basic functionality.

Subscribers

Interface Name

Data Type

Description

/qt_robot/behavior/talkText

'std_msgs/String' (message)

Read a text using TTS and show talking emotion

/qt_robot/behavior/talkAudio

'std_msgs/String' (audio filename)

Play an audio file and show talking emotion

Services

Interface Name

Service Name

Parameters

Description

/qt_robot/behavior/talkText

'behavior_talk_text'

'message'

Read a text using TTS and show talking emotion

/qt_robot/behavior/talkAudio

'behavior_talk_audio'

'filename', 'filepath'

Play an audio file and show talking emotion

/!\ Notice: The talkAudio and talkText services are mutually exclusive and cannot be used with Emotion Interface at the same time.

(!) To play the audio file from the default path, pass an empty string to filepath param.

Examples

python example demonstrates how to use each interfaces using ROS publish/subscribe and service/client calls.

   1 #!/usr/bin/env python
   2 import sys
   3 import rospy
   4 from std_msgs.msg import String
   5 from qt_robot_interface.srv import *
   6 
   7 # the following activities will run in parallel on the robot
   8 # with no execution order
   9 def publishAllCuncurent():
  10     audioPlay_pub.publish("Qt2.wav")
  11     speechSay_pub.publish("Hello! This is QT talking using text to speech")
  12     gesturePlay_pub.publish("happy")
  13     emotionShow_pub.publish("ava_happy")
  14     behaviorTalkText_pub.publish("I am QT robot! ")
  15     behaviorTalkAudio_pub.publish("Qt3.wav")
  16 
  17 # the following activities will run in sequence on the robot
  18 # one after another
  19 def callAllSequence():
  20     audioPlay("Qt2.wav", "")
  21     speechSay("Hello! This is QT talking using text to speech")
  22     gesturePlay("happy", 0)
  23     emotionShow("ava_happy")
  24     behaviorTalkText("I am QT robot!")
  25     behaviorTalkAudio("Qt3.wav", "");
  26 
  27 
  28 if __name__ == '__main__':
  29     rospy.init_node('python_qt_example')
  30 
  31     # create a publisher
  32     speechSay_pub = rospy.Publisher('/qt_robot/speech/say', String, queue_size=10)
  33     audioPlay_pub = rospy.Publisher('/qt_robot/audio/play', String, queue_size=10)
  34     emotionShow_pub = rospy.Publisher('/qt_robot/emotion/show', String, queue_size=10)
  35     gesturePlay_pub = rospy.Publisher('/qt_robot/gesture/play', String, queue_size=10)
  36     behaviorTalkText_pub = rospy.Publisher('/qt_robot/behavior/talkText', String, queue_size=10)
  37     behaviorTalkAudio_pub = rospy.Publisher('/qt_robot/behavior/talkAudio', String, queue_size=10)
  38 
  39     # wait for publisher/subscriber connections
  40     wtime_begin = rospy.get_time()
  41     while (speechSay_pub.get_num_connections() == 0 or
  42            audioPlay_pub.get_num_connections() == 0 or
  43            emotionShow_pub.get_num_connections() == 0 or
  44            gesturePlay_pub.get_num_connections() == 0 or
  45            behaviorTalkText_pub.get_num_connections() == 0 or
  46            behaviorTalkAudio_pub.get_num_connections() == 0 ) :
  47 
  48         rospy.loginfo("waiting for subscriber connections")
  49         if rospy.get_time() - wtime_begin > 5.0:
  50             rospy.logerr("Timeout while waiting for subscribers connection!")
  51             sys.exit()
  52         rospy.sleep(1)
  53 
  54     # create some service clients
  55     audioPlay = rospy.ServiceProxy('/qt_robot/audio/play', audio_play)
  56     speechSay = rospy.ServiceProxy('/qt_robot/speech/say', speech_say)
  57     gesturePlay = rospy.ServiceProxy('/qt_robot/gesture/play', gesture_play)
  58     emotionShow = rospy.ServiceProxy('/qt_robot/emotion/show', emotion_show)
  59     behaviorTalkText = rospy.ServiceProxy('/qt_robot/behavior/talkText', behavior_talk_text)
  60     behaviorTalkAudio = rospy.ServiceProxy('/qt_robot/behavior/talkAudio', behavior_talk_audio)
  61 
  62     # wait for some services and connection to subscribers
  63     rospy.loginfo("waiting for services connections")
  64     rospy.wait_for_service('/qt_robot/gesture/play')
  65     rospy.wait_for_service('/qt_robot/emotion/show')
  66     rospy.wait_for_service('/qt_robot/audio/play')
  67     rospy.wait_for_service('/qt_robot/speech/say')
  68     rospy.wait_for_service('/qt_robot/behavior/talkText')
  69     rospy.wait_for_service('/qt_robot/behavior/talkAudio')
  70 
  71     rospy.loginfo("ready...")
  72     try:
  73         callAllSequence()
  74         publishAllCuncurent()
  75         # rospy.spin()
  76     except rospy.ROSInterruptException:
  77         pass

Wiki: Robots/qtrobot (last edited 2018-08-01 12:23:26 by apaikan)