コード例 #1
0
ファイル: sign_data_gatherer.py プロジェクト: alvkao58/pylot
def get_actors(world):
    actor_list = world.get_actors()
    tl_actors = actor_list.filter('traffic.traffic_light*')
    traffic_lights = [
        TrafficLight.from_carla_actor(tl_actor) for tl_actor in tl_actors
    ]
    traffic_stop_actors = actor_list.filter('traffic.stop')
    traffic_stops = [
        StopSign.from_carla_actor(ts_actor) for ts_actor in traffic_stop_actors
    ]
    speed_limit_actors = actor_list.filter('traffic.speed_limit*')
    speed_signs = [
        SpeedLimitSign.from_carla_actor(ts_actor)
        for ts_actor in speed_limit_actors
    ]
    return (tl_actors, traffic_lights, traffic_stops, speed_signs)
コード例 #2
0
 def parse_stop_signs(self, stop_signs):
     # Each stop sign has an id, position, and trigger volume.
     stop_signs_list = []
     for stop_sign_dict in stop_signs.values():
         stop_sign_id = stop_sign_dict['id']
         location = _gps_to_location(*stop_sign_dict['position'])
         # Trigger volume is currently unused.
         trigger_volume = stop_sign_dict['trigger_volume']
         stop_signs_list.append(
             StopSign(
                 1.0,  # confidence
                 None,  # bounding box
                 stop_sign_id,
                 pylot.utils.Transform(
                     location, pylot.utils.Rotation())  # No rotation given
             ))
     return stop_signs_list
コード例 #3
0
ファイル: utils.py プロジェクト: ayjchen1/pylot
def extract_data_in_pylot_format(actor_list):
    """Extracts actor information in pylot format from an actor list.

    Args:
        actor_list (carla.ActorList): An actor list object with all the
            simulation actors.

    Returns:
        A tuple that contains objects for all different types of actors.
    """
    # Note: the output will include the ego vehicle as well.
    vec_actors = actor_list.filter('vehicle.*')
    vehicles = [
        Obstacle.from_simulator_actor(vec_actor) for vec_actor in vec_actors
    ]

    person_actors = actor_list.filter('walker.pedestrian.*')
    people = [
        Obstacle.from_simulator_actor(ped_actor) for ped_actor in person_actors
    ]

    tl_actors = actor_list.filter('traffic.traffic_light*')
    traffic_lights = [
        TrafficLight.from_simulator_actor(tl_actor) for tl_actor in tl_actors
    ]

    speed_limit_actors = actor_list.filter('traffic.speed_limit*')
    speed_limits = [
        SpeedLimitSign.from_simulator_actor(ts_actor)
        for ts_actor in speed_limit_actors
    ]

    traffic_stop_actors = actor_list.filter('traffic.stop')
    traffic_stops = [
        StopSign.from_simulator_actor(ts_actor)
        for ts_actor in traffic_stop_actors
    ]

    return (vehicles, people, traffic_lights, speed_limits, traffic_stops)