Package robot_script :: Module example
[hide private]
[frames] | no frames]

Module example

source code

List of available commands:

Gripper and Head:

Moving the arm joints one at a time, or together:

Moving the whole robot (the base):

Reading joint values:

Checking approximate joint value (when setting a joint to 0, it's often something like 0.0000134; aboutEq() does an approximate compare)

Raising/lowering the torso:

Temporarily pausing execution (but already initiated robot motions continue):

More examples:

ADVANCED USE: Simulated events impacting your script:

EVEN MORE ADVANCED USE:

The many 'if' statements below just ensure that the robot will do something different each time you run this file.

Functions [hide private]
 
printWord(word) source code
 
timeToDoSomething(word) source code
Variables [hide private]
  LEFT = pr2.LEFT
  RIGHT = pr2.RIGHT
  BOTH = pr2.BOTH
  torsoState = pr2.getSensorReading('torso_lift_joint')
  schedule = OrderedDict()
  mySimulator = EventSimulator()
  eventQueue = mySimulator.getEventQueue()