$search
00001 import rospy 00002 00003 def startWalkPose(motionProxy): 00004 numJoints = len(motionProxy.getJointNames('Body')) 00005 00006 allAngles = [ 00007 0.0076280385255813599, # HeadPitch 00008 0.019900038838386536, # HeadYaw 00009 1.8085440397262573, # LAnklePitch 00010 0.21165004372596741, # LAnkleRoll 00011 -1.4680800437927246, # LElbowRoll 00012 -0.52918803691864014, # LElbowYaw 00013 0.0091620385646820068, # LHand 00014 0.0011173889506608248, # LHipPitch 00015 0.001575961709022522, # LHipRoll 00016 0.024585962295532227, # LHipYawPitch 00017 -0.37885606288909912, # LKneePitch 00018 0.93723207712173462, # LShoulderPitch 00019 -0.56301999092102051, # LShoulderRoll 00020 -0.019900038838386536, # LWristYaw 00021 0.001575961709022522, # RAnklePitch 00022 0.024585962295532227, # RAnkleRoll 00023 -0.37893998622894287, # RElbowRoll 00024 0.9419180154800415, # RElbowYaw 00025 -0.55986803770065308, # RHand 00026 -0.024502038955688477, # RHipPitch 00027 1.8224339485168457, # RHipRoll 00028 -0.22247196733951569, # RHipYawPitch 00029 1.4756660461425781, # RKneePitch 00030 0.52160197496414185, # RShoulderPitch 00031 0.001492038369178772, # RShoulderRoll 00032 0.025117311626672745] # RWristYaw 00033 00034 if (numJoints == 26): 00035 angles = allAngles 00036 elif (numJoints == 22): # no hands (e.g. simulator) 00037 angles = allAngles[0:6] + allAngles[8:24] 00038 else: 00039 rospy.logerr("Unkown number of joints: %d", numJoints) 00040 return 00041 00042 try: 00043 motionProxy.angleInterpolation('Body', angles, 1.5, True); 00044 00045 except RuntimeError,e: 00046 print "An error has been caught" 00047 print e