Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add constraints, create distribution files for variation and add units for parameters #45

Merged
merged 19 commits into from
Aug 4, 2021
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Validate all scenarios
uses: ./.github/actions/xmllint
with:
FILE: ./Scenarios/ALKS_Scenario_4.1_1_FreeDriving_TEMPLATE.xosc ./Scenarios/ALKS_Scenario_4.1_2_SwervingLeadVehicle_TEMPLATE.xosc ./Scenarios/ALKS_Scenario_4.1_3_SwervingSideVehicle_TEMPLATE.xosc ./Scenarios/ALKS_Scenario_4.2_1_FullyBlockingTarget_TEMPLATE.xosc ./Scenarios/ALKS_Scenario_4.2_2_PartiallyBlockingTarget_TEMPLATE.xosc ./Scenarios/ALKS_Scenario_4.2_3_CrossingPedestrian_TEMPLATE.xosc ./Scenarios/ALKS_Scenario_4.2_4_MultipleBlockingTargets_TEMPLATE.xosc ./Scenarios/ALKS_Scenario_4.3_1_FollowLeadVehicleComfortable_TEMPLATE.xosc ./Scenarios/ALKS_Scenario_4.3_2_FollowLeadVehicleEmergencyBrake_TEMPLATE.xosc ./Scenarios/ALKS_Scenario_4.4_1_CutInNoCollision_TEMPLATE.xosc ./Scenarios/ALKS_Scenario_4.4_2_CutInUnavoidableCollision_TEMPLATE.xosc ./Scenarios/ALKS_Scenario_4.5_1_CutOutFullyBlocking_TEMPLATE.xosc ./Scenarios/ALKS_Scenario_4.5_2_CutOutMultipleBlockingTargets_TEMPLATE.xosc ./Scenarios/ALKS_Scenario_4.6_1_ForwardDetectionRange_TEMPLATE.xosc ./Scenarios/ALKS_Scenario_4.6_2_LateralDetectionRange_TEMPLATE.xosc ./Catalogs/Controllers/ControllerCatalog.xosc ./Catalogs/MiscObjects/MiscObjectCatalog.xosc ./Catalogs/Vehicles/VehicleCatalog.xosc ./Catalogs/Pedestrians/PedestrianCatalog.xosc
arauschert marked this conversation as resolved.
Show resolved Hide resolved
FILE: ./Scenarios/ALKS_Scenario_4.1_1_FreeDriving_TEMPLATE.xosc ./Scenarios/ALKS_Scenario_4.1_2_SwervingLeadVehicle_TEMPLATE.xosc ./Scenarios/ALKS_Scenario_4.1_3_SwervingSideVehicle_TEMPLATE.xosc ./Scenarios/ALKS_Scenario_4.2_1_FullyBlockingTarget_TEMPLATE.xosc ./Scenarios/ALKS_Scenario_4.2_2_PartiallyBlockingTarget_TEMPLATE.xosc ./Scenarios/ALKS_Scenario_4.2_3_CrossingPedestrian_TEMPLATE.xosc ./Scenarios/ALKS_Scenario_4.2_4_MultipleBlockingTargets_TEMPLATE.xosc ./Scenarios/ALKS_Scenario_4.3_1_FollowLeadVehicleComfortable_TEMPLATE.xosc ./Scenarios/ALKS_Scenario_4.3_2_FollowLeadVehicleEmergencyBrake_TEMPLATE.xosc ./Scenarios/ALKS_Scenario_4.4_1_CutInNoCollision_TEMPLATE.xosc ./Scenarios/ALKS_Scenario_4.4_2_CutInUnavoidableCollision_TEMPLATE.xosc ./Scenarios/ALKS_Scenario_4.5_1_CutOutFullyBlocking_TEMPLATE.xosc ./Scenarios/ALKS_Scenario_4.5_2_CutOutMultipleBlockingTargets_TEMPLATE.xosc ./Scenarios/ALKS_Scenario_4.6_1_ForwardDetectionRange_TEMPLATE.xosc ./Scenarios/ALKS_Scenario_4.6_2_LateralDetectionRange_TEMPLATE.xosc ./Catalogs/Controllers/ControllerCatalog.xosc ./Catalogs/MiscObjects/MiscObjectCatalog.xosc ./Catalogs/Vehicles/VehicleCatalog.xosc ./Catalogs/Pedestrians/PedestrianCatalog.xosc ./Variations/ALKS_Scenario_4.1_1_FreeDriving_Variation.xosc ./Variations/ALKS_Scenario_4.1_2_SwervingLeadVehicle_Variation.xosc ./Variations/ALKS_Scenario_4.1_3_SwervingSideVehicle_Variation.xosc ./Variations/ALKS_Scenario_4.2_1_FullyBlockingTarget_Variation.xosc ./Variations/ALKS_Scenario_4.2_2_PartiallyBlockingTarget_Variation.xosc ./Variations/ALKS_Scenario_4.2_3_CrossingPedestrian_Variation.xosc ./Variations/ALKS_Scenario_4.2_4_MultipleBlockingTargets_Variation.xosc ./Variations/ALKS_Scenario_4.3_1_FollowLeadVehicleComfortable_Variation.xosc ./Variations/ALKS_Scenario_4.3_2_FollowLeadVehicleEmergencyBrake_Variation.xosc ./Variations/ALKS_Scenario_4.3_2_FollowLeadVehicleEmergencyBrake_Variation_Reference.xosc ./Variations/ALKS_Scenario_4.4_1_CutInNoCollision_Variation.xosc ./Variations/ALKS_Scenario_4.5_1_CutOutFullyBlocking_Variation.xosc ./Variations/ALKS_Scenario_4.5_2_CutOutMultipleBlockingTargets_Variation.xosc ./Variations/ALKS_Scenario_4.6_1_ForwardDetectionRange_Variation.xosc ./Variations/ALKS_Scenario_4.6_2_LateralDetectionRange_Variation.xosc
SCHEMA: ./.github/workflows/OpenSCENARIO_StrictValidation_1_1.xsd
- name: Validate all maps
uses: ./.github/actions/xmllint
Expand Down
22 changes: 11 additions & 11 deletions Catalogs/Vehicles/VehicleCatalog.xosc
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@
<Property name="SteeringRatio" value="15.0" />
</Properties>
<BoundingBox>
<Center x="1.3" y="0.0" z="0.8" />
<Dimensions width="1.8" length="4.5" height="1.5" />
<Center x="7.0" y="0.0" z="1.75" />
<Dimensions width="2.5" length="18.75" height="3.5" />
</BoundingBox>
<Performance maxSpeed="70" maxDeceleration="10" maxAcceleration="10" />
<Performance maxSpeed="30" maxDeceleration="6" maxAcceleration="4" />
<Axles>
<FrontAxle maxSteering="0.5" wheelDiameter="0.8" trackWidth="1.68" positionX="2.98" positionZ="0.4" />
<RearAxle maxSteering="0" wheelDiameter="0.8" trackWidth="1.68" positionX="0" positionZ="0.4" />
<FrontAxle maxSteering="0.5" wheelDiameter="1.05" trackWidth="2.2" positionX="14.0" positionZ="0.525" />
<RearAxle maxSteering="0" wheelDiameter="1.05" trackWidth="2.2" positionX="0" positionZ="0.525" />
</Axles>
</Vehicle>
<Vehicle name="van" vehicleCategory="truck">
Expand Down Expand Up @@ -159,13 +159,13 @@
<Property name="SteeringRatio" value="15.0" />
</Properties>
<BoundingBox>
<Center x="1.3" y="0.0" z="0.8" />
<Dimensions width="1.8" length="4.5" height="1.5" />
<Center x="4.0" y="0.0" z="1.75" />
<Dimensions width="2.5" length="13.5" height="3.5" />
</BoundingBox>
<Performance maxSpeed="70" maxDeceleration="10" maxAcceleration="10" />
<Performance maxSpeed="30" maxDeceleration="6" maxAcceleration="4" />
<Axles>
<FrontAxle maxSteering="0.5" wheelDiameter="0.8" trackWidth="1.68" positionX="2.98" positionZ="0.4" />
<RearAxle maxSteering="0" wheelDiameter="0.8" trackWidth="1.68" positionX="0" positionZ="0.4" />
<FrontAxle maxSteering="0.5" wheelDiameter="1.05" trackWidth="2.2" positionX="8.0" positionZ="0.525" />
<RearAxle maxSteering="0" wheelDiameter="1.05" trackWidth="2.2" positionX="0" positionZ="0.525" />
</Axles>
</Vehicle>
<Vehicle name="motorbike" vehicleCategory="motorbike">
Expand Down Expand Up @@ -199,4 +199,4 @@
</Axles>
</Vehicle>
</Catalog>
</OpenSCENARIO>
</OpenSCENARIO>
38 changes: 20 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,43 @@
ALKS Scenario Interpretation in OpenSCENARIO
============================================

The "ALKS Regulation UN R157" ECE/TRANS/WP.29/2020/81 <sup>[[1]](https://unece.org/transport/documents/2021/03/standards/un-regulation-no-157-automated-lane-keeping-systems-alks)</sup> is necessary for the approval of an "Automated Lane Keeping System" on motorways presented in the [UNECE Press Release](https://unece.org/transport/press/un-regulation-automated-lane-keeping-systems-milestone-safe-introduction-automated).
As presented in the [UNECE Press Release](https://unece.org/transport/press/un-regulation-automated-lane-keeping-systems-milestone-safe-introduction-automated), the "UN Regulation No. 157 - Automated Lane Keeping Systems (ALKS)" ECE/TRANS/WP.29/2020/81 <sup>[[1]](https://unece.org/transport/documents/2021/03/standards/un-regulation-no-157-automated-lane-keeping-systems-alks)</sup> describes the necessary requirements to be fulfilled for the approval of an ALKS, which is a level 3 automated driving system on motorways.

## Goal
The ALKS regulation also contains test scenarios at a functional level, which are to be carried out in close coordination with a technical service:

BMW has taken on the task of implementing the test scenarios from the ALKS regulation using [OpenSCENARIO](https://www.asam.net/standards/detail/openscenario/) and [OpenDRIVE](https://www.asam.net/standards/detail/opendrive/) resulting in a bundle of XML files executable with standard compliant simulators. The ALKS regulation itself leaves room for interpretation, therefore the coordination on a common interpretation with partners is recommended. This work has been conducted in the context of the German research project [SET Level](https://sl4to5.de/).
*"Until [...] specific test provisions have been agreed, the Technical Service shall ensure that the ALKS is subject to at least the tests outlined in Annex 5."*

## Content
## Goal

The ALKS document contains test scenarios at a functional level, which are to be carried out in close coordination with a technical service:
The ALKS regulation itself leaves room for interpretation, therefore one goal of this publication is the coordination on a common interpretation with partners. Hence, this work has also been conducted in the context of the German research project [SET Level](https://sl4to5.de/).

*"Until [...] specific test provisions have been agreed, the Technical Service shall ensure that the ALKS is subject to at least the tests outlined in Annex 5."*
BMW has taken on the task of implementing the test scenarios from the ALKS regulation. Since exchange and compatibility via the tool landscape is vital, another goal is the implementation of the scenarios using an international standard. At the [ASAM e.V.](https://www.asam.net/standards/domain-simulation/) members are developing the so called "OpenX" standards for the simulation domain like OpenSCENARIO (Release v1.1 Q1/21) for scenario definitions and OpenDRIVE (Release v1.6 Q1/2020) for road network definitions. The implementation is using [OpenSCENARIO](https://www.asam.net/standards/detail/openscenario/) and [OpenDRIVE](https://www.asam.net/standards/detail/opendrive/), resulting in a bundle of XML files executable with standard compliant simulators.

The here provided 15 executable test scenarios are derived from the 6 subject areas analogous to Annex 5, Chapter 4.1-4.6 as an initial attempt to clarify the described set of functional scenarios.
## Content

The implementation of the scenarios should as well be conducted using an international standard to ensure exchange and compatibility via the tool landscape. At the [ASAM e.V.](https://www.asam.net/standards/domain-simulation/) members are developing the so called "OpenX" standards for the simulation domain like OpenSCENARIO (Release v1.1 Q1/21) for test scenario definitions and OpenDRIVE (Release v1.6 Q1/2020) for road network definitions.
The here provided 15 concrete parametrized test scenarios are derived from the 6 subject areas analogous to Annex 5, Chapter 4.1-4.6 as an initial attempt to clarify the described set of functional scenarios.

The focus of the scenarios is on securing the planning aspects of an "Automated Lane Keeping System". By extending the scenarios with references to e.g. 3D models or environmental conditions (e.g. light, rain), aspects of sensor and actuator technology could also be simulated and validated.
Each concrete scenario is complemented by a variation file to form a logical scenario, which then represents a set of concrete scenarios. By applying the parameter variation defined in the variation files to the parameters in the concrete scenarios, multiple concrete scenarios can be derived or generated to cover the required scenario space.

## Running on Windows
The focus of the here provided scenarios is on securing the planning aspects of an "Automated Lane Keeping System". By extending the scenarios with environmental conditions (e.g. light, rain or wind) or references to e.g. 3D models, aspects of sensor and actuator technology could also be simulated and validated.

The execution in the open source tools "esmini", a basic OpenSCENARIO player, and "openPASS", a simulation platform for traffic simulation, is described on Windows:
## Executing on Windows

The execution of the concrete scenarios in the open source tools "esmini", a basic OpenSCENARIO player, and "openPASS", a simulation platform for traffic simulation, is described on Windows:

_Note:_ Currently only esmini supports the OpenSCENARIO 1.1 format. For openPASS please use the [release v0.3.2](https://github.com/asam-oss/OSC-ALKS-scenarios/releases/tag/v0.3.2) with scenarios in OpenSCENARIO 1.0 format.

_Note:_ The execution with openPASS expects xsltproc on the system path. Check out the "Notes regarding openPASS" for more information.

1. Clone or download this repository to your local drive.
2. a) Download the [latest esmini release](https://github.com/esmini/esmini/releases) (e.g. esmini-bin_win_x64.zip) (tested successfully with [esmini 2.8.2](https://github.com/esmini/esmini/releases/tag/v2.8.2)),
2. a) Download the [latest esmini release](https://github.com/esmini/esmini/releases) (e.g. esmini-bin_win_x64.zip) (tested successfully with [esmini 2.12.0](https://github.com/esmini/esmini/releases/tag/v2.12.0)),
or
b) Download the [latest openPASS release](https://gitlab.eclipse.org/eclipse/simopenpass/simopenpass) (tested successfully with [openPASS v0.7](https://gitlab.eclipse.org/eclipse/simopenpass/simopenpass/-/tree/openPASS_0.7))
3. a) Create an environment variable "ESMINI", which directs to the "bin" folder of esmini. E.g. "C:\MyFolder\esmini\bin\",
or
b) Create an environment variable "OPENPASS", which directs to the installation directory of openPASS. E.g. "C:\MyFolder\openPASS\"
4. Execute the script "run_Scenario.bat", located in the "Scenarios" folder of the local repository
5. By changing the parameter values in the parameter declaration section of the OpenSCENARIO files, the concrete scenarios can be varied.
5. By changing the parameter values in the parameter declaration section of the OpenSCENARIO files within their defined constraints, the concrete scenarios can be varied.

#### Notes regarding esmini:

Expand All @@ -58,26 +60,26 @@ Similar to esmini, openPASS does not provide an ALKS. Therefore, for demonstrati

Currently openPASS does not support the controller concept of OpenSCENARIO. Instead, entities and their controlling components are defined in the ProfilesCatalog.xml. Sourrounding entities are also controlled by the Algorithm Following Driver Model. Therefore, the velocities of the surrounding entities may differ slightly from the definitions in the scenarios.

## Running on Linux
## Executing on Linux

The execution in the open source simulator "CARLA" under Ubuntu 20.04 is described here:

_Note:_ For execution with CARLA please use the [release v0.3.2](https://github.com/asam-oss/OSC-ALKS-scenarios/releases/tag/v0.3.2) with scenarios in OpenSCENARIO 1.0 format.

1. Clone or download this repository to your local drive.
2. Download CARLA and the compatible scenario-runner for CARLA (tested successfully with [CARLA 0.9.11](https://github.com/carla-simulator/carla/releases/tag/0.9.11) and [scenario_runner-0.9.11](https://github.com/carla-simulator/scenario_runner/releases/tag/v0.9.11)
3. Follow the installation instructions for [CARLA](https://carla.readthedocs.io/en/0.9.11/) and the [scenario_runner](https://github.com/carla-simulator/scenario_runner/blob/master/Docs/getting_scenariorunner.md) (be sure to install all the required tools and libs from requirements.txt (mentioned in "Installation summary" and to set the environment variables (mentioned in "B. Download ScenarioRunner from source"))
4. Once you can run the .xosc scenarios delivered with CARLA, run the ALKS scenarios like this:
a) Start the CARLA simulator: Go to the CARLA installation folder and type "./CarlaUE4.sh"
b) Start the scenario runner: Go to the scenario_runner installation folder and type e.g. "python scenario_runner.py --openscenario /path/to/OSC-ALKS-scenarios/Scenarios/ALKS_Scenario_4.1_1_FreeDriving_TEMPLATE.xosc"

_Note:_ For execution with CARLA please use the [release v0.3.2](https://github.com/asam-oss/OSC-ALKS-scenarios/releases/tag/v0.3.2) with scenarios in OpenSCENARIO 1.0 format.

Execution with esmini or openPASS on Linux hasn't been tested yet.

#### Notes regarding CARLA

With CARLA version 0.9.11 the following scenarios are supported: 4.1_1, 4.2_1, 4.2_2, 4.2_4.

_NOTE:_ 4.2_X scenarios do only work if the pedestrian is modeled directly in the scenario and not in a catalog or is exchanged by a vehicle. Please refer to the bug fix in [this PR](https://github.com/carla-simulator/scenario_runner/pull/713)
_Note:_ 4.2_X scenarios do only work if the pedestrian is modeled directly in the scenario and not in a catalog or is exchanged by a vehicle. Please refer to the bug fix in [this PR](https://github.com/carla-simulator/scenario_runner/pull/713)

## Quality Measures

Expand All @@ -87,7 +89,7 @@ The validation of the scenarios and maps provided in this repository is integrat
1. Syntactic validation of the scenarios and maps against the XSD schemas of the OpenSCENARIO 1.1 and OpenDRIVE 1.6 standards with xmllint
2. Syntactic and semantic validation of the scenarios with the *Standalone Checker* of the [OpenSCENARIO API](https://github.com/RA-Consulting-GmbH/openscenario.api.test). Integration into the CI is prepared by a [GitHub action](https://github.com/ahege/openscenario.ci.test) and an [example](https://github.com/ahege/opensceanrio.ci.example.test/)

_NOTE:_ The *Standalone Checker* does not yet support OpenSCENARIO 1.1. Those checks are only applied including [release v0.3.2](https://github.com/asam-oss/OSC-ALKS-scenarios/releases/tag/v0.3.2)
_Note:_ The *Standalone Checker* does not yet support OpenSCENARIO 1.1. Those checks are only applied including [release v0.3.2](https://github.com/asam-oss/OSC-ALKS-scenarios/releases/tag/v0.3.2)

## Legal

Expand Down
16 changes: 11 additions & 5 deletions Scenarios/ALKS_Scenario_4.1_1_FreeDriving_TEMPLATE.xosc
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<OpenSCENARIO>
<FileHeader revMajor="1" revMinor="1" date="2021-06-18T10:00:00" description="ALKS Scenario 4.1_1 FreeDriving Template" author="BMW AG" />
<FileHeader revMajor="1" revMinor="1" date="2021-07-09T10: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="Duration" parameterType="double" value="300" />
<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>
</ParameterDeclarations>
<CatalogLocations>
<VehicleCatalog>
Expand Down Expand Up @@ -47,7 +52,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 Expand Up @@ -97,7 +102,8 @@
<ConditionGroup>
<Condition name="End" delay="0" conditionEdge="rising">
<ByValueCondition>
<SimulationTimeCondition value="$Duration" rule="greaterOrEqual" />
<!--A duration of at least 5 minutes is required for this scenario. The whole road is a bit more than 5000 m long and should be covered. With the maximum speed of 60 kph this would take exactly 5 minutes. With lower speeds it takes longer.-->
<SimulationTimeCondition value="${5000.0 / ($Ego_InitSpeed_Ve0_kph / 3.6)}" rule="greaterOrEqual"></SimulationTimeCondition>
</ByValueCondition>
</Condition>
</ConditionGroup>
Expand Down
Loading