Exemple #1
0
 def test_buffered_viewer(self):
   env = GenerateRuntime()
   buffered_viewer = BufferedViewer()
   env._viewer = buffered_viewer
   env.reset()
   for step in range(0, 5):
     env.step()
    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="examples/data/DR_DEU_Merging_MT_v01_shifted.xodr",
                    random_seed=0,
                    params=param_server,
                    lane_corridor_configs=[left_lane, right_lane])

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

    # run BARKSCAPE
    logger = logging.getLogger()
    custom_stream = CustomStream(logger=logger)
    bark_server = BaseServer(runner=BARKRunner,
                             runnable_object=env,
                             logger=logger,
                             stream=custom_stream)
    bark_server.Start()