(self)
return
Build the link Ids from its name in the URDF file.

    Raises:
      ValueError: Unknown category of the joint name.
Build the link Ids from its name in the URDF file.
Build the link Ids from its name in the URDF file .
def _BuildUrdfIds(self):
    """Build the link Ids from its name in the URDF file.

    Raises:
      ValueError: Unknown category of the joint name.
    """
    num_joints = self.pybullet_client.getNumJoints(self.quadruped)
    self._chassis_link_ids = [-1]
    self._leg_link_ids = []
    self._motor_link_ids = []
    self._knee_link_ids = []
    self._foot_link_ids = []

    for i in range(num_joints):
      joint_info = self.pybullet_client.getJointInfo(self.quadruped, i)
      joint_name = joint_info[1].decode("UTF-8")
      joint_id = self._joint_name_to_id[joint_name]
      if CHASSIS_NAME_PATTERN.match(joint_name):
        self._chassis_link_ids.append(joint_id)
      elif MOTOR_NAME_PATTERN.match(joint_name):
        self._motor_link_ids.append(joint_id)
      # We either treat the lower leg or the toe as the foot link, depending on
      # the urdf version used.
      elif KNEE_NAME_PATTERN.match(joint_name):
        self._knee_link_ids.append(joint_id)
      elif TOE_NAME_PATTERN.match(joint_name):
        #assert self._urdf_filename == URDF_WITH_TOES
        self._foot_link_ids.append(joint_id)
      else:
        raise ValueError("Unknown category of joint %s" % joint_name)

    self._leg_link_ids.extend(self._knee_link_ids)
    self._leg_link_ids.extend(self._foot_link_ids)

    
    #assert len(self._foot_link_ids) == NUM_LEGS
    self._chassis_link_ids.sort()
    self._motor_link_ids.sort()
    self._knee_link_ids.sort()
    self._foot_link_ids.sort()
    self._leg_link_ids.sort()

    return
def _BuildUrdfIds ( self ) : num_joints = self . pybullet_client . getNumJoints ( self . quadruped ) self . _chassis_link_ids = [ - 1 ] self . _leg_link_ids = [ ] self . _motor_link_ids = [ ] self . _knee_link_ids = [ ] self . _foot_link_ids = [ ] for i in range ( num_joints ) : joint_info = self . pybullet_client . getJointInfo ( self . quadruped , i ) joint_name = joint_info [ 1 ] . decode ( "UTF-8" ) joint_id = self . _joint_name_to_id [ joint_name ] if CHASSIS_NAME_PATTERN . match ( joint_name ) : self . _chassis_link_ids . append ( joint_id ) elif MOTOR_NAME_PATTERN . match ( joint_name ) : self . _motor_link_ids . append ( joint_id ) # We either treat the lower leg or the toe as the foot link, depending on # the urdf version used. elif KNEE_NAME_PATTERN . match ( joint_name ) : self . _knee_link_ids . append ( joint_id ) elif TOE_NAME_PATTERN . match ( joint_name ) : #assert self._urdf_filename == URDF_WITH_TOES self . _foot_link_ids . append ( joint_id ) else : raise ValueError ( "Unknown category of joint %s" % joint_name ) self . _leg_link_ids . extend ( self . _knee_link_ids ) self . _leg_link_ids . extend ( self . _foot_link_ids ) #assert len(self._foot_link_ids) == NUM_LEGS self . _chassis_link_ids . sort ( ) self . _motor_link_ids . sort ( ) self . _knee_link_ids . sort ( ) self . _foot_link_ids . sort ( ) self . _leg_link_ids . sort ( ) return