Skip to content

Commit

Permalink
Add variation files for logical scenarios
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Rauschert <andreas.rb.rauschert@bmw.de>
  • Loading branch information
arauschert committed Jul 7, 2021
1 parent 531b5de commit 408156c
Show file tree
Hide file tree
Showing 24 changed files with 627 additions and 116 deletions.
8 changes: 4 additions & 4 deletions Scenarios/ALKS_Scenario_4.1_1_FreeDriving_TEMPLATE.xosc
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<FileHeader revMajor="1" revMinor="1" date="2021-06-18T10:00:00" description="ALKS Scenario 4.1_1 FreeDriving Template" author="BMW AG" />
<ParameterDeclarations>
<!--The ParameterDeclarations section is needed for easy variation.-->
<ParameterDeclaration name="Ego_InitSpeed_Ve0" parameterType="double" value="16.66666667">
<ParameterDeclaration name="Ego_InitSpeed_Ve0_kph" parameterType="double" value="60.0">
<ConstraintGroup>
<!--The scenarios are meant to be run with a positive ego speed less than 250 km/h (~70 m/s).-->
<!--The scenarios are meant to be run with a positive ego speed up to 60 kph.-->
<ValueConstraint rule="greaterThan" value="0.0" />
<ValueConstraint rule="lessOrEqual" value="70.0" />
<ValueConstraint rule="lessOrEqual" value="60.0" />
</ConstraintGroup>
</ParameterDeclaration>
<ParameterDeclaration name="Duration" parameterType="double" value="300">
Expand Down Expand Up @@ -58,7 +58,7 @@
<SpeedAction>
<SpeedActionDynamics dynamicsShape="step" dynamicsDimension="time" value="0" />
<SpeedActionTarget>
<AbsoluteTargetSpeed value="$Ego_InitSpeed_Ve0" />
<AbsoluteTargetSpeed value="${$Ego_InitSpeed_Ve0_kph / 3.6}" />
</SpeedActionTarget>
</SpeedAction>
</LongitudinalAction>
Expand Down
15 changes: 8 additions & 7 deletions Scenarios/ALKS_Scenario_4.1_2_SwervingLeadVehicle_TEMPLATE.xosc
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
<ValueConstraint rule="lessOrEqual" value="5" />
</ConstraintGroup>
</ParameterDeclaration>
<ParameterDeclaration name="Ego_InitSpeed_Ve0" parameterType="double" value="16.66666667">
<ParameterDeclaration name="Ego_InitSpeed_Ve0_kph" parameterType="double" value="60.0">
<ConstraintGroup>
<!--The scenarios are meant to be run with a positive ego speed less than 250 km/h (~70 m/s).-->
<!--The scenarios are meant to be run with a positive ego speed up to 60 kph.-->
<ValueConstraint rule="greaterThan" value="0.0" />
<ValueConstraint rule="lessOrEqual" value="70.0" />
<ValueConstraint rule="lessOrEqual" value="60.0" />
</ConstraintGroup>
</ParameterDeclaration>
<ParameterDeclaration name="Duration" parameterType="double" value="40">
Expand All @@ -28,7 +28,8 @@
<ParameterDeclaration name="LeadVehicle_Model" parameterType="string" value="car">
<!--Not constrained so it's possible to use different models.-->
</ParameterDeclaration>
<ParameterDeclaration name="LeadVehicle_InitDistance_dx0" parameterType="double" value="33.33333333">
<ParameterDeclaration name="LeadVehicle_InitDistance_dx0_m" parameterType="double" value="${2.0 * ($Ego_InitSpeed_Ve0_kph / 3.6)}">
<!--Distance is calculated from 2 second headway time.-->
<ConstraintGroup>
<ValueConstraint rule="greaterThan" value="0.0"></ValueConstraint>
</ConstraintGroup>
Expand Down Expand Up @@ -93,7 +94,7 @@
<SpeedAction>
<SpeedActionDynamics dynamicsShape="step" dynamicsDimension="time" value="0" />
<SpeedActionTarget>
<AbsoluteTargetSpeed value="$Ego_InitSpeed_Ve0" />
<AbsoluteTargetSpeed value="${$Ego_InitSpeed_Ve0_kph / 3.6}" />
</SpeedActionTarget>
</SpeedAction>
</LongitudinalAction>
Expand All @@ -103,7 +104,7 @@
<PrivateAction>
<TeleportAction>
<Position>
<RelativeLanePosition entityRef="Ego" dLane="0" ds="$LeadVehicle_InitDistance_dx0" offset="0.0" />
<RelativeLanePosition entityRef="Ego" dLane="0" ds="$LeadVehicle_InitDistance_dx0_m" offset="0.0" />
</Position>
</TeleportAction>
</PrivateAction>
Expand Down Expand Up @@ -280,4 +281,4 @@
</ConditionGroup>
</StopTrigger>
</Storyboard>
</OpenSCENARIO>
</OpenSCENARIO>
14 changes: 7 additions & 7 deletions Scenarios/ALKS_Scenario_4.1_3_SwervingSideVehicle_TEMPLATE.xosc
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<FileHeader revMajor="1" revMinor="1" date="2021-06-18T10:00:00" description="ALKS Scenario 4.1_3 Swerving Side Vehicle Template" author="BMW AG" />
<ParameterDeclarations>
<!--The ParameterDeclarations section is needed for easy variation.-->
<ParameterDeclaration name="Ego_InitSpeed_Ve0" parameterType="double" value="16.66666667">
<ParameterDeclaration name="Ego_InitSpeed_Ve0_kph" parameterType="double" value="60.0">
<ConstraintGroup>
<!--The scenarios are meant to be run with a positive ego speed less than 250 km/h (~70 m/s).-->
<!--The scenarios are meant to be run with a positive ego speed up to 60 kph.-->
<ValueConstraint rule="greaterThan" value="0.0" />
<ValueConstraint rule="lessOrEqual" value="70.0" />
<ValueConstraint rule="lessOrEqual" value="60.0" />
</ConstraintGroup>
</ParameterDeclaration>
<ParameterDeclaration name="Duration" parameterType="double" value="40">
Expand All @@ -18,7 +18,7 @@
<ParameterDeclaration name="SideVehicle_Model" parameterType="string" value="car">
<!--Not constrained so it's possible to use different models.-->
</ParameterDeclaration>
<ParameterDeclaration name="SideVehicle_InitLongitudinalOffset" parameterType="double" value="0.0" />
<ParameterDeclaration name="SideVehicle_InitLongitudinalOffset_m" parameterType="double" value="0.0" />
<ParameterDeclaration name="SideVehicle_InitPosition_RelativeLaneId" parameterType="string" value="1">
<ConstraintGroup>
<ValueConstraint rule="equalTo" value="1"></ValueConstraint>
Expand Down Expand Up @@ -87,7 +87,7 @@
<SpeedAction>
<SpeedActionDynamics dynamicsShape="step" dynamicsDimension="time" value="0" />
<SpeedActionTarget>
<AbsoluteTargetSpeed value="$Ego_InitSpeed_Ve0" />
<AbsoluteTargetSpeed value="${$Ego_InitSpeed_Ve0_kph / 3.6}" />
</SpeedActionTarget>
</SpeedAction>
</LongitudinalAction>
Expand All @@ -97,7 +97,7 @@
<PrivateAction>
<TeleportAction>
<Position>
<RelativeLanePosition entityRef="Ego" dLane="$SideVehicle_InitPosition_RelativeLaneId" ds="$SideVehicle_InitLongitudinalOffset" offset="0.0" />
<RelativeLanePosition entityRef="Ego" dLane="$SideVehicle_InitPosition_RelativeLaneId" ds="$SideVehicle_InitLongitudinalOffset_m" offset="0.0" />
</Position>
</TeleportAction>
</PrivateAction>
Expand All @@ -106,7 +106,7 @@
<SpeedAction>
<SpeedActionDynamics dynamicsShape="step" dynamicsDimension="time" value="0" />
<SpeedActionTarget>
<AbsoluteTargetSpeed value="$Ego_InitSpeed_Ve0" />
<RelativeTargetSpeed entityRef="Ego" value="0" speedTargetValueType="delta" continuous="false" />
</SpeedActionTarget>
</SpeedAction>
</LongitudinalAction>
Expand Down
30 changes: 18 additions & 12 deletions Scenarios/ALKS_Scenario_4.2_1_FullyBlockingTarget_TEMPLATE.xosc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
<FileHeader revMajor="1" revMinor="1" date="2021-06-18T10:00:00" description="ALKS Scenario 4.2_1 FullyBlockingTarget Template" author="BMW AG" />
<ParameterDeclarations>
<!--The ParameterDeclarations section is needed for easy variation.-->
<ParameterDeclaration name="Ego_InitSpeed_Ve0_kph" parameterType="double" value="60.0">
<ConstraintGroup>
<!--The scenarios are meant to be run with a positive ego speed up to 60 kph.-->
<ValueConstraint rule="greaterThan" value="0.0" />
<ValueConstraint rule="lessOrEqual" value="60.0" />
</ConstraintGroup>
</ParameterDeclaration>
<ParameterDeclaration name="Ego_InitPosition_LaneId" parameterType="string" value="-4">
<ConstraintGroup>
<ValueConstraint rule="lessOrEqual" value="-3" />
Expand All @@ -13,23 +20,22 @@
<ValueConstraint rule="lessOrEqual" value="5" />
</ConstraintGroup>
</ParameterDeclaration>
<ParameterDeclaration name="Ego_InitSpeed_Ve0" parameterType="double" value="16.66666667">
<ParameterDeclaration name="TargetBlocking_Catalog" parameterType="string" value="PedestrianCatalog">
<!--Not constrained so it's possible to use different catalogs.-->
</ParameterDeclaration>
<ParameterDeclaration name="TargetBlocking_Model" parameterType="string" value="pedestrian">
<!--Not constrained so it's possible to use different models.-->
</ParameterDeclaration>
<ParameterDeclaration name="TargetBlocking_InitPosition_LongitudinalOffset" parameterType="double" value="500.0">
<ConstraintGroup>
<!--The scenarios are meant to be run with a positive ego speed less than 250 km/h (~70 m/s).-->
<ValueConstraint rule="greaterThan" value="0.0" />
<ValueConstraint rule="lessOrEqual" value="70.0" />
</ConstraintGroup>
</ParameterDeclaration>
<ParameterDeclaration name="Duration" parameterType="double" value="40">
<ParameterDeclaration name="Duration" parameterType="double" value="${($TargetBlocking_InitPosition_LongitudinalOffset / ($Ego_InitSpeed_Ve0_kph / 3.6)) + 10.0}">
<ConstraintGroup>
<ValueConstraint rule="greaterThan" value="0.0"></ValueConstraint>
</ConstraintGroup>
</ParameterDeclaration>
<ParameterDeclaration name="TargetBlocking_Catalog" parameterType="string" value="PedestrianCatalog">
<!--Not constrained so it's possible to use different catalogs.-->
</ParameterDeclaration>
<ParameterDeclaration name="TargetBlocking_Model" parameterType="string" value="pedestrian">
<!--Not constrained so it's possible to use different models.-->
<!--10 s more than the ego would need to reach the target without braking.-->
</ParameterDeclaration>
</ParameterDeclarations>
<CatalogLocations>
Expand Down Expand Up @@ -76,7 +82,7 @@
<SpeedAction>
<SpeedActionDynamics dynamicsShape="step" dynamicsDimension="time" value="0" />
<SpeedActionTarget>
<AbsoluteTargetSpeed value="$Ego_InitSpeed_Ve0" />
<AbsoluteTargetSpeed value="${$Ego_InitSpeed_Ve0_kph / 3.6}" />
</SpeedActionTarget>
</SpeedAction>
</LongitudinalAction>
Expand All @@ -86,7 +92,7 @@
<PrivateAction>
<TeleportAction>
<Position>
<LanePosition roadId="0" laneId="$Ego_InitPosition_LaneId" offset="0.0" s="500.0"></LanePosition>
<LanePosition roadId="0" laneId="$Ego_InitPosition_LaneId" offset="0.0" s="$TargetBlocking_InitPosition_LongitudinalOffset"></LanePosition>
</Position>
</TeleportAction>
</PrivateAction>
Expand Down
26 changes: 16 additions & 10 deletions Scenarios/ALKS_Scenario_4.2_2_PartiallyBlockingTarget_TEMPLATE.xosc
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,11 @@
<ValueConstraint rule="lessOrEqual" value="5" />
</ConstraintGroup>
</ParameterDeclaration>
<ParameterDeclaration name="Ego_InitSpeed_Ve0" parameterType="double" value="16.66666667">
<ParameterDeclaration name="Ego_InitSpeed_Ve0_kph" parameterType="double" value="60.0">
<ConstraintGroup>
<!--The scenarios are meant to be run with a positive ego speed less than 250 km/h (~70 m/s).-->
<!--The scenarios are meant to be run with a positive ego speed up to 60 kph.-->
<ValueConstraint rule="greaterThan" value="0.0" />
<ValueConstraint rule="lessOrEqual" value="70.0" />
</ConstraintGroup>
</ParameterDeclaration>
<ParameterDeclaration name="Duration" parameterType="double" value="40">
<ConstraintGroup>
<ValueConstraint rule="greaterThan" value="0.0"></ValueConstraint>
<ValueConstraint rule="lessOrEqual" value="60.0" />
</ConstraintGroup>
</ParameterDeclaration>
<ParameterDeclaration name="TargetBlocking_Catalog" parameterType="string" value="PedestrianCatalog">
Expand All @@ -38,6 +33,17 @@
<!--The target must be still partially on the ego lane (lane width(3.5) / 2 + target width(2.5) / 2)-->
</ConstraintGroup>
</ParameterDeclaration>
<ParameterDeclaration name="TargetBlocking_InitPosition_LongitudinalOffset" parameterType="double" value="500.0">
<ConstraintGroup>
<ValueConstraint rule="greaterThan" value="0.0" />
</ConstraintGroup>
</ParameterDeclaration>
<ParameterDeclaration name="Duration" parameterType="double" value="${($TargetBlocking_InitPosition_LongitudinalOffset / ($Ego_InitSpeed_Ve0_kph / 3.6)) + 10.0}">
<ConstraintGroup>
<ValueConstraint rule="greaterThan" value="0.0"></ValueConstraint>
</ConstraintGroup>
<!--10 s more than the ego would need to reach the target without braking.-->
</ParameterDeclaration>
</ParameterDeclarations>
<CatalogLocations>
<VehicleCatalog>
Expand Down Expand Up @@ -83,7 +89,7 @@
<SpeedAction>
<SpeedActionDynamics dynamicsShape="step" dynamicsDimension="time" value="0" />
<SpeedActionTarget>
<AbsoluteTargetSpeed value="$Ego_InitSpeed_Ve0" />
<AbsoluteTargetSpeed value="${$Ego_InitSpeed_Ve0_kph / 3.6}" />
</SpeedActionTarget>
</SpeedAction>
</LongitudinalAction>
Expand All @@ -93,7 +99,7 @@
<PrivateAction>
<TeleportAction>
<Position>
<LanePosition roadId="0" laneId="$Ego_InitPosition_LaneId" offset="$TargetBlocking_InitPosition_Offset" s="500.0"></LanePosition>
<LanePosition roadId="0" laneId="$Ego_InitPosition_LaneId" offset="$TargetBlocking_InitPosition_Offset" s="$TargetBlocking_InitPosition_LongitudinalOffset"></LanePosition>
</Position>
</TeleportAction>
</PrivateAction>
Expand Down
43 changes: 31 additions & 12 deletions Scenarios/ALKS_Scenario_4.2_3_CrossingPedestrian_TEMPLATE.xosc
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,36 @@
<ValueConstraint rule="equalTo" value="-4" />
</ConstraintGroup>
</ParameterDeclaration>
<ParameterDeclaration name="Ego_InitSpeed_Ve0" parameterType="double" value="16.66666667">
<ParameterDeclaration name="Ego_InitSpeed_Ve0_kph" parameterType="double" value="60.0">
<ConstraintGroup>
<!--The scenarios are meant to be run with a positive ego speed less than 250 km/h (~70 m/s).-->
<!--The scenarios are meant to be run with a positive ego speed up to 60 kph.-->
<ValueConstraint rule="greaterThan" value="0.0" />
<ValueConstraint rule="lessOrEqual" value="70.0" />
<ValueConstraint rule="lessOrEqual" value="60.0" />
</ConstraintGroup>
</ParameterDeclaration>
<ParameterDeclaration name="Duration" parameterType="double" value="40">
<ParameterDeclaration name="TargetBlocking_InitPosition_Heading" parameterType="double" value="1.57">
<!--Heading / orientation of pedestrian is not constrained.-->
</ParameterDeclaration>
<ParameterDeclaration name="TargetBlocking_InitPosition_LongitudinalOffset" parameterType="double" value="500.0">
<ConstraintGroup>
<ValueConstraint rule="greaterThan" value="0.0" />
</ConstraintGroup>
</ParameterDeclaration>
<ParameterDeclaration name="TargetBlocking_InitPosition_LateralOffset" parameterType="double" value="-5.0">
<!--Lateral offset of the pedestrian relative to the ego.-->
</ParameterDeclaration>
<ParameterDeclaration name="Duration" parameterType="double" value="${($TargetBlocking_InitPosition_LongitudinalOffset / $Ego_InitSpeed_Ve0_kph) + 10.0}">
<ConstraintGroup>
<ValueConstraint rule="greaterThan" value="0.0"></ValueConstraint>
</ConstraintGroup>
<!--10 s more than the ego would need to reach the target without braking.-->
</ParameterDeclaration>
<ParameterDeclaration name="TargetBlocking_InitPosition_Heading" parameterType="double" value="1.57">
<!--Heading / orientation of pedestrian is not constrained.-->
<ParameterDeclaration name="TargetBlocking_Speed_kph" parameterType="double" value="5.0">
<ConstraintGroup>
<!--The pedestrian shall walk with a speed of 5 kph according to the test specification.-->
<ValueConstraint rule="greaterThan" value="0.0" />
<ValueConstraint rule="lessOrEqual" value="10.0" />
</ConstraintGroup>
</ParameterDeclaration>
</ParameterDeclarations>
<CatalogLocations>
Expand Down Expand Up @@ -69,7 +85,7 @@
<SpeedAction>
<SpeedActionDynamics dynamicsShape="step" dynamicsDimension="time" value="0" />
<SpeedActionTarget>
<AbsoluteTargetSpeed value="$Ego_InitSpeed_Ve0" />
<AbsoluteTargetSpeed value="${$Ego_InitSpeed_Ve0_kph / 3.6}" />
</SpeedActionTarget>
</SpeedAction>
</LongitudinalAction>
Expand All @@ -79,7 +95,7 @@
<PrivateAction>
<TeleportAction>
<Position>
<LanePosition roadId="0" laneId="$Ego_InitPosition_LaneId" offset="-5.0" s="500.0">
<LanePosition roadId="0" laneId="$Ego_InitPosition_LaneId" offset="$TargetBlocking_InitPosition_LateralOffset" s="$TargetBlocking_InitPosition_LongitudinalOffset">
<Orientation h="$TargetBlocking_InitPosition_Heading" />
</LanePosition>
</Position>
Expand Down Expand Up @@ -144,19 +160,20 @@
<Polyline>
<Vertex time="0">
<Position>
<LanePosition roadId="0" laneId="$Ego_InitPosition_LaneId" offset="-5.0" s="500.0">
<LanePosition roadId="0" laneId="$Ego_InitPosition_LaneId" offset="$TargetBlocking_InitPosition_LateralOffset" s="$TargetBlocking_InitPosition_LongitudinalOffset">
<Orientation h="$TargetBlocking_InitPosition_Heading" />
</LanePosition>
</Position>
</Vertex>
<Vertex time="7.2">
<Vertex time="${2 * $TargetBlocking_InitPosition_LateralOffset / ($TargetBlocking_Speed_kph / 3.6)}">
<Position>
<LanePosition roadId="0" laneId="$Ego_InitPosition_LaneId" offset="5.0" s="500.0">
<LanePosition roadId="0" laneId="$Ego_InitPosition_LaneId" offset="${-$TargetBlocking_InitPosition_LateralOffset}" s="$TargetBlocking_InitPosition_LongitudinalOffset">
<Orientation h="$TargetBlocking_InitPosition_Heading" />
</LanePosition>
</Position>
</Vertex>
</Polyline>
<!--The target crosses the ego lane, so at the end the lateral offset is the same in the other direction.-->
</Shape>
</Trajectory>
</TrajectoryRef>
Expand All @@ -176,7 +193,9 @@
<EntityRef entityRef="Ego" />
</TriggeringEntities>
<EntityCondition>
<TimeHeadwayCondition entityRef="TargetBlocking" value="3.6" freespace="true" rule="lessThan" coordinateSystem="road" relativeDistanceType="longitudinal" />
<TimeHeadwayCondition entityRef="TargetBlocking" value="${$TargetBlocking_InitPosition_LateralOffset / ($TargetBlocking_Speed_kph / 3.6)}" freespace="true" rule="lessThan" coordinateSystem="road" relativeDistanceType="longitudinal">
<!--The target should start walking at a point in time, so that it has a lateral offset of 0.0 m when the ego would reach the target (without braking of the ego).-->
</TimeHeadwayCondition>
</EntityCondition>
</ByEntityCondition>
</Condition>
Expand Down
Loading

0 comments on commit 408156c

Please sign in to comment.