The manager module for the Red-Ball Demo developed by IIT and ISR.
The manager module for the Red-Ball Demo developed by IIT and ISR.
Copyright (C) 2010 RobotCub Consortium Author: Ugo Pattacini, Alessandro Roncone
CopyPolicy: Released under the terms of the GNU GPL v2.0.
Description
This module collects the 3-d object positions estimated by the particle filter and sends data to the head and arm controllers in order to gaze at the target, reach for it and eventually grasp it. It relies on the YARP ICartesianControl interface to control both arms and on the YARP IGazeControl interface to control the gaze.
Furthermore, there exists a second modality that enables to estimate the 3-d object position using stereo vision that needs to be calibrated in advance relying on a feed-forward neural network.
Finally, a simulation modality is available to run the demo within gazebo.
Libraries
- ctrlLib.
- iKin.
- YARP libraries.
Parameters
None.
Ports Accessed
The robot interface is assumed to be operative; in particular, the ICartesianControl interface must be available. The iKinGazeCtrl must be running.
In order to run the demo in simulation, such modules can be run with --context gazeboCartesianControl
. A template is also available in the folder app/scripts/demoRedBall_gazebo.xml.template.
Ports Created
- /demoRedBall/trackTarget:i receives the 3-d position to track.
- /demoRedBall/imdTargetLeft:i receives the blobs list as produced by the motionCUT module for the left eye.
- /demoRedBall/imdTargetRight:i receives the blobs list as produced by the motionCUT module for the right eye.
- /demoRedBall/cmdFace:o sends out commands to the face expression high level interface in order to give an emotional representation of the current robot state.
- /demoRedBall/speech:o sends a set of predefined sentences in order for an eventual TTS module to use them during the demo. This feature successfully works with the iSpeak module. The set of predefined sentences to be spoken is defined via .ini file.
- /demoRedBall/breather/head:rpc interfaces with the head breather (if available) and disables/enables it according when needed
- /demoRedBall/breather/left_arm:rpc interfaces with the left arm breather (if available) and disables/enables it according when needed
- /demoRedBall/breather/right_arm:rpc interfaces with the right arm breather (if available) and disables/enables it according when needed
- /demoRedBall/blinker:rpc interfaces with the iCubBlinker module (if available) and disables/enables it according when needed
- /demoRedBall/lookSkin:rpc interfaces with the lookSkin module (if available) and disables/enables it according when needed
- /demoRedBall/gui:o sends out info to update target within the icub_gui
- /demoRedBall/gazebo:o interfaces with the ball model in gazebo
- /demoRedBall/rpc remote procedure call. Recognized remote commands: -'quit' quit the module
Input Data Files
None.
Output Data Files
None.
Configuration Files
The configuration file passed through the option –from should look like as follows:
[general]
robot icub
thread_period 30
left_arm on
right_arm on
traj_time 2.0
reach_tol 0.01
eye left
idle_tmo 5.0
use_network off
network network.ini
speech on
simulation off
[torso]
pitch on (max 30.0)
roll off
yaw on
[left_arm]
grasp_enable on
reach_offset 0.0 -0.15 -0.05
grasp_offset 0.0 0.0 -0.05
hand_orientation 0.064485 0.707066 0.704201 3.140572
impedance_velocity_mode off
impedance_stiffness 0.5 0.5 0.5 0.2 0.1
impedance_damping 60.0 60.0 60.0 20.0 0.0
[right_arm]
grasp_enable on
reach_offset 0.0 0.15 -0.05
grasp_offset 0.0 0.0 -0.05
hand_orientation -0.012968 -0.721210 0.692595 2.917075
impedance_velocity_mode off
impedance_stiffness 0.5 0.5 0.5 0.2 0.1
impedance_damping 60.0 60.0 60.0 20.0 0.0
[home_arm]
poss -30.0 30.0 0.0 45.0 0.0 0.0 0.0
vels 10.0 10.0 10.0 10.0 10.0 10.0 10.0
[arm_selection]
hysteresis_thres 0.1
[grasp]
sphere_radius 0.05
sphere_tmo 3.0
release_tmo 3.0
open_hand 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
close_hand 0.0 80.0 12.0 18.0 27.0 50.0 20.0 50.0 135.0
vels_hand 10.0 10.0 10.0 10.0 10.0 10.0 10.0 10.0 10.0
[include speech "speech_English.ini"]
The latter inclusion is the .ini file needed for the predefined set of sentences to be spoken. The speech during the red ball demo is divided into three states:
- [speech_reach] -> it is used when the robot "sees" the ball, and is trying to reach it
- [speech_grasp] -> is performed after the grasping action (regardless of its success/failure)
- [speech_idle] -> is used after the red ball is pulled away from the robot's sight For each of these states, there is a group in the .ini file. Each line is a sentence that will be spoken by the robot according to its state. Add as many sentences (i.e. lines) as you'd like to these groups: they will be chosen randomly by the manager at runtime. The speech file should look as follows:
[speech_reach]
"Oh.! There it is!!"
"Stay still, otherwise I can't catch it!"
"Give me the red ball!"
"Red ball is my precious... Give it to me!"
"Wait!! I want that ball!"
[speech_grasp]
"Thank you dear"
"Did I take it?"
"I like playing with the red ball!"
"Yippi ka yeah!"
[speech_idle]
"Oh no! I want to play with the red ball again!"
"I want the red ball to be my wife"
"Playing with the red ball makes me happy, let's do it again."
"I don't feel tired, let's play again."
"Oh my Gosh!! Where's the red ball??"
Available commands
To run the demo in gazebo, the following commands can be used:
start
[azi ele ver]: to start the demo; optionally, one can provide the position where the robot initially needs to gaze at.
stop
: to stop the demo
update_pose dx dy dz
: to update the ball position with respect to the initial position defined in the world.
Note that on the real robot the demo automatically starts.
Tested OS
Windows, Linux
- Author
- Ugo Pattacini, Alessandro Roncone