Exemple #1
0
if not os.path.exists(output_dir):
    os.makedirs(output_dir)

# World Definition
params = ParameterServer()
world = World(params)

map_interface = MapInterface()
map_interface.set_open_drive_map(xodr_parser.map)
world.set_map(map_interface)

open_drive_map = world.map.get_open_drive_map()

viewer = MPViewer(params=params, use_world_bounds=True)
viewer.drawWorld(world)
viewer.saveFig(output_dir + "/" + "world_plain.png")

color_triplet_gray = (0.7, 0.7, 0.7)

# Open Drive Elements (Roads, Lane Sections, Lanes)
for idx_r, road in open_drive_map.get_roads().items():
    viewer.drawWorld(world)
    viewer.drawRoad(road)
    viewer.saveFig(output_dir + "/" + "open_drive_map_road_" + str(idx_r) +
                   ".png")
    viewer.clear()

for idx_r, road in open_drive_map.get_roads().items():
    for idx_ls, lane_section in enumerate(road.lane_sections):
        viewer.drawWorld(world)
        viewer.drawRoad(road, color_triplet_gray)
Exemple #2
0
    os.makedirs(output_dir)

# World Definition
params = ParameterServer()
world = World(params)

map_interface = MapInterface()
map_interface.SetOpenDriveMap(xodr_parser.map)
world.SetMap(map_interface)

open_drive_map = world.map.GetOpenDriveMap()

viewer = MPViewer(params=params,
                  use_world_bounds=True)
viewer.drawWorld(world)
viewer.saveFig(output_dir + "/" + "world_plain.png")

color_triplet_gray = (0.7,0.7,0.7)

# Open Drive Elements (XodrRoads, XodrLane Sections, XodrLanes)
# for idx_r, road in open_drive_map.GetRoads().items():
#   viewer.drawWorld(world)
#   viewer.drawXodrRoad(road)
#   viewer.saveFig(output_dir + "/" + "open_drive_map_road_" + str(idx_r) + ".png")
#   viewer.show(block=True)
#   viewer.clear()

# for idx_r, road in open_drive_map.GetRoads().items():
#   for idx_ls, lane_section in enumerate(road.lane_sections):
#     viewer.drawWorld(world)
#     viewer.drawXodrRoad(road, color_triplet_gray)