(angles)
return mapped_angles
Maps a list of angles to [-pi, pi].

  Args:
    angles: A list of angles in rad.

  Returns:
    A list of angle mapped to [-pi, pi].
Maps a list of angles to [-pi, pi].
Maps a list of angles to [ - pi pi ] .
def MapToMinusPiToPi(angles):
  """Maps a list of angles to [-pi, pi].

  Args:
    angles: A list of angles in rad.

  Returns:
    A list of angle mapped to [-pi, pi].
  """
  mapped_angles = copy.deepcopy(angles)
  for i in range(len(angles)):
    mapped_angles[i] = math.fmod(angles[i], TWO_PI)
    if mapped_angles[i] >= math.pi:
      mapped_angles[i] -= TWO_PI
    elif mapped_angles[i] < -math.pi:
      mapped_angles[i] += TWO_PI
  return mapped_angles
def MapToMinusPiToPi ( angles ) : mapped_angles = copy . deepcopy ( angles ) for i in range ( len ( angles ) ) : mapped_angles [ i ] = math . fmod ( angles [ i ] , TWO_PI ) if mapped_angles [ i ] >= math . pi : mapped_angles [ i ] -= TWO_PI elif mapped_angles [ i ] < - math . pi : mapped_angles [ i ] += TWO_PI return mapped_angles