(leg_pose)
return motor_angles
Converts the swing extension poses to the motor angles with safety limits.

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

  Returns:
    A numpy array. All eight motor angles.
Converts the swing extension poses to the motor angles with safety limits.
Converts the swing extension poses to the motor angles with safety limits .
def leg_pose_to_motor_angles_with_half_pi_offset_and_safety(leg_pose):
  """Converts the swing extension poses to the motor angles with safety limits.

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

  Returns:
    A numpy array. All eight motor angles.
  """

  motor_angles = []
  for idx in range(4):
    swing = leg_pose[idx * 2]
    extend = leg_pose[idx * 2 + 1]
    motor_angles.extend(swing_extend_to_motor_angles(idx, swing, extend))
  return motor_angles
def leg_pose_to_motor_angles_with_half_pi_offset_and_safety ( leg_pose ) : motor_angles = [ ] for idx in range ( 4 ) : swing = leg_pose [ idx * 2 ] extend = leg_pose [ idx * 2 + 1 ] motor_angles . extend ( swing_extend_to_motor_angles ( idx , swing , extend ) ) return motor_angles