( self,   link_id )
return np.array(link_local_position)
Computes the link's local position in the robot frame.

    Args:
      robot: A robot instance.
      link_id: The link to calculate its relative position.

    Returns:
      The relative position of the link.
Computes the link's local position in the robot frame.
Computes the link s local position in the robot frame .
def link_position_in_base_frame( self,   link_id ):
    """Computes the link's local position in the robot frame.

    Args:
      robot: A robot instance.
      link_id: The link to calculate its relative position.

    Returns:
      The relative position of the link.
    """
    base_position, base_orientation = self.pybullet_client.getBasePositionAndOrientation(self.quadruped)
    inverse_translation, inverse_rotation = self.pybullet_client.invertTransform(
        base_position, base_orientation)

    link_state = self.pybullet_client.getLinkState(self.quadruped, link_id)
    link_position = link_state[0]
    link_local_position, _ = self.pybullet_client.multiplyTransforms(
        inverse_translation, inverse_rotation, link_position, (0, 0, 0, 1))

    return np.array(link_local_position)
def link_position_in_base_frame ( self , link_id ) : base_position , base_orientation = self . pybullet_client . getBasePositionAndOrientation ( self . quadruped ) inverse_translation , inverse_rotation = self . pybullet_client . invertTransform ( base_position , base_orientation ) link_state = self . pybullet_client . getLinkState ( self . quadruped , link_id ) link_position = link_state [ 0 ] link_local_position , _ = self . pybullet_client . multiplyTransforms ( inverse_translation , inverse_rotation , link_position , ( 0 , 0 , 0 , 1 ) ) return np . array ( link_local_position )