def set_birds_eye_view_spectator(spectator: carla.Actor, followed_location: carla.Location, above: float): birds_eye_view = carla.Transform( carla.Location(x=followed_location.x, y=followed_location.y, z=above), carla.Rotation(pitch=-90), ) spectator.set_transform(birds_eye_view)
def set_spectator_above_actor(spectator: carla.Actor, transform: np.array) -> None: ''' Changes position of the spectator relative to actor position. :param spectator: :param transform: :return: ''' transform = numpy_to_transform(transform + [0, 0, 10, 0]) transform.rotation.pitch = -15 spectator.set_transform(transform)