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

Source Code for Module robot_script.test

 1  #!/usr/bin/env python 
 2   
 3  from robot_scripting import PR2RobotScript as pr2 
 4  from robot_scripting import aboutEq 
 5  import rospy 
 6  import sys 
 7   
 8  LEFT  = pr2.LEFT 
 9  RIGHT = pr2.RIGHT 
10  BOTH  = pr2.BOTH 
11   
12  #if aboutEq('torso_lift_joint', 0): 
13  #    pr2.setTorso(10) 
14  #else: 
15  #    pr2.setTorso(0) 
16   
17  if aboutEq('head_tilt_joint', 30): 
18      pr2.lookAt(-100, -20 , 5, wait=False) 
19  else: 
20      pr2.lookAt(+100, +30 , 5, wait=False) 
21   
22  #if aboutEq('head_tilt_joint', 30): 
23  #    #pr2.tiltHead(-20,5, wait=True) 
24  #    pr2.tiltHead(-20,5, wait=False) 
25  ##    pr2.panHead(-100,5, wait=False) 
26  #    print "Head tilt to -20 done;" 
27  #else: 
28  #    #pr2.tiltHead(+30,5, wait=True) 
29  #    pr2.tiltHead(+30,5, wait=False) 
30  ##    pr2.panHead(+100,5, wait=False) 
31  #    print "Head tilt to +30 done;" 
32  #for i in range(40): 
33  #    print str(pr2.getSensorReading('head_tilt_joint')) 
34