Documentation of pyRobots actions and helpers
Automatically generated from pyRobots source on February 27, 2014
Contents
Actions
Category administration
Action configure_grippers
Action <configure_grippers> does not specify platform requirements
- Sets the grippers thresholds.
Parameters
grab_acc: threshold for grab detection
grab_slip: threshold for grab detection
release_acc: threshold for release detection
release_slip: threshold for release detection
force: hold force
Example:
1 import robots
2 pr2 = robots.PR2() # Pass 'dummy=True' to test without the real robot
3
4 grab_acc = GRAB_ACC # define here a grab_acc
5 grab_slip = GRAB_SLIP # define here a grab_slip
6 release_acc = RELEASE_ACC # define here a release_acc
7 release_slip = RELEASE_SLIP # define here a release_slip
8 force = FORCE # define here a force
9 pr2.configure_grippers(grab_acc, grab_slip, release_acc, release_slip, force)
Action display
Action <display> does not specify platform requirements
- Allows to select which software window is displayed by the robot.
- Requires:
- - laaswm as windows manager - laaswm.py installed (available from laaswm-libs repository)
- Requires:
Parameters
window: name (or part of the name) of the window to put
- on front. Case insensitive.
host: the LAASWM host (default: localhost)
Example:
Action init
Action <init> does not specify platform requirements
- Initialize modules in correct order.
Modules whose initialization is reentrant (ie, init code can be safely called twice) are enabled by default.
Example:
Action lock_object
Action <lock_object> does not specify platform requirements
- Lock to position of an object in SPARK. It won't be updated
- anymore.
Parameters
object: The ID of the object to lock.
Example:
Action settorso
Action <settorso> does not specify platform requirements
- Set the PR2 torso height.
Parameters
height: The height of the torso, in meters. Defaults to 0.15
- cm. Height is clamped into [0, 30].
callback: (optional) If given, the action is non-blocking,
- and the callback is invoked at the activity completion.
Example:
Action setup_scenario
Action <setup_scenario> does not specify platform requirements
- Allows to load a custom scene configuration ('sce' files) in SPARK
- at runtime.
Parameters
scenario: The complete path to a valid scenario file ('.sce')
Example:
Action unlock_object
Action <unlock_object> does not specify platform requirements
- Unlock to position of an object in SPARK. It will be updated
- when seen.
Parameters
object: The ID of the object to unlock.
Example:
Action wait
Action <wait> does not specify platform requirements
- This special action simply waits for a given amount of second before
- sending the next action.
Parameters
seconds: the time to wait, in seconds
Example:
Category configuration
Action disabledevileye
Action <disabledevileye> requires ROS].
Example:
Action enabledevileye
Action <enabledevileye> requires ROS].
Example:
Action extractpose
Action <extractpose> does not specify platform requirements
- Quick method to set the PR2 joints in "extraction" configuration. In "extractaction" configuration, the robot's right hand is next to the shoulder, far from the table. Useful to prevent collisions when moving near to the tables.
Parameters
callback: (optional) If given, the action is non-blocking, and the callback is
- invoked at the activity completion.
Example:
Action idle
/!\ Action currently broken!
Action <idle> does not specify platform requirements
- action to do when nothing to do.
Parameters
choice: default to -1, this param make it possible to choose
the action to do. if choice>10 or choice<0 the action to do is randomly choosed.
callback: (optional) If given, the action is non-blocking, and the callback is
- invoked at the activity completion.
Example:
Action manipose
Action <manipose> requires either [NaoQI] or [Pocolibs (with mhp, pr2SoftMotion)] or [Pocolibs (with mhp, lwr)].
- Quick method to set the PR2 joints in "manip" configuration. This posture is designed for the robot to easily move around with an object in its right hand.
Parameters
no_head: (default: true) If true, only arms and torso will set a new configuration.
Very useful if you track an object.
callback: (optional) If given, the action is non-blocking, and the callback is
- invoked at the activity completion.
Example:
Action movearm
Action <movearm> requires either [NaoQI] or [ROS].
- Moves one of the robot arms to a pose.
Parameters
target: the destination for the arm wrist
Example:
Action pointsat
Action <pointsat> requires either [NaoQI] or [ROS].
Example:
Action rest
Action <rest> requires either [NaoQI] or [Pocolibs (with mhp, pr2SoftMotion)] or [Pocolibs (with mhp, lwr)].
Quick method to set the robot joints in rest configuration. You have the choice with three rest configuration. This choice is random.
Parameters
no_head: (optional) If true, only arms and torso will set a new configuration.
Very useful if you track an object.
callback: (optional) If given, the action is non-blocking, and the callback is
- invoked at the activity completion.
Example:
Action restpose
Action <restpose> requires either [NaoQI] or [Pocolibs (with mhp, pr2SoftMotion)] or [Pocolibs (with mhp, lwr)].
Example:
Action setpose
Action <setpose> requires either [NaoQI] or [Pocolibs (with mhp, pr2SoftMotion)] or [Pocolibs (with mhp, lwr)].
- Set the robot base and internal joints in a given configuration. Beware: if collision_avoidance is not set to True, not collision detection is done. This can result in a dangerous robot behaviour. Note also that collision avoidance is available for the right arm only. While you can set the global position of the PR2 robot with this action, please
use goto in the 'nav' category for obstacle aware navigation.
If posture = {} and part = 'PR2', all parameters take 0 for value
Parameters
posture: a posture, ie, a dictionary built as follow:
Key BASE: array of 6 floats [x,y,z,rx,ry,rz], in meters and in radians. The position is given in the world frame.
Key RARM: array of 7 joint angles for the right arm, in radians,
Key LARM: array of 7 joint angles for the left arm, in radians,
Key TORSO: the height of the torso ([0-30]), in centimeters,
Key HEAD: array of pan and tilt values, in radians,
- Note that none of the items of the dictionary are mandatory. If no robot part is selected (see the 'part' parameter below), the smallest set of part is selected that allow execution of the pose. 'posture' may also be the name of a pre-recorded posture, as available from the posture library (cf helpers/postures.py) or other robot-dependent prerecorded postures.
part: (optional) force only a certain part of the PR2 to execute to posture.
- Allowed values: 'BASE', 'RARM', 'LARM', 'ARMS', 'PR2', 'PR2SYN', 'TORSO', 'PR2NOHEAD', 'HEAD'
collision_avoidance: (optional), If true, the robot will be consider obstacles
- in its environment. If true, you have to precise part = 'RARM'.
relative: (default: False) if set to true, the posture is considered as
- being relative to the current configuration.
obj: (optional) set which objet the robot has to avoid during the movement.
- You can give only one object.
support: (optional) set which support the robot has to avoid during the movement.
- You can give only one support.
callback: (optional) If given, the action is non-blocking, and the callback is
- invoked at the activity completion.
Example:
1 import robots
2 nao = robots.Nao() # Pass 'dummy=True' to test without the real robot
3
4 posture = POSTURE # define here a posture
5 part = PART # define here a part
6 collision_avoidance = COLLISION_AVOIDANCE # define here a collision_avoidance
7 relative = RELATIVE # define here a relative
8 obj = OBJ # define here a obj
9 support = SUPPORT # define here a support
10 callback = CALLBACK # a function (or functor) to call when the action is done
11 nao.setpose(posture, part, collision_avoidance, relative, obj, support, callback)
Action settorso
Action <settorso> does not specify platform requirements
- Set the PR2 torso height.
Parameters
height: The height of the torso, in meters. Defaults to 0.15
- cm. Height is clamped into [0, 30].
callback: (optional) If given, the action is non-blocking,
- and the callback is invoked at the activity completion.
Example:
Action tuckedpose
Action <tuckedpose> does not specify platform requirements
- Tucks the robot arms.
Parameters
callback: (optional) If given, the action is non-blocking, and the callback is
- invoked at the activity completion.
no_head: (optional) If true, only arms and torso will set a new configuration.
Very useful if you track an object
Example:
Category manipulation
Action amit_give
Action <amit_give> does not specify platform requirements
Example:
Action attachobject
Action <attachobject> does not specify platform requirements
- attach or detach the object to the robot hand
- This function should be called after a release or a grab
Parameters
obj: the object to attach/dettach.
attach: true (default) to attach an object, false to detach it
Example:
Action basicgive
Action <basicgive> does not specify platform requirements
- The ultra stupid basic GIVE: simply hand the object in front of the
- robot.
After handing the object, the robot waits for someone to take it, and stay in this posture.
- robot.
Example:
Action basictake
Action <basictake> requires either [NaoQI] or [Pocolibs (with pr2SoftMotion)].
- The ultra stupid basic TAKE: simply hand the object in front of the
- robot.
Example:
Action close_gripper
Action <close_gripper> requires either [NaoQI] or [Pocolibs (with pr2SoftMotion)].
- Closes the right gripper.
- If pr2SoftMotion-genom is available, it tries with it. Else it tries with fingers-genom. Parameter 'gripper' is ignored when using fingers-genom. :see: grab_gripper
Parameters
gripper: "right" (default) or "left"
callback: if set, the action is non-blocking and the callback is invoked upon completion
Example:
Action configure_grippers
Action <configure_grippers> does not specify platform requirements
- Sets the grippers thresholds.
Parameters
grab_acc: threshold for grab detection
grab_slip: threshold for grab detection
release_acc: threshold for release detection
release_slip: threshold for release detection
force: hold force
Example:
1 import robots
2 pr2 = robots.PR2() # Pass 'dummy=True' to test without the real robot
3
4 grab_acc = GRAB_ACC # define here a grab_acc
5 grab_slip = GRAB_SLIP # define here a grab_slip
6 release_acc = RELEASE_ACC # define here a release_acc
7 release_slip = RELEASE_SLIP # define here a release_slip
8 force = FORCE # define here a force
9 pr2.configure_grippers(grab_acc, grab_slip, release_acc, release_slip, force)
Action grab_gripper
Action <grab_gripper> requires either [NaoQI] or [Pocolibs (with pr2SoftMotion)].
- Closes the gripper to grab something. Like gripper_close, except it waits until it senses some effort on the gripper force sensors, and tries to appliy a force suitable to hold something. :see: close_gripper
Parameters
gripper: "right" (default) or "left"
Example:
Action handover
Action <handover> does not specify platform requirements
- Computes and executes a move for a 'hand-over': given a
- human, the robot finds a trajectory and a pose to go and hand the object in its right hand to the human.
The efforts can be shared between the human and the robot with the 'mobility' parameter. Note that the object is assumed to be already in the hand.
- human, the robot finds a trajectory and a pose to go and hand the object in its right hand to the human.
Parameters
human: the human (SPARK ID) to hand an object over.
mobility: the level of mobility of the human. 0.0 means
feedback: (optional) a callback that is invoked as the
Example:
Action hide
/!\ Action currently broken!
Action <hide> does not specify platform requirements
Example:
Action open_gripper
Action <open_gripper> requires either [NaoQI] or [Pocolibs (with pr2SoftMotion)].
- Opens a gripper. If pr2SoftMotion-genom is available, it tries with it. Else it tries with fingers-genom. Parameter 'gripper' is ignored when using fingers-genom. :see: release_gripper
Parameters
gripper: "right" (default) or "left"
callback: if set, the action is non-blocking and the callback is invoked upon completion
Example:
Action pick
Action <pick> does not specify platform requirements
- Picks an object that is reachable by the robot.
- Uses MHP to plan a trajectory. The trajectory is executed with by pr2SoftMotion-genom if available, else with lwr-genom if available, else oonly exported to the mhpArmTraj poster.
Parameters
object: the object to pick.
Example:
Action put
Action <put> does not specify platform requirements
- Put an object on a given support
- Uses MHP to plan a trajectory. The trajectory is executed with by pr2SoftMotion-genom if available, else with lwr-genom if available, else oonly exported to the mhpArmTraj poster.
Parameters
object: the object to put.
support: the support to put the object
Example:
Action put_accessible
Action <put_accessible> does not specify platform requirements
- Grasps + shows the object to a 'receiver'
Example:
Action release_gripper
Action <release_gripper> requires either [NaoQI] or [Pocolibs (with pr2SoftMotion)].
- Opens the gripper to release something. Like gripper_open, except it waits until it senses some effort on the gripper force sensors. :see: open_gripper
Parameters
gripper: "right" (default) or "left"
Example:
Action show
Action <show> does not specify platform requirements
- Grasps + shows the object to a 'receiver'
Example:
Action take
Action <take> does not specify platform requirements
Go to the human and take an object.
- Uses the OTP algorithm to find a path + posture to
take an object from the human.
- Uses the OTP algorithm to find a path + posture to
Example:
Category games
Action alternative_handsup_folded
Action <alternative_handsup_folded> does not specify platform requirements
Example:
Action arms_against_torso
Action <arms_against_torso> does not specify platform requirements
Example:
Action basket
Action <basket> does not specify platform requirements
Example:
Action gym
Action <gym> does not specify platform requirements
Example:
Action handsup
Action <handsup> does not specify platform requirements
Example:
Action handsup_folded
Action <handsup_folded> does not specify platform requirements
Example:
Action larm_swinging
Action <larm_swinging> does not specify platform requirements
Example:
Action move_head
Action <move_head> does not specify platform requirements
Example:
Action rarm_swinging
Action <rarm_swinging> does not specify platform requirements
Example:
Action slow_arms_swinging
Action <slow_arms_swinging> does not specify platform requirements
Example:
Action speed_arms_swinging
Action <speed_arms_swinging> does not specify platform requirements
Example:
Action wait
Action <wait> does not specify platform requirements
- This special action simply waits for a given amount of second before
- sending the next action.
Parameters
seconds: the time to wait, in seconds
Example:
Category nav
Action cancel_follow
Action <cancel_follow> does not specify platform requirements
If running, interrupt a current follow action.
Example:
Action carry
Action <carry> does not specify platform requirements
- Moves to a place, taking into account door crossing.
- If the robot needs to cross a door, it will stop in front of the door, tuck its arms, cross the door, untuck the arms and complete its route. TODO: This action is currently completely hardcoded, and will work only for the Novela scenario.
Parameters
target: the destination, as a dictionary {x,y,z,qx,qy,qz,qw}.
callback: (optional) a callback to be called when the destination
- is reached. If nothing is provided, the action blocks until the destination is reached.
Example:
Action follow
Action <follow> does not specify platform requirements
- Follows a target until cancelled.
- Every 3 seconds, it re-evaluate the pose of the target, and move to it. This is a background action. Can be cancelled with cancel_follow.
Parameters
target: a pyRobots pose to follow. At each step, the pose is re-evaluated is needed (eg for a TF frame or a SPARK object)
Example:
Action goto
Action <goto> does not specify platform requirements
- Moves the robot base to a given target, using ROS 2D navigation stack.
- Only (x,y,theta), ie (x, y, qw, qz), are considered for the target. All other values are ignored.
Parameters
target: the destination, as a valid pyRobots position.
callback: (optional) a callback to be called when the destination
- is reached. If nothing is provided, the action blocks until the destination is reached.
feedback: (optional) a callback that is called at regular intervals
- with an update of the current robot position
Example:
1 import robots
2 pr2 = robots.PR2() # Pass 'dummy=True' to test without the real robot
3
4 target = TARGET # a final position ([x,y,z], [x,y,z,qx,qy,qz,qw], a SPARK object or a ROS frame)
5 callback = CALLBACK # a function (or functor) to call when the action is done
6 feedback = FEEDBACK # define here a feedback
7 pr2.goto(target, callback, feedback)
Action moveclose
Action <moveclose> does not specify platform requirements
- Moves towards a target, stopping close to it.
- Underneath, it uses the ROS 2D navigation stack. Only (x,y,theta), ie (x, y, qw, qz), are considered for the target. All other values are ignored.
Parameters
target: the destination, as a valid pyRobots position.
distance: the distance from the target, in meter, where to stop.
callback: (optional) a callback to be called when the destination
- is reached. If nothing is provided, the action blocks until the destination is reached.
feedback: (optional) a callback that is called at regular intervals
- with an update of the current robot position
Example:
1 import robots
2 pr2 = robots.PR2() # Pass 'dummy=True' to test without the real robot
3
4 target = TARGET # a final position ([x,y,z], [x,y,z,qx,qy,qz,qw], a SPARK object or a ROS frame)
5 distance = DISTANCE # define here a distance
6 callback = CALLBACK # a function (or functor) to call when the action is done
7 feedback = FEEDBACK # define here a feedback
8 pr2.moveclose(target, distance, callback, feedback)
Action waypoints
Action <waypoints> does not specify platform requirements
- Moves the robot base along a set of waypoints, using ROS 2D navigation
- stack (and the LAAS 'waypoints' ROS node).
Parameters
waypoints: a set of locations (any valid pyRobot pose).
callback: (optional) a callback to be called when the final destination
- is reached. If nothing is provided, the action blocks until the destination is reached.
feedback: (optional) a callback to be called each time the feedback topic of the waypoint is updated (ie, every few percent of trajectory accomplishment).
Example:
1 import robots
2 pr2 = robots.PR2() # Pass 'dummy=True' to test without the real robot
3
4 waypoints = WAYPOINTS # a list of positions ([x,y,z], [x,y,z,qx,qy,qz,qw], a SPARK object or a ROS frame)
5 callback = CALLBACK # a function (or functor) to call when the action is done
6 feedback = FEEDBACK # define here a feedback
7 pr2.waypoints(waypoints, callback, feedback)
Category look_at
Action cancel_track
Action <cancel_track> requires either [NaoQI] or [Pocolibs (with platine)] or [Pocolibs (with pr2SoftMotion)].
If running, interrupt a current track action.
Example:
Action glance_to
Action <glance_to> requires either [NaoQI] or [Pocolibs (with platine)] or [Pocolibs (with pr2SoftMotion)].
- Briefly look at a given location, and come back to the
- currently pose.
Example:
Action look_at
Action <look_at> requires either [NaoQI] or [Pocolibs (with platine)] or [Pocolibs (with pr2SoftMotion)].
Example:
Action look_at_ros
/!\ Action currently broken!
Action <look_at_ros> requires ROS (with /head_traj_controller/point_head_action)].
- Create the client and the goal.
Parameters
place: a dictionary which contains object position parameters.
Cf look_at for details.
Example:
Action look_at_xyz_with_moveHead
Action <look_at_xyz_with_moveHead> does not specify platform requirements
- Look at via pr2SoftMotion.
Parameters
x: the x coordinate
y: the y coordinate
z: the z coordinate
frame: the frame in which coordinates are interpreted. By default, '/map'
Example:
Action lookat
Action <lookat> requires either [NaoQI] or [Pocolibs (with platine)] or [Pocolibs (with pr2SoftMotion)].
- Orders the robot to look at a given place of object.
- If available, uses pr2SoftMotion::moveHead. Else tries with the platine-genom module.
Parameters
place: any valid pyrobots place (spark id, ROS frame, [x,y,z],...)
Example:
Action setpose
Action <setpose> requires either [NaoQI] or [Pocolibs (with mhp, pr2SoftMotion)] or [Pocolibs (with mhp, lwr)].
- Set the robot base and internal joints in a given configuration. Beware: if collision_avoidance is not set to True, not collision detection is done. This can result in a dangerous robot behaviour. Note also that collision avoidance is available for the right arm only. While you can set the global position of the PR2 robot with this action, please
use goto in the 'nav' category for obstacle aware navigation.
If posture = {} and part = 'PR2', all parameters take 0 for value
Parameters
posture: a posture, ie, a dictionary built as follow:
Key BASE: array of 6 floats [x,y,z,rx,ry,rz], in meters and in radians. The position is given in the world frame.
Key RARM: array of 7 joint angles for the right arm, in radians,
Key LARM: array of 7 joint angles for the left arm, in radians,
Key TORSO: the height of the torso ([0-30]), in centimeters,
Key HEAD: array of pan and tilt values, in radians,
- Note that none of the items of the dictionary are mandatory. If no robot part is selected (see the 'part' parameter below), the smallest set of part is selected that allow execution of the pose. 'posture' may also be the name of a pre-recorded posture, as available from the posture library (cf helpers/postures.py) or other robot-dependent prerecorded postures.
part: (optional) force only a certain part of the PR2 to execute to posture.
- Allowed values: 'BASE', 'RARM', 'LARM', 'ARMS', 'PR2', 'PR2SYN', 'TORSO', 'PR2NOHEAD', 'HEAD'
collision_avoidance: (optional), If true, the robot will be consider obstacles
- in its environment. If true, you have to precise part = 'RARM'.
relative: (default: False) if set to true, the posture is considered as
- being relative to the current configuration.
obj: (optional) set which objet the robot has to avoid during the movement.
- You can give only one object.
support: (optional) set which support the robot has to avoid during the movement.
- You can give only one support.
callback: (optional) If given, the action is non-blocking, and the callback is
- invoked at the activity completion.
Example:
1 import robots
2 nao = robots.Nao() # Pass 'dummy=True' to test without the real robot
3
4 posture = POSTURE # define here a posture
5 part = PART # define here a part
6 collision_avoidance = COLLISION_AVOIDANCE # define here a collision_avoidance
7 relative = RELATIVE # define here a relative
8 obj = OBJ # define here a obj
9 support = SUPPORT # define here a support
10 callback = CALLBACK # a function (or functor) to call when the action is done
11 nao.setpose(posture, part, collision_avoidance, relative, obj, support, callback)
Action sweep
Action <sweep> requires either [NaoQI] or [Pocolibs (with platine)] or [Pocolibs (with pr2SoftMotion)].
Makes a sweep movement with the robot head via pr2SoftMotion compared with its current position
Parameters
amplitude: Number of degrees of the sweeping head movement (default:
- 90 deg)
speed: Speed of the movement (default: 0.2)
Example:
Action switch_active_stereo_pair
Action <switch_active_stereo_pair> requires ROS].
Example:
Action track
Action <track> requires either [NaoQI] or [Pocolibs (with platine)] or [Pocolibs (with pr2SoftMotion)].
- Tracks an object with the head.
- This uses pr2SoftMotion. This is a background action. Can be cancelled with cancel_track.
Parameters
target: a pyRobots pose to track. At each step, the pose is re-evaluated is needed (eg for a TF frame or a SPARK object)
Example:
Category primitive_nav
Action dock
Action <dock> does not specify platform requirements
Example:
Action rotate
/!\ Action currently broken!
Action <rotate> does not specify platform requirements
Get the robot to turn on itself of the given angle
- (relatively to its current heading). Be careful: this low-level action does NO obstacle avoidance. Currently broken: the GotoQ request does not behave as expected.
Parameters
theta: an angle in radian
Example:
Action setpose
Action <setpose> requires either [NaoQI] or [Pocolibs (with mhp, pr2SoftMotion)] or [Pocolibs (with mhp, lwr)].
- Set the robot base and internal joints in a given configuration. Beware: if collision_avoidance is not set to True, not collision detection is done. This can result in a dangerous robot behaviour. Note also that collision avoidance is available for the right arm only. While you can set the global position of the PR2 robot with this action, please
use goto in the 'nav' category for obstacle aware navigation.
If posture = {} and part = 'PR2', all parameters take 0 for value
Parameters
posture: a posture, ie, a dictionary built as follow:
Key BASE: array of 6 floats [x,y,z,rx,ry,rz], in meters and in radians. The position is given in the world frame.
Key RARM: array of 7 joint angles for the right arm, in radians,
Key LARM: array of 7 joint angles for the left arm, in radians,
Key TORSO: the height of the torso ([0-30]), in centimeters,
Key HEAD: array of pan and tilt values, in radians,
- Note that none of the items of the dictionary are mandatory. If no robot part is selected (see the 'part' parameter below), the smallest set of part is selected that allow execution of the pose. 'posture' may also be the name of a pre-recorded posture, as available from the posture library (cf helpers/postures.py) or other robot-dependent prerecorded postures.
part: (optional) force only a certain part of the PR2 to execute to posture.
- Allowed values: 'BASE', 'RARM', 'LARM', 'ARMS', 'PR2', 'PR2SYN', 'TORSO', 'PR2NOHEAD', 'HEAD'
collision_avoidance: (optional), If true, the robot will be consider obstacles
- in its environment. If true, you have to precise part = 'RARM'.
relative: (default: False) if set to true, the posture is considered as
- being relative to the current configuration.
obj: (optional) set which objet the robot has to avoid during the movement.
- You can give only one object.
support: (optional) set which support the robot has to avoid during the movement.
- You can give only one support.
callback: (optional) If given, the action is non-blocking, and the callback is
- invoked at the activity completion.
Example:
1 import robots
2 nao = robots.Nao() # Pass 'dummy=True' to test without the real robot
3
4 posture = POSTURE # define here a posture
5 part = PART # define here a part
6 collision_avoidance = COLLISION_AVOIDANCE # define here a collision_avoidance
7 relative = RELATIVE # define here a relative
8 obj = OBJ # define here a obj
9 support = SUPPORT # define here a support
10 callback = CALLBACK # a function (or functor) to call when the action is done
11 nao.setpose(posture, part, collision_avoidance, relative, obj, support, callback)
Action translate
Action <translate> does not specify platform requirements
Move the robot base in XY, relatively to its current position.
- Be careful: this low-level action does NO obstacle avoidance. ROS version is a Python translation of
http://www.ros.org/wiki/pr2_controllers/Tutorials/Using%20the%20base%20controller%20with%20odometry%20and%20transform%20information Currently broken: the GotoQ request does not behave as expected.
Parameters
x: X (forward/backward) displacement, in meter
y: (default: 0) Y (left/right) displacement, in meter
speed: speed, in m/s. Default: 0.1
Example:
Helpers
Category position
Helper distance
Helper not tested!
Returns the euclidian distance between two pyRobots poses.
Example:
Helper human
Helper not tested!
- Returns the pose of a human, either using Pocolibs' SPARK or ROS TF. If using SPARK, a body part may be specified (default to 'Pelvis'). For the head, the part is "HeadX".
If using ROS, we return the pose of a TF frame called 'face_<human>' or 'human_<human>'.
Example:
Helper inframe
Helper not tested!
- Transform a pose from one frame to another one.
- Uses transformation matrices. Could be refactored to use directly quaternions.
Example:
Helper myself
Helper not tested!
- Returns the current robot's pose, ie the pose of the ROS TF 'base_link' frame.
Example:
Category geometric_planning
Helper handover
Helper tested on the 14/06/2012
Computes a set of waypoints that allow the robot to reach a position
- suitable to transfer an object to a human.
Parameters
human: the name of the human that must be reached, as
- known by SPARK.
standing: if True, the human is considered as standing, if False
- as sitting.
mobility: ratio of displacement between the human and the robot.
Return value
- a list with two items:
- waypoints: the list of pyRobots poses (actually, a list of (x,y,theta)).
- pose: the body pose (right arm + torso) of the robot as a dictionary
(cf setpose documentation).
Example:
Helper manipulation
Helper not tested!
- Low-level action planner
Parameters
action: Possible actions. Cf the list of actions above.
obj: object that is acted upon
receiver: agent that will receive the action
performer: The agent that will perform the action
pick_first: (default: False) if true, first pick the object,
- then do the action. Else, assume the object is already in hand.
timeout: timeout (in second, default: 10) before giving up with the
- planning attempt
adapt_candidate_search_space_with_object: (default: false) Adapt the 'mightability' computation to the object's dimensions
- :returns: a plan ID, that is used to execute actual actions
Example:
1 import robots
2 nao = robots.Nao() # Pass 'dummy=True' to test without the real robot
3
4 action = ACTION # define here a action
5 obj = OBJ # define here a obj
6 receiver = RECEIVER # define here a receiver
7 performer = PERFORMER # define here a performer
8 pick_first = PICK_FIRST # define here a pick_first
9 timeout = TIMEOUT # define here a timeout
10 adapt_candidate_search_space_with_object = ADAPT_CANDIDATE_SEARCH_SPACE_WITH_OBJECT # define here a adapt_candidate_search_space_with_object
11 nao.manipulation(action, obj, receiver, performer, pick_first, timeout, adapt_candidate_search_space_with_object)
Category state
Helper distance2obstacle
Helper not tested!
- Returns the distance, in meters, to the closest obstacle facing the robot.
Example:
Helper fingerpressed
Helper not tested!
- For Nao, only returns if the fingers are (firmly) closed or not.
Parameters
gripper: the gripper, either 'left' or 'right'. By default, right.
Example:
Helper getjoint
Helper not tested!
- Returns the value (in radians) of a given joint (1 DoF) angle
Example:
Helper getpose
Helper not tested!
Returns to current whole-body joint state of the robot.
Example:
Helper hasinhand
Helper not tested!
Example:
Helper isseen
Helper not tested!
- Returns true if an object is currently seen by the
- robot. The exact semantics of "seen" depend on the robot and the type of object (human, artifact...) The general method relies on the knowledge base, but robot-specific state managers may override this behaviour.
Parameters
object: the ID of the object to check
- :returns: true if the object is visible, false otherwise.
Example:
Helper distance2obstacle
Helper not tested!
Example:
Helper fingerpressed
Helper not tested!
- Returns true if the pression sensors of the gripper (right by
- default) detect something. Warning: no real calibration made! This only takes one pressure sensor as input, and is based on experimental testing.
Example:
Helper getjoint
Helper not tested!
Example:
Helper getpose
Helper not tested!
Example:
Helper isseen
Helper not tested!
- Returns true if an object is currently seen by the
- robot. The semantics of "seen" can vary: in the current implementation, it means that the 2D ARToolkit tag has been seen in the last 2 seconds.
Parameters
object: the object (SPARK ID) to check
- :returns: true if the object is visible, false otherwise.
Example:
Helper distance2obstacle
Helper not tested!
- Returns the distance, in meters, to the closest obstacle facing the robot.
Example:
Helper fingerpressed
Helper not tested!
- Returns true if the (by default, right) gripper is 'holding' something.
- 'holding' semantics may be as simple as 'gripper closed' or more elaborate like 'the pressure sensors detect something'.
Raises NotImplementedError if this is not supported by the robot.
- 'holding' semantics may be as simple as 'gripper closed' or more elaborate like 'the pressure sensors detect something'.
Parameters
gripper: the gripper, either 'left' or 'right'. By default, right.
Example:
Helper getjoint
Helper not tested!
- Returns the value (in radians) of a given joint (1 DoF) angle
Example:
Helper getpose
Helper not tested!
- Get the full pose of the robot, as a dict.
- The list of possible parts is: {"HEAD":[pan, tilt],
- "TORSO":[height or bend], "RARM":[n dofs starting at shoulder], "LARM":[n dofs starting at shoulder] } Depending on the robot, some part may ne be available.
- The list of possible parts is: {"HEAD":[pan, tilt],
Example:
Helper isseen
Helper not tested!
- Returns true if an object is currently seen by the
- robot. The exact semantics of "seen" depend on the robot and the type of object (human, artifact...) The general method relies on the knowledge base, but robot-specific state managers may override this behaviour.
Parameters
object: the ID of the object to check
- :returns: true if the object is visible, false otherwise.
Example: