이 페이지에서는 다양한 시나리오의 구현을 위해 Scenario Runner에서 OpenSCENARIO에 추가하거나 수정한 요소를 정리한다. 각 항목은 해당 요소에 대한 정의 및 사용예시로 구성되어 있다.

목차


추가된 요소

Evaluation

Triggers to stop a simulation and Returns a result of the simulation. (None, Success, Failure)

When there isn’t any condition group, it wouldn’t be triggered and returns None.

Element

Cardinality

Description

SuccessConditionGroup

0..*

At least one success condition group should be triggered to succeed the simulation.

FailureConditionGroup

0..*

All failure condition groups should not be triggered to succeed the simulation.

  <Evaluation>
    <SuccessConditionGroup>
      <Condition name="Ego_position" delay="0" conditionEdge="once">
        <ByEntityCondition>
          <TriggeringEntities triggeringEntitiesRule="any">
            <EntityRef entityRef="Ego" />
          </TriggeringEntities>
          <EntityCondition>
            <DistanceCondition value="5.0" freespace="false" rule="lessThan">
              <Position>
                <RelativeObjectPosition entityRef="Stop_Point" dx="0" dy="0" />
              </Position>
            </DistanceCondition>
          </EntityCondition>
        </ByEntityCondition>
      </Condition>
      <Condition name="Ego_position_limit" delay="0" conditionEdge="none">
        <ByEntityCondition>
          <TriggeringEntities triggeringEntitiesRule="any">
            <EntityRef entityRef="Ego" />
          </TriggeringEntities>
          <EntityCondition>
            <DistanceCondition value="500.0" freespace="false" rule="lessThan">
              <Position>
                <RelativeObjectPosition entityRef="Stop_Point" dx="0" dy="0" />
              </Position>
            </DistanceCondition>
          </EntityCondition>
        </ByEntityCondition>
      </Condition>
    </SuccessConditionGroup>
    <FailureConditionGroup>
      <Condition name="Collision_occured" delay="0" conditionEdge="once">
        <ByValueCondition>
          <UserDefinedValueCondition name="collision" rule="equalTo" value="true" />
        </ByValueCondition>
      </Condition>
    </FailureConditionGroup>
  </Evaluation>
CODE

 

LinkPosition

MORAI에서 사용하는 MGeo 데이터의 Link를 활용한 Position을 정의한다.

Attribute

Type

Cardinality

Description

id

string

1..1

link id

index

unsigned int

1..1

link 내 point index

<Route name="NPC_1_Route" closed="false" afterCompletion="hide">
    <Waypoint routeStrategy="shortest">
        <Position>
            <LinkPosition id="A219BS010381" index="2"/>
        </Position>
    </Waypoint>
    <Waypoint routeStrategy="shortest">
        <Position>
            <LinkPosition id="A219BS010402"/>
        </Position>
    </Waypoint>
    <Waypoint routeStrategy="shortest">
        <Position>
            <LinkPosition id="A219BS010422"/>
        </Position>
    </Waypoint>
    <Waypoint routeStrategy="shortest">
        <Position>
            <LinkPosition id="A219BS010073" index="10"/>
        </Position>
    </Waypoint>
</Route>
CODE

 

PositionInLInkCoordinates

RoutePosition에서 Link Position을 활용할 수 있도록 추가된 요소이다.

Attribute

Type

Cardinality

Description

id

string

1..1

link id

index

unsigned int

1..1

link 내 point index

<RoutePosition>
  <RouteRef />
  <Orienation />
  <InRoutePosition>
    <FromLinkCoordinates id=_3_0_L1_ index="2" />
  </InRoutePosition>
</RoutePosition>
CODE

 

SimulationInfo

Simulator 관련 정보를 정의하기 위해 SimulatorInfo 요소를 정의한다.

Element

Cardinality

Description

ScenarioFile

1..1

로드할 MORAI SIM built-in 시나리오 파일 이름 정의

Map

1..1

로드할 MORAI SIM 맵 이름 정의

<SimulatorInfo>
  <ScenarioFile name="1.json" />
  <Map name="V_RHT_HighwayJunction_1" />
</SimulatorInfo>
CODE

 

PrivateAction

ParkingAction

Attribute

Type

Cardinality

Description

name

string

1..1

ID of the parking space in MGeo.

type

enum

1..1

Parking methods ('parallel’, ‘rear’, ‘front’)

action

enum

1..1

‘park’: to park at the parking space
'exit': to exit from the parking space

<Action name="Parking_Action">
  <PrivateAction>
    <ParkingAction name="P002079" type="parallel" action="park" />
  </PrivateAction>
</Action>
CODE

 

GlobalAction

PedestrianSourceAction

Spawns pedestrian objects.

Attribute

Type

Cardinality

Description

radius

double

1..1

Radius of spawn area (not implemented)

count

integer

0..1

Maximum spawn pedestrians (default: 1e6)

period

double

0..1

Period on which pedestrians appear at the source location (sec). (default: 1 sec)

mode

enum

1..1

Defines behavior of a spawned pedestrian.
(once/ closedLoop/ repeat/ loop/ newPath/ stand)

pedestrianType

string

 

0..1

Defines type(model) of a spawned pedestrian.
(random (default) / man(1-8)_ai / woman(4-8)_ai)

Element

Cardinality

Description

Position

1..1

Position of the spawn area

Waypoint

0..1

Target location of spawned pedestrians

<GlobalAction>
  <TrafficAction>
    <PedestrianSourceAction radius="10" count="5" period="10"
                            mode="closedLoop" pedestrianType="random" >
      <Position>
        <WorldPosition x="307.426506536839" y=" 118.975891092156" z="0.15"/>
      </Position>
      <Waypoint routeStrategy="random">
        <Position>
          <WorldPosition x="314.494013321081" y="191.865" z="0.15" h="0.0" p="0.0" r="0.0"/>
        </Position>
      </Waypoint>
    </PedestrianSourceAction>
  </TrafficAction>
</GlobalAction>
CODE

UserDefinedAction

CreateMapObjectAction

CreatePuddleAction

Creates a puddle at the given position. The puddle area has scaled friction.

Attribute

Type

Cardinality

Description

name

string

1..1

ID of a puddle

positionX

double

1..1

The x coordinate value. (unit: m)

positionY

double

1..1

The y coordinate value. (unit: m)

positionZ

double

1..1

The z coordinate value. (unit: m)

rotationX

double

1..1

The roll angle of the object, defining a mathematically positive rotation about the x-axis (unit: deg)

rotationY

double

1..1

The pitch angle of the object, defining a mathematically positive rotation about the y-axis (unit: deg)

rotationZ

double

1..1

The yaw angle of the object, defining a mathematically positive rotation about the z-axis (unit: deg)

radiusH

double

1..1

Horizontal radius of the puddle (unit: m)

radiusV

double

1..1

Vertical radius of the puddle (unit: m)

height

double

1..1

Height of the puddle (unit: m)

friction

double

1..1

Multiplier of the friction on the puddle (range: [0..1])

<Init>
  <UserDefinedAction>
    <CreateMapObjectAction>
      <CreatePuddleAction name="Puddle_1" positionX="20.2" positionY="17.6" positionZ="0.19"
                                          rotationX="0.0" rotationY="0.0" rotationZ="90.0"
                                          radiusH="1.5" radiusV="2.0" height="0.01" friction="0.1" />
    </CreateMapObjectAction>
  </UserDefinedAction>
</Init>
CODE

 

FaultInjectionAction

DamageAction

Injects a type-wise damage to the actors. The corresponding state would be maintained as it was when the action was activated.

Attribute

Type

Cardinality

Description

type

enum

1..1

Damage type (currently, ‘fire’ is the only option)

<Action name="Fire_Action">
  <UserDefinedAction>
    <FaultInjectionAction>
      <DamageAction type="fire" />
    </FaultInjectionAction>
  </UserDefinedAction>
</Action>
CODE

 

InoperabilityAction

Injects a type-wise Inoperability to the actors. The corresponding state would be maintained as it was when the action was activated.

Attribute

Type

Cardinality

Description

type

enum

1..1

Fault type (accel, brake, steer)

<Action name="Steering_Fault_Action">
  <UserDefinedAction>
    <FaultInjectionAction>
      <InoperabilityAction type="steer" />
    </FaultInjectionAction>
  </UserDefinedAction>
</Action>
CODE

 

SensorFaultAction

Injects an sensor fault to a sensor. The sensor would be shifted by the given offsets.

Attribute

Type

Cardinality

Description

name

string

1..1

ID of a sensor in MGeo

offsetX

double

1..1

Artificial translation offset of the sensor in X coordinate

offsetY

double

1..1

Artificial translation offset of the sensor in Y coordinate

offsetZ

double

1..1

Artificial translation offset of the sensor in Z coordinate

offsetP

double

1..1

Artificial rotation offset of the sensor about the X axis

offsetQ

double

1..1

Artificial rotation offset of the sensor about the Y axis

offsetR

double

1..1

Artificial rotation offset of the sensor about the Z axis

<Action name="Sensor_Fault_Action">
  <UserDefinedAction>
    <FaultInjectionAction>
      <SensorFaultAction name="3" offsetX="1" offsetY="1" offsetZ="1" 
                                  offsetP="1" offsetQ="1" offsetR="1" />
    </FaultInjectionAction>
  </UserDefinedAction>
</Action>
CODE

 

SteeringDisturbanceAction

Injects a steering disturbance to actors.

Attribute

Type

Cardinality

Description

duration

double

1..1

Duration of the fault. (unit: sec , range: [0..inf])

magnitude

double

1..1

Magnitude of the fault. (range: [-1..1])

<Action name="Steering_Disturbance_Action">
  <UserDefinedAction>
    <FaultInjectionAction>
      <SteeringDisturbanceAction duration="12.5" magnitude="0.8" />
    </FaultInjectionAction>
  </UserDefinedAction>
</Action>
CODE

 

TireFaultAction

Injects a tire fault to actors.

Attribute

Type

Cardinality

Description

tire

enum

1..1

Index of a tire of the actors ( 0, 1, 2, 3 )

<Action name="Tire_Fault_Action">
  <UserDefinedAction>
    <FaultInjectionAction>
      <TireFaultAction tire="3" />
    </FaultInjectionAction>
  </UserDefinedAction>
</Action>
CODE

 

수정된 요소

Route

afterCompletion 속성을 추가로 정의하여 경로 주행 후 동작을 정의한다.

Attribute

Type

Cardinality

Description

name

string

1..1

Name of the route.

closed

boolean

1..1

In a closed route, the last waypoint is followed by the first waypoint to create a closed route.

afterCompletion

enum

1..1

Behavior after arriving at the target waypoint
( ‘hide’: remove the vehicle (default),
‘stop’: stop, ‘random’: drive along a random route)

Element

Cardinality

Description

ParameterDeclarations

0..*

Definition of additional parameters.

Waypoints

2..*

At least two waypoints are needed to define a route.

<Route name="NPC_1_Route" closed="false" afterCompletion="hide">
    <Waypoint routeStrategy="shortest">
        <Position>
            <LinkPosition id="A219BS010381" index="2"/>
        </Position>
    </Waypoint>
    <Waypoint routeStrategy="shortest">
        <Position>
            <LinkPosition id="A219BS010402"/>
        </Position>
    </Waypoint>
    <Waypoint routeStrategy="shortest">
        <Position>
            <LinkPosition id="A219BS010422"/>
        </Position>
    </Waypoint>
    <Waypoint routeStrategy="shortest">
        <Position>
            <LinkPosition id="A219BS010073" index="10"/>
        </Position>
    </Waypoint>
</Route>
CODE

 

SpeedActionTarget

AbsoluteTargetSpeed

MGeo 상에 정의된 Link Speed 및 속도의 오차범위를 추가로 정의한다.

Attribute

Type

Cardinality

Description

value

double

1..1

Value of the absolute speed.
( link_type: [0..1], custom_type: [0..inf] (m/s))

type (added)

enum

0..1

Type of the defined speed. ( ‘link’, ‘custom’ )

range (added)

double

0..1

Range of the speed
( link_type: [0..1], custom_type: [0..inf] (m/s))

<AbsoluteTargetSpeed type="link" value="0.05" />
<AbsoluteTargetSpeed type="custom" value="-15" range="5" />
<AbsoluteTargetSpeed type="link" value="0.9" range="0.05" />
CODE

 

RelativeTargetSpeed

MGeo 상에 정의된 Link Speed 및 상대속도의 오차범위를 추가로 정의한다.

Attribute

Type

Cardinality

Description

continuous

boolean

1..1

True: a controller tries to maintain a continuous relative speed (not implemented)

entityRef

string

1..1

Reference entity

speedTargetValueType

enum

1..1

The value is either a delta or a factor.

value

double

1..1

Value of the relative speed. This value is either given as a delta or as a factor.
( link_type: [0..1], custom_type: [0..inf] (m/s))

type (added)

enum

0..1

Type of the defined speed. ( ‘link’, ‘custom’ )

range (added)

double

0..1

Range of the speed
( link_type: [0..1], custom_type: [0..inf] (m/s))

<RelativeTargetSpeed continuous="false" entityRef="Ego" speedTaretValueType="delta"
                     type="link" value="0.05" />
<RelativeTargetSpeed continuous="false" entityRef="Ego" speedTaretValueType="delta"
                     type="custom" value="-15" range="5" />
<RelativeTargetSpeed continuous="false" entityRef="Ego" speedTaretValueType="factor"
                     type="custom" value="1.1" range="0.05" />
<RelativeTargetSpeed continuous="true" entityRef="Ego" speedTaretValueType="factor"
                     type="link" value="0.9" range="0.05" />
CODE

 

TrafficDefinition

OpenScenario 에서와는 달리 각 Vehicle Distribution 마다 Controller를 지정하지 않아도 된다.

Attribute

Type

Cardinality

Description

name

string

1..1

Name of the traffic definition.

Element

Cardinality

Description

VehicleCategoryDistribution

1..1

Distribution of vehicle categories within the traffic.

ControllerDistribution

0..1

Distribution of controllers within this traffic.

<TrafficDefinition name="TrafficDefinition_1">
  <VehicleCategoryDistribution>
    <VehicleCategoryDistributionEntry model="2016_Hyundai_Ioniq" weight="1" />
  </VehicleCategoryDistribution>
</TrafficDefinition>
CODE

 

VehicleCategoryDistributionEntry

차량의 카테고리 또는 특정 모델을 지정하여 정의할 수 있다.

Attribute

Type

Cardinality

Description

model (added)

string

0..1

Model name of the vehicle which is implemented in MORAI SIM: Drive. If it’s specified, ‘category’ would be ignored. Either ‘model’ or ‘category’ is required.

category (modified)

enum

0..1

The category of the vehicles that appear in traffic.
(bicycle/ bus/ car/ motorbike/ semitrailer/ trailer/ train/ tram/ truck/ van/ mini/ compact/ middle/ large)

weight

double

1..1

The weight of a vehicle category within a traffic distribution. [0..inf]

<TrafficDefinition name="TrafficDefinition_1">
  <VehicleCategoryDistribution>
    <VehicleCategoryDistributionEntry model="2016_Hyundai_Ioniq" weight="1" />
  </VehicleCategoryDistribution>
</TrafficDefinition>

<TrafficDefinition name="TrafficDefinition_2">
  <VehicleCategoryDistribution>
    <VehicleCategoryDistributionEntry category="compact" weight="1" />
    <VehicleCategoryDistributionEntry category="middle" weight="1" />
    <VehicleCategoryDistributionEntry category="large" weight="1" />
  </VehicleCategoryDistribution>
</TrafficDefinition>

<TrafficDefinition name="TrafficDefinition_3">
  <VehicleCategoryDistribution>
    <VehicleCategoryDistributionEntry model="2016_Hyundai_Ioniq" weight="1" />
    <VehicleCategoryDistributionEntry category="mini" weight="1" />  <!-- would be ignored -->
  </VehicleCategoryDistribution>
</TrafficDefinition>
CODE

 

GlobalAction

TrafficSignalControllerAction

교차로 신호 Phase를 변경한다. Phase 요소를 하위에 정의하여 교차로 신호 Phase 정의 자체를 변경할 수도 있고, Phase 요소 없이 phase 속성만 정의하여 현재 신호만 변경할 수도 있다.

Attribute

Type

Cardinality

Description

trafficSignalControllerRef
(modified)

string

1..1

ID of the intersection controller in MGeo.

phase (modified)

unsigned int

1..1

The phase of the signal controller would be changed to the given value (0, 1, 2, …)

PhaseRef (deleted)

string

0..0

reference to pre-defined Phase

Element

Cardinality

Description

Phase (moved)

0..1

(According to OpenSCENARIO, It should be defined under RoadNetwork. Now it is directly defined under the action.)

<GlobalAction>
  <InfrastructureAction>
    <TrafficSignalAction>
      <TrafficSignalControllerAction trafficSignalControllerRef="IntTL1" phase="1" />
      <!-- The phase of "IntTL1" would be changed to phase "1" -->
    </TrafficSignalAction>
  </InfrastructureAction>
</GlobalAction>
CODE
<GlobalAction>
  <InfrastructureAction>
    <TrafficSignalAction>
      <TrafficSignalControllerAction trafficSignalControllerRef="IntTL1" phase="1">
        <Phase name="phase1" duration="5">
          <TrafficSignalState trafficSignalId="C119BS010034" state="G_with_GLeft"/>
          <TrafficSignalState trafficSignalId="C119BS010072" state="R"/>
          <TrafficSignalState trafficSignalId="C119BS010033" state="R"/>
        </Phase>
        <Phase name="phase2" duration="5">
          <TrafficSignalState trafficSignalId="C119BS010034" state="R"/>
          <TrafficSignalState trafficSignalId="C119BS010072" state="G_with_GLeft"/>
          <TrafficSignalState trafficSignalId="C119BS010033" state="R"/>
        </Phase>
        <Phase name="phase3" duration="5">
          <TrafficSignalState trafficSignalId="C119BS010034" state="R"/>
          <TrafficSignalState trafficSignalId="C119BS010072" state="R"/>
          <TrafficSignalState trafficSignalId="C119BS010033" state="G_with_GLeft"/>
        </Phase>
      </TrafficSignalControllerAction>
    </TrafficSignalAction>
  </InfrastructureAction>
</GlobalAction>
CODE

 

TrafficSignalStateAction

Attribute

Type

Cardinality

Description

name (modified)

string

1..1

ID of the signal in MGeo.

state (modified)

enum

1..1

Targeted state of the signal. The available states are listed in TrafficSignal list of _TRAFFICLIGHT_LIGHTCOLOR

impulse (added)

boolean

1..1

true: return to the phase cycle,
false: keep the given signal state

setSibling (added)

boolean

1..1

true: change all synced signals,
false: change this signal only

<GlobalAction>
  <InfrastructureAction>
    <TrafficSignalAction>
      <TrafficSignalStateAction name="C119BS010034" state="SG" impulse="false" setSibling="false"/>
    </TrafficSignalAction>
  </InfrastructureAction>
</GlobalAction>
CODE

 

TrafficSourceAction

Spawns vehicle objects. Several attributes are added for the compatibility with MORAI SIM: Drive

Attribute

Type

Cardinality

Description

radius

double

1..1

Radius of spawn area (not implemented)

velocity

double

0..1

Initial velocity of spawned vehicles (m/s). It would be ignored when ‘InitSpeed’ is defiend.

count

integer

0..1

Maximum spawn vehicles (default: 1e6)

rate

double

0..1 *

Rate on which vehicles appear at the source location (vehicles/s). It would be ignored when ‘Period’ is defined

period

double

0..1 *

Period on which vehicles appear at the source location (sec). Either ‘rate’ or ‘period’ is required.

periodRange

double

0..1

Range of the period (sec)

offset

double

0..1

Signed number the vehicle should respect as an offset from the center of the current lane. [-1..1]

offsetRange

double

0..1

Range of the offset [0..1]

closedLoop

bool

0..1

True: spawned vehicles would come back to the spawn location. False: vehicles would be disappear at their target location.

discretionaryLaneChange

bool

0..1

True: a spawned vehicle would change its lane randomly. False: the vehicle would keep its initial lane.

Element

Cardinality

Description

Position

1..1

Position of the spawn area

InitSpeed

1..1

Initial speed of spawned vehicles

DesiredSpeed

0..1

Desired speed of spawned vehicles

Waypoint

0..1

Target location of spawned vehicles

TrafficDefinition

1..1

Defines the vehicle and controller distribution for the source.

<GlobalAction>
  <TrafficAction>
    <TrafficSourceAction radius="10" count="5" period="10" periodRange="5" 
                         offset="0" offsetRange="0.1"
                         closedLoop="false" discretionaryLaneChange="true" >
      <Position>
        <LinkPosition id="A219BS010313" index="0"/>
      </Position>
      <InitSpeed>
        <AbsoluteTargetSpeed type="link" value="0.35" range="0.05"/>
      </InitSpeed>
      <DesiredSpeed>
        <AbsoluteTargetSpeed type="custom" value="55" range="15"/>
      </DesiredSpeed>
      <Waypoint routeStrategy="random">
        <Position>
          <LinkPosition id="A219BS010319" index="280"/>
        </Position>
      </Waypoint>
      <TrafficDefinition name="TrafficDefinition_1">
        <VehicleCategoryDistribution>
          <VehicleCategoryDistributionEntry model="2014_Kia_K7" weight="1" />
        </VehicleCategoryDistribution>
      </TrafficDefinition>
    </TrafficSourceAction>
  </TrafficAction>
</GlobalAction>
CODE

 


© 2022 MORAI Inc.