Go to the documentation of this file.00001 import rospy
00002
00003
00004 def initPose(motionProxy):
00005 numJoints = len(motionProxy.getJointNames('Body'))
00006
00007 allAngles = [0.0,0.0,
00008 1.39, 0.34, -1.39, -1.04, 0.0, 0.0,
00009 0.0, 0.0, -0.43, 0.69, -0.34, 0.0,
00010 0.0, 0.0, -0.43, 0.69, -0.34, 0.0,
00011 1.39, -0.34, 1.39, 1.04, 0.0, 0.0]
00012
00013 if (numJoints == 26):
00014 angles = allAngles
00015 elif (numJoints == 22):
00016 angles = allAngles[0:6] + allAngles[8:24]
00017 else:
00018 rospy.logerr("Unkown number of joints: %d", numJoints)
00019 return
00020
00021 try:
00022 motionProxy.angleInterpolation('Body', angles, 1.5, True);
00023
00024 except RuntimeError,e:
00025 print "An error has been caught"
00026 print e