(motor_angles)
return np.concatenate((swings, extensions), axis=None)
Convert motor angles to the leg pose.

  A single leg pose is a tuple (swing, extension). The definition can be find
  in:
    Sim-to-Real: Learning Agile Locomotion For Quadruped Robot

  Args:
    motor_angles: A numpy array. Contains all eight motor angles for Minitaur.

  Returns:
    A numpy array. Contains the leg pose for all four legs: [swing_0, swing_1,
    swing_2, swing_3, extension_0, extension_1, extension_2, extension_3]
Convert motor angles to the leg pose.
Convert motor angles to the leg pose .
def motor_angles_to_leg_pose(motor_angles):
  """Convert motor angles to the leg pose.

  A single leg pose is a tuple (swing, extension). The definition can be find
  in:
    Sim-to-Real: Learning Agile Locomotion For Quadruped Robot

  Args:
    motor_angles: A numpy array. Contains all eight motor angles for Minitaur.

  Returns:
    A numpy array. Contains the leg pose for all four legs: [swing_0, swing_1,
    swing_2, swing_3, extension_0, extension_1, extension_2, extension_3]

  """
  motor_angles = np.array(motor_angles)

  swings = 0.5 * np.multiply(
      np.array(MOTOR_SIGNS), (motor_angles[1::2] - motor_angles[::2]))
  extensions = 0.5 * (motor_angles[::2] + motor_angles[1::2])

  return np.concatenate((swings, extensions), axis=None)
def motor_angles_to_leg_pose ( motor_angles ) : motor_angles = np . array ( motor_angles ) swings = 0.5 * np . multiply ( np . array ( MOTOR_SIGNS ) , ( motor_angles [ 1 : : 2 ] - motor_angles [ : : 2 ] ) ) extensions = 0.5 * ( motor_angles [ : : 2 ] + motor_angles [ 1 : : 2 ] ) return np . concatenate ( ( swings , extensions ) , axis = None )