Scenario Generation
This page introduces the method of generating a new scenario using Scenario Runner.
Generate Scenario
It automatically generates scenarios according to the components & parameters of various Scenes.
Based on this, various scenarios corresponding to several different Scenes may be generated.
Euro NCAP Scenario Generation (Protocol Link)
EuroNCAP stands for The European New Car Assessment Programme, which represents real accident scenarios simplified in a streamlined manner, where fatalities or severe injuries can occur due to car accidents.
Safety ratings are determined based on a series of vehicle tests designed and conducted by EuroNCAP, evaluating vehicle safety by simplifying real accident scenarios.
When generating EuroNCAP scenarios in the Scenario Runner, it follows the AEB (Autonomous Emergency Braking) Car-to-Car test procedure.
In the AEB Car-to-Car Testing, scenarios involving CCRs, CCRm, and CCRb are tested. The focus of the test is on scenarios where the vehicle detects the possibility of a collision and can decrease its speed to avoid the collision.
Types | Explanation |
CCRs (Car-to-Car Rear Stationary) | front-end collision with the rear structure of a stationary vehicle |
CCRm (Car-to-Car Rear Moving) | front-end collision with a moving vehicle at a constant speed |
CCRb (Car-to-Car Rear Braking) | front-end collision occurred as a moving vehicle, traveling at a constant speed, collided with the rear structure of another vehicle. Subsequently, the vehicle decelerated https://drive.google.com/file/d/1GO92g5MTHPYXhqJeADoZTrldOz83kz7B/view?usp=sharing |
VRU (Vulnerable road user)
VRU (Vulnerable Road User) refers to road users who are not inside a car, bus, or truck.
This typically includes pedestrians, motorcyclists, bicyclists, children under the age of 7, seniors, and users of various modes of transportation.
In Morai Runner, situations such as CBNAO, CPNC, Pedestrian, Animal, etc., are provided.
Types | Explanation |
---|---|
CBNAO (Car-to-Bicyclist Nearside Adult Obstructed) | When an EGO vehicle approaches, a bicycle is initially obscured from view and suddenly enters the road. |
CPNC (Car-to-Pedestrian Nearside Child) | When an EGO vehicle approaches, a pedestrian is initially obscured from view and suddenly enters the road. |
Pedestrian | Place a pedestrian at the designated location. |
Animal | Place an animal at the designated location. |
Create New OpenScenario (Manual)
1. Click on File > New Scenario.
2. Enter the data
Select the MGeo folder in the RoadNetwork Path and enter the map name in the Map Name field.
To integrate with MORAI SIM: Drive for simulation, the Map Name should match the map name within MORAI SIM: Drive.
3. Generation Complete
Load the MGeo map from the given path and automatically generate essential elements in the OpenSCENARIO structure. To define vehicles and their behaviors in the generated scenario, use the contents of the Scenario Editing.
Scenario Generation using OpenSCENARIO Parameter Distribution
OpenSCENARIO defines the Parameter Distribution feature, which allows the derivation of multiple scenarios by modifying global parameters based on a specific scenario. Parameters are defined according to either a deterministic distribution or a stochastic distribution.
1. Click on Tools > Generate Scenario
2. Enter the data
Select the Parameter Distribution file defined in the OpenSCENARIO format, and enter the folder and file name where the generated scenario will be saved.
The generated scenarios will be saved in OpenSCENARIO format with a number appended to the entered file name ({File Name}_00X.xosc)
Parameter Distribution File path example:
{Launcher_folder}\MoraiLauncher_Win_Data\ScenarioRunner\${ScenarioRunner_version}\data\openscenario\$R_KR_PG_KATRI\Scenario_Double_Lane_Changer_2_DeterministicParameterSet.xosc
Save Folder path example:
${Launcher_folder}\MoraiLauncher_Win_Data\ScenarioRunner\${ScenarioRunner_version}\data\openscenario\R_KR_PG_KATRI\MGeo3,Generation Complete
If the generation is successful, you can check the log to see how many scenario files were created in total.
Following the generated file path, you can confirm that the files have been created as follows: (out of 12 files, example_01)
<?xml version="1.0" ?>
<OpenSCENARIO xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Schema/OpenSCENARIO.xsd">
<FileHeader author="MORAI:scenario-module-team" date="2022-07-21T10:00:00" description="Scenario: Double Lane Change (parameterized)" revMajor="1" revMinor="2"/>
<ParameterDeclarations>
<ParameterDeclaration name="npc1_vehicle" parameterType="string" value="2016_Hyundai_Ioniq"/>
<ParameterDeclaration name="npc2_vehicle" parameterType="string" value="2021_Hyundai_G80"/>
<ParameterDeclaration name="weather_type" parameterType="string" value="dry"/>
<ParameterDeclaration name="ego_init_speed" parameterType="double" value="9.8"/>
<ParameterDeclaration name="ego_init_link_index" parameterType="int" value="40.0"/>
<ParameterDeclaration name="npc1_init_speed" parameterType="double" value="16.5"/>
<ParameterDeclaration name="npc1_init_link_index" parameterType="int" value="78"/>
<ParameterDeclaration name="npc2_init_speed" parameterType="double" value="16"/>
<ParameterDeclaration name="npc2_init_link_index" parameterType="int" value="3"/>
</ParameterDeclarations>
<VariableDeclarations/>
<CatalogLocations/>
<RoadNetwork>
<LogicFile filepath="."/>
</RoadNetwork>
<SimulatorInfo>
<Map name="R_KR_PG_KATRI"/>
</SimulatorInfo>
<Entities>
<ScenarioObject name="Ego">
<Vehicle name="2016_Hyundai_Ioniq" vehicleCategory="car">
<ParameterDeclarations/>
<Properties/>
</Vehicle>
</ScenarioObject>
<ScenarioObject name="NPC_1">
<Vehicle name="$npc1_vehicle" vehicleCategory="car">
<ParameterDeclarations/>
<Properties/>
</Vehicle>
</ScenarioObject>
<ScenarioObject name="NPC_2">
<Vehicle name="$npc2_vehicle" vehicleCategory="car">
<ParameterDeclarations/>
<Properties/>
</Vehicle>
</ScenarioObject>
</Entities>
<Storyboard>
<Init>
<Actions>
<GlobalAction>
<EnvironmentAction>
<Environment name="Environment1">
<TimeOfDay animation="false" dateTime="2022-07-21T10:00:00"/>
<Weather atmosphericPressure="80000" fractionalCloudCover="zeroOktas" temperature="170">
<Sun azimuth="0.0" elevation="1.571" illuminance="1.0"/>
<Fog visualRange="100000.0"/>
<Precipitation precipitationIntensity="0.0" precipitationType="$weather_type"/>
<Wind direction="0" speed="0"/>
</Weather>
<RoadCondition frictionScaleFactor="1.0" wetness="dry"/>
</Environment>
</EnvironmentAction>
</GlobalAction>
<Private entityRef="Ego">
<PrivateAction>
<LongitudinalAction>
<SpeedAction>
<SpeedActionTarget>
<AbsoluteTargetSpeed value="$ego_init_speed"/>
</SpeedActionTarget>
<SpeedActionDynamics dynamicsDimension="time" dynamicsShape="step" value="0"/>
</SpeedAction>
</LongitudinalAction>
</PrivateAction>
<PrivateAction>
<TeleportAction>
<Position>
<LinkPosition id="A219BS010310" index="$ego_init_link_index"/>
</Position>
</TeleportAction>
</PrivateAction>
</Private>
<Private entityRef="NPC_1">
<PrivateAction>
<LongitudinalAction>
<SpeedAction>
<SpeedActionTarget>
<AbsoluteTargetSpeed value="$npc1_init_speed"/>
</SpeedActionTarget>
<SpeedActionDynamics dynamicsDimension="time" dynamicsShape="step" value="0"/>
</SpeedAction>
</LongitudinalAction>
</PrivateAction>
<PrivateAction>
<TeleportAction>
<Position>
<LinkPosition id="A219BS010310" index="$npc1_init_link_index"/>
</Position>
</TeleportAction>
</PrivateAction>
</Private>
<Private entityRef="NPC_2">
<PrivateAction>
<LongitudinalAction>
<SpeedAction>
<SpeedActionTarget>
<AbsoluteTargetSpeed value="$npc2_init_speed"/>
</SpeedActionTarget>
<SpeedActionDynamics dynamicsDimension="time" dynamicsShape="step" value="0"/>
</SpeedAction>
</LongitudinalAction>
</PrivateAction>
<PrivateAction>
<TeleportAction>
<Position>
<LinkPosition id="A219BS010311" index="$npc2_init_link_index"/>
</Position>
</TeleportAction>
</PrivateAction>
</Private>
</Actions>
</Init>
<Story name="Story1">
<Act name="Act1">
<ManeuverGroup maximumExecutionCount="1" name="Sequence1">
<Actors selectTriggeringEntities="false">
<EntityRef entityRef="NPC_2"/>
</Actors>
<Maneuver name="Maneuver1">
<Event maximumExecutionCount="1" name="Event1" priority="overwrite">
<Action name="Action1">
<PrivateAction>
<LateralAction>
<LaneChangeAction targetLaneOffset="0">
<LaneChangeActionDynamics dynamicsDimension="distance" dynamicsShape="cubic" value="54.8254917969"/>
<LaneChangeTarget>
<RelativeTargetLane entityRef="Ego" value="0"/>
</LaneChangeTarget>
</LaneChangeAction>
</LateralAction>
</PrivateAction>
</Action>
<StartTrigger>
<ConditionGroup>
<Condition conditionEdge="rising" delay="0" name="StartCondition1">
<ByEntityCondition>
<TriggeringEntities triggeringEntitiesRule="any">
<EntityRef entityRef="NPC_2"/>
</TriggeringEntities>
<EntityCondition>
<DistanceCondition freespace="false" rule="greaterThan" value="5.0">
<Position>
<RelativeObjectPosition dx="0" dy="0" entityRef="Ego"/>
</Position>
</DistanceCondition>
</EntityCondition>
</ByEntityCondition>
</Condition>
</ConditionGroup>
</StartTrigger>
</Event>
<Event maximumExecutionCount="1" name="Event2" priority="overwrite">
<Action name="Action2">
<PrivateAction>
<LateralAction>
<LaneChangeAction targetLaneOffset="0">
<LaneChangeActionDynamics dynamicsDimension="distance" dynamicsShape="cubic" value="54.8254917969"/>
<LaneChangeTarget>
<RelativeTargetLane entityRef="Ego" value="1"/>
</LaneChangeTarget>
</LaneChangeAction>
</LateralAction>
</PrivateAction>
</Action>
<StartTrigger>
<ConditionGroup>
<Condition conditionEdge="rising" delay="0" name="MyStartCondition2">
<ByValueCondition>
<StoryboardElementStateCondition state="completeState" storyboardElementRef="Event1" storyboardElementType="event"/>
</ByValueCondition>
</Condition>
</ConditionGroup>
</StartTrigger>
</Event>
</Maneuver>
</ManeuverGroup>
<StartTrigger>
<ConditionGroup>
<Condition conditionEdge="none" delay="0" name="Act1_StartTrigger_SimulationTime">
<ByValueCondition>
<SimulationTimeCondition rule="greaterThan" value="0"/>
</ByValueCondition>
</Condition>
</ConditionGroup>
</StartTrigger>
<StopTrigger/>
</Act>
</Story>
<StopTrigger>
<ConditionGroup>
<Condition conditionEdge="none" delay="0" name="Time_out">
<ByValueCondition>
<SimulationTimeCondition rule="greaterThan" value="30"/>
</ByValueCondition>
</Condition>
</ConditionGroup>
</StopTrigger>
</Storyboard>
<Evaluation/>
</OpenSCENARIO>