in experiments/grasp_stability/robot.py [0:0]
def get_control_id_by_name(self, names):
"""
get joint/link ID by name
"""
nbJoint = pb.getNumJoints(self.robotID)
jointNames = {}
ctlID = 0
for i in range(nbJoint):
jointInfo = pb.getJointInfo(self.robotID, i)
name = jointInfo[1].decode("utf-8")
# skip fixed joint
if jointInfo[2] == 4:
continue
# skip base joint
if jointInfo[-1] == -1:
continue
jointNames[name] = ctlID
ctlID += 1
return [jointNames[name] for name in names]