Loading and Saving Scenarios
On this page, we introduce how to use Scenario Runner to load scenario files and how to save the currently loaded scenario to a file. When loading a scenario file, the MGeo map in the same folder as the file is also loaded and appears on the GUI.
The MGeo map included in the example scenario folder is utilized to enhance the realism of the scenario and is different from the map used in MORAI SIM: Drive. Therefore, any modifications made to the map file within Scenario Runner will not be reflected in the simulation
The Scenario Runner directory
MORAI Scenario Runner must be provided with two data elements to function - the geospatial map data of the test region (MGeo data) and the scenario file itself. MGeo data, which is a collection of .json
files, contain map data such as lane and lane boundary data, traffic light configurations, and map projection data. Scenario files, as mentioned in the system overview, contain data describing scenario objects, the triggering conditions of these objects, and their trajectories/maneuvers (stories).
The hierarchy between these data files is structured as follows:
data >> openscenario >> map >> mgeo & scenario files
Scenario files are classified in folders based on the map data on which the scenarios are executed. Each map folder contains a sub-folder with MGeo map data.
data
openscenario
${Map1}
MGeo (map data)
global_info.json
node_set.json
link_set.json
…
${Scenario1}
${Scenario2}
${Scenario3}
…
${Map2}
MGeo
${Scenario1}
…
${Map3}
…
When you load a scenario file, the corresponding MGeo data is loaded simultaneously and displayed on the main GUI window.
The MGeo map data included in the opencenario sub-folder is only used as a visual reference for the scenario. It is not connected in any way to the map data embedded in MORAI SIM. Even if the MGeo files are modified, those changes are not reflected in MORAI SIM.
Loading the scenario
Loading MGeo files
When loading a scenario file, this step can be omitted as MGeo files are automatically loaded with the scenario. Should you wish to open MGeo data separately, from the main menu bar, go to File >> Load MGeo. Choose the folder containing your map data.
For more information on working with the MGeo data format, refer to the Map Editor Manual here.
Loading OpenSCENARIO files
Load scenario files from the same file menu at File >> Load OpenSCENARIO. From the explorer, choose a scenario file. As of version Scenario Runner 1.6.0, only OpenSCENARIO .xosc
files are supported.
Selecting a scenario file from the explorer will begin the loading process. Each scenario file can be loaded one at a time. The following screenshots show the step-by-step process.
Once the files have loaded, the map and main scenario entities, such as the ego-vehicle and NPC vehicles, are shown on the main GUI window. If nothing seems to be showing, try moving the view or zooming out as the initial view may not have adjusted for the newly opened data. For more information on how to control the perspective view, refer to the following page.
By default, the ego-vehicle is represented as a red square. NPC vehicles are represented with blue squares. You can change the GUI style configuration from the Properties panel.
Saving Scenario
Scenario File (.xosc)
Click 'File' > 'Save OpenSCENARIO' to open the file browse
Enter the desired file name and click 'Save’Related Pages