RoadRunner can export road scenes to Baidu Apollo® formats. You can export to Apollo 3.0 and 5.0 XML formats and Apollo 5.0 binary format.
Before you export to any Apollo format, ensure that your scene’s world origin is set in the World Settings Tool. Once you are ready to export,
navigate to File > Export > Apollo (.bin, .xml) to open the export options window. Make sure you choose the appropriate
Apollo version before completing your export, and ensure that you specify the
file extension (
.bin) you intend to export
to. Exports to the binary format will include a human readable
representation of the protobuf data serialized in the
Apollo’s Dreamview front-end tool can visualize and simulate routing on RoadRunner Apollo exports. A complete map is composed of the following files for proper simulation:
base_map.bin — A protobuf representation of HDMap
information. The representation might be accompanied with a human-readable
sim_map.bin — A downscaled version of
base_map.bin used for faster visualization at
runtime. The file might be accompanied with a
routing_map.bin — Topological map information used for
default_end_way_point.txt — A start point for
Given either a binary or XML export from RoadRunner, these files can be generated using various tools provided by the Apollo codebase.
If you have not yet set up your Apollo Docker environment, follow this guide to do so.
Binary maps can be generated from XML by using the following command in the Apollo Docker environment:
bazel-bin/modules/maps/tools/proto_map_generator --map_dir=INPUT_DIR --output_dir=OUTPUT_DIR
INPUT_DIRis the name of the directory containing the XML file, and
OUTPUT_DIRis the desired output directory. Within the input directory, ensure the XML file is named
base_map.xmlbefore running it. This will generate a binary file named
base_map.binand a text file version named
base_map.txtin the output directory specified.
.bin file or a
.bin file exported
directly from RoadRunner, a sim_map can be generated with the following
bazel-bin/modules/maps/tools/sim_map_generator --map_dir=INPUT_DIR --output_dir=OUTPUT_DIR
.binfile is named
base_map.binbefore running it.
A routing map can be generated with the following command:
Once you have all of the components for an Apollo map, you can visualize and simulate it in the Dreamview front-end.
Create a folder for your map in
apollo/modules/maps/data, and add
all the map files to that folder. Rename the folder to what you would like to appear in
the Dreamview map selection drop-down. Restart Dreamview to refresh the maps in your
Once Dreamview starts, select your newly added map and a test vehicle in the top-right corner. Ensure that the standard mode is selected.
Go to the Tasks tab on the left, and enable Sim Control to render the map.
To run a road simulation in Dreamview, ensure that Routing is enabled in the Modules window. In the routing window, define a route on the map by using at least two waypoints. Click Send Route Request to run the simulation.
LGSVL has the ability to import Apollo 5.0 binary files for editing and visualization.
If you have not yet set up LGSVL with Unity®, follow this guide to do so.
To import an Apollo map into LGSVL, open the HD Map Import window under Simulator > Import HD Map. Under Import Format, select Apollo 5 HD Map, and optionally modify the Distance and Delta Threshold values. Click "..." to open the file browser and select the binary file export. Click import to add the map to the scene.
More information about importing maps into LGSVL can be found here.
The Apollo exporter uses a configuration XML file to map RoadRunner props, signals, signs, and markings to the appropriate <object> or <signal> "id" and "subtype". This process works the same way as the OpenDRIVE® asset configuration.
ApolloAssetData.xml file located in the
RoadRunner install location under
AssetsInstall/ResourceAssets to the
Project folder in your project (next to the
Open the new
ApolloAssetData.xml file in a text
Add entries for new objects, markings, or signals.
Save your file and export an Apollo file.
You do not need to restart RoadRunner after creating or modifying the
The format of an
ApolloAssetData.xml file is the same as the
format of an
OpenDRIVEAssetData.xml file. For a detailed
definition of this format, see Exporting to OpenDRIVE. The template file in the
AssetsInstall/ResourceAssets folder also contains examples
for a traffic light, stop sign, and yield sign.
Here is the definition of the format to properly set a traffic signal’s asset data for different variances and subsignals.
<Signals> <Signal> <Type>trafficLight</Type> <SubType>mix3Vertical</SubType> <SubSignals> <Variant>1</Variant> <SubSignal> <LightName>light_red</LightName> <Type>circle</Type> </SubSignal> <SubSignal> <LightName>light_yellow</LightName> <Type>circle</Type> </SubSignal> <SubSignal> <LightName>light_green</LightName> <Type>circle</Type> </SubSignal> </SubSignals> <SubSignals> <Variant>2</Variant> <SubSignal> <LightName>light_red</LightName> <Type>arrowLeft</Type> </SubSignal> <SubSignal> <LightName>light_yellow</LightName> <Type>arrowLeft</Type> </SubSignal> <SubSignal> <LightName>light_green</LightName> <Type>arrowLeft</Type> </SubSignal> </SubSignals> <SubSignals> <Variant>3</Variant> <SubSignal> <LightName>light_red</LightName> <Type>arrowRight</Type> </SubSignal> <SubSignal> <LightName>light_yellow</LightName> <Type>arrowRight</Type> </SubSignal> <SubSignal> <LightName>light_green</LightName> <Type>arrowRight</Type> </SubSignal> </SubSignals> <FilePath>Props/Signals/Signal_3Light_Post01.fbx</FilePath> </Signal> </Signals>
The following data records are currently unsupported for export.
Route View Record (<routeView> … </routeView> and its children)
Lane Overlap Group (<laneOverlapGroup> … </laneOverlapGroup> and its children)