对于机械臂而言,关节的动作就是其旋转的角度。机械臂的抓取动作主要分为以下几个步骤:
pos = [self.offset[0]+0.2 * math.sin(1.5 * t), self.offset[1]+0.044, self.offset[2]+-0.6 + 0.1 * math.cos(1.5 * t)]
orn = self.bullet_client.getQuaternionFromEuler([math.pi/2.,0.,0.])
jointPoses = self.bullet_client.calculateInverseKinematics(self.panda,pandaEndEffectorIndex, pos, orn)
for i in range(pandaNumDofs):
self.bullet_client.setJointMotorControl2(self.panda, i, self.bullet_client.POSITION_CONTROL, jointPoses[i],force=5 * 240.)