Beispiel #1
0
def GenerateRuntime():
    # parameters
    param_server = ParameterServer()
    # configure both lanes of the highway. the right lane has one controlled agent
    left_lane = CustomLaneCorridorConfig(params=param_server,
                                        lane_corridor_id=0,
                                        road_ids=[0, 1],
                                        behavior_model=BehaviorMobilRuleBased(param_server),
                                        s_min=5.,
                                        s_max=50.)
    right_lane = CustomLaneCorridorConfig(params=param_server,
                                          lane_corridor_id=1,
                                          road_ids=[0, 1],
                                          controlled_ids=True,
                                          behavior_model=BehaviorMobilRuleBased(param_server),
                                          s_min=5.,
                                          s_max=20.)
    scenarios = \
      ConfigWithEase(num_scenarios=3,
                    map_file_name=Data.xodr_data("DR_DEU_Merging_MT_v01_shifted"),
                    random_seed=0,
                    params=param_server,
                    lane_corridor_configs=[left_lane, right_lane])
    # viewer
    viewer = MPViewer(params=param_server,
                      x_range=[-35, 35],
                      y_range=[-35, 35],
                      follow_agent_id=True)
    env = Runtime(step_time=0.2,
                  viewer=viewer,
                  scenario_generator=scenarios,
                  render=True,
                  maintain_world_history=True)
    return env
Beispiel #2
0
    road_ids=[0, 1],
    behavior_model=BehaviorMobilRuleBased(param_server),
    s_min=5.,
    s_max=50.)
right_lane = CustomLaneCorridorConfig(
    params=param_server,
    lane_corridor_id=1,
    road_ids=[0, 1],
    controlled_ids=True,
    behavior_model=BehaviorMobilRuleBased(param_server),
    s_min=5.,
    s_max=20.)

scenarios = \
    ConfigWithEase(num_scenarios=3,
                   map_file_name=Data.xodr_data("DR_DEU_Merging_MT_v01_centered"),
                   random_seed=0,
                   params=param_server,
                   lane_corridor_configs=[left_lane, right_lane])

# viewer
viewer = MPViewer(
    params=param_server,
    # x_range=[-35, 35],
    # y_range=[-35, 35],
    follow_agent_id=False)

sim_step_time = param_server["simulation"]["step_time",
                                           "Step-time used in simulation",
                                           0.05]
sim_real_time_factor = param_server["simulation"][
        LaneCorridorConfig(
            params=param_server,
            source_pos=[3, -30],
            sink_pos=[-30, 3],
            behavior_model=BehaviorIntersectionRuleBased(param_server),
            controlled_ids=True,
            min_vel=5.,
            max_vel=5.,
            ds_min=5.,
            ds_max=10.,
            s_min=15.,
            s_max=30.))

    scenarios = \
      ConfigWithEase(num_scenarios=3,
                    map_file_name=Data.xodr_data("threeway_intersection"),
                    random_seed=0,
                    params=param_server,
                    lane_corridor_configs=lane_corridors)

    viewer = BufferedViewer()
    env = Runtime(step_time=0.2,
                  viewer=viewer,
                  scenario_generator=scenarios,
                  render=True,
                  maintain_world_history=True)

    # run BARKSCAPE
    logger = logging.getLogger()
    bark_server = BaseServer(runner=BARKRunner,
                             runnable_object=env,
Beispiel #4
0

# configure both lanes of the highway. the right lane has one controlled agent
left_lane = HighwayLaneCorridorConfig(params=param_server,
                                      road_ids=[16],
                                      lane_corridor_id=0)
right_lane = HighwayLaneCorridorConfig(params=param_server,
                                       road_ids=[16],
                                       lane_corridor_id=1,
                                       controlled_ids=True)

# create 5 scenarios
scenarios = \
    ConfigWithEase(
        num_scenarios=5,
        map_file_name=Data.xodr_data("city_highway_straight"),
        random_seed=0,
        params=param_server,
        lane_corridor_configs=[left_lane, right_lane])

# viewer
viewer = MPViewer(params=param_server,
                  x_range=[-75, 75],
                  y_range=[-75, 75],
                  follow_agent_id=True)

sim_step_time = param_server["simulation"]["step_time",
                                           "Step-time used in simulation",
                                           0.05]
sim_real_time_factor = param_server["simulation"][
    "real_time_factor", "execution in real-time or faster", 0.5]
Beispiel #5
0
    road_ids=[0, 1],
    behavior_model=BehaviorMobilRuleBased(param_server),
    s_min=5.,
    s_max=50.)
right_lane = CustomLaneCorridorConfig(
    params=param_server,
    lane_corridor_id=1,
    road_ids=[0, 1],
    controlled_ids=True,
    behavior_model=BehaviorMobilRuleBased(param_server),
    s_min=5.,
    s_max=20.)

scenarios = \
  ConfigWithEase(num_scenarios=3,
                 map_file_name=Data.xodr_data("DR_DEU_Merging_MT_v01_shifted"),
                 random_seed=0,
                 params=param_server,
                 lane_corridor_configs=[left_lane, right_lane])

# viewer
viewer = BufferedMPViewer(params=param_server)

sim_step_time = param_server["simulation"]["step_time",
                                           "Step-time used in simulation", 0.2]
sim_real_time_factor = param_server["simulation"][
    "real_time_factor", "execution in real-time or faster", 1.]

# viewer = VideoRenderer(renderer=viewer,
#                        world_step_time=sim_step_time,
#                        fig_path="/Users/hart/2019/bark/video")
Beispiel #6
0

# configure both lanes of the highway. the right lane has one controlled agent
left_lane = HighwayLaneCorridorConfig(params=param_server,
                                      road_ids=[16],
                                      lane_corridor_id=0)
right_lane = HighwayLaneCorridorConfig(params=param_server,
                                       road_ids=[16],
                                       lane_corridor_id=1,
                                       controlled_ids=True)

# create 5 scenarios
scenarios = \
  ConfigWithEase(
    num_scenarios=5,
    map_file_name=Data.xodr_data("city_highway_straight"),
    random_seed=0,
    params=param_server,
    lane_corridor_configs=[left_lane, right_lane])

# viewer
viewer = MPViewer(params=param_server,
                  x_range=[-75, 75],
                  y_range=[-75, 75],
                  follow_agent_id=True)

sim_step_time = param_server["simulation"]["step_time",
                                          "Step-time used in simulation",
                                          0.05]
sim_real_time_factor = param_server["simulation"][
  "real_time_factor",