(
    robot: typing.Any,
    link_id: int,
)
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(
    robot: typing.Any,
    link_id: int,
):
  """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 = robot.GetBasePosition(
  ), robot.GetBaseOrientation()
  inverse_translation, inverse_rotation = robot.pybullet_client.invertTransform(
      base_position, base_orientation)

  link_state = robot.pybullet_client.getLinkState(robot.quadruped, link_id)
  link_position = link_state[0]
  link_local_position, _ = robot.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 ( robot : typing . Any , link_id : int , ) : base_position , base_orientation = robot . GetBasePosition ( ) , robot . GetBaseOrientation ( ) inverse_translation , inverse_rotation = robot . pybullet_client . invertTransform ( base_position , base_orientation ) link_state = robot . pybullet_client . getLinkState ( robot . quadruped , link_id ) link_position = link_state [ 0 ] link_local_position , _ = robot . pybullet_client . multiplyTransforms ( inverse_translation , inverse_rotation , link_position , ( 0 , 0 , 0 , 1 ) ) return np . array ( link_local_position )