Git Product home page Git Product logo

osc-alks-scenarios's Introduction

ALKS Scenario Interpretation in OpenSCENARIO

Description

Introduction

As presented in the UNECE Press Release, the "UN Regulation No. 157 - Automated Lane Keeping Systems (ALKS)" ECE/TRANS/WP.29/2020/81 [1] describes the necessary requirements to be fulfilled for the approval of an ALKS, which is a level 3 automated driving system on motorways.

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

"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."

Goal

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.

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. members are developing the so called "OpenX" standards for the simulation domain like OpenSCENARIO (Release v1.1 3/2021) for scenario definitions and OpenDRIVE (Release v1.7 8/2021) for road network definitions. The implementation is using OpenSCENARIO and OpenDRIVE, resulting in a bundle of XML files executable with standard compliant simulators.

Content

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.

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.

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.

Installation & Execution

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 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 (e.g. esmini-bin_win_x64.zip) (tested successfully with esmini 2.15.3),
    or
    b) Download the latest openPASS release (tested successfully with openPASS v0.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 and follow the instructions

Notes regarding esmini:

Esmini is an environment simulator with a visualization. It even provides a simple internal ALKS controller, which is activated through the scenario to demonstrate how the scenarios should run.

Notes regarding openPASS:

openPASS currently supports the execution of the scenarios 4.1_1, 4.2_1, 4.2_2, 4.2_4, 4.5_1, 4.5_2 and 4.6_1. The remaining scenarios will be enabled in upcoming releases of openPASS.

The simulation in openPASS is configured through a set of configuration files. These files consist of the scenario, its catalogs and the map. Additionally some configuration files located in "OSC-ALKS-scenarios\Scenarios\openPASS_Resources" are required. Prior to simulation some slight modifications have to be done in the scenarios. This step is automated in the "run_Scenario.bat" by applying an xslt to the scenario.

Dependency: xsltproc is used to apply the xslt script to the scenario. Guide for installation:

  1. Download and install msys2
  2. Extent the path environment variable by the bin directory of msys2 (e.g. "C:\msys64\usr\bin")

OpenPASS does not provide an ALKS. Therefore, for demonstration purposes the vehicle under test is controlled by a so called "Algorithm Following Driver Model - AFDM", which is provided by openPASS. This model is parametrized to drive approximately at its target velocity of 60 km/h and keeps the lane. Other traffic participants are taken into account. For information on the integration of an ALKS in the simulation, we refer to the documentation of openPASS.

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.

Linux

esmini

  1. Please follow the steps 1. and 2. a) from the above instructions for Windows (clone/download repo and install esmini)
  2. Once esmini is installed (e.g. to ~/esmini), go to the "Scenarios" folder and execute e.g.:
~/esmini/bin/esmini --osc ALKS_Scenario_4.1_1_FreeDriving_TEMPLATE.xosc

openPASS

The execution with openPASS works on Linux with the same scenarios as for Windows. However, steps from the execution script "run_Scenario.bat" have to be performed manually.

CARLA

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

  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 and scenario_runner-0.9.11
  3. Follow the installation instructions for CARLA and the scenario_runner (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 with scenarios in OpenSCENARIO 1.0 format.

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

Usage

Scenario variation

You can either manually vary the scenarios by changing the parameter values in the parameter declaration section of the OpenSCENARIO files within their defined constraints. Or you can use the provided variation files to automatically create multiple concrete parameter sets / concrete scenarios prior to execution. For this an additional parameter set / scenario generation tool is necessary.

ALKS activation

If the scenarios should be used for testing an actual simluation-external ALKS, a manufacturer-specific activation signal needs to be sent to the ALKS at the same time the "ActivateControllerAction" is executed. Architecturally this could be achieved in different ways:

  1. Implement in the environment simulation to activate an external ALKS instead of a simulation internal one (requires a manufacturer-specific simulation).
  2. Add a "CustomCommandAction" to the scenarios which is executed together with the "ActivateControllerAction". The command is used to start a script containing the manufacturer-specific activation signal (requires only a scenario-specific simulation to understand the command).
  3. Embed the scenarios in test cases and trigger the activation of the ALKS from the test case/software. Then the "ActivateControllerAction" will only cause the environment simulation to not control the ego vehicle anymore. The action then needs to be triggered not with a "SimulationTimeCondition" but by the test software. This can be achieved by setting a user defined value in the environment simulation with the test software and triggering the "ActivateControllerAction" with a "UserDefinedValueCondition". This requires neither a manufacturer-specific or a scenario-specific implementation of the environment simulation.

Quality Measures

As a first proof-of-concept the scenarios have been integrated and simulated in openPASS 0.7 at BMW. In addition the open source tool esmini can be used as described above.

The validation of the scenarios and maps provided in this repository is integrated into the CI workflow. There are two validation mechanisms implemented with GitHub actions:

  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. Integration into the CI is prepared by a GitHub action and an example

Note: The Standalone Checker does not yet support OpenSCENARIO 1.1. Those checks are only applied including release v0.3.2

Legal

The corresponding OpenSCENARIO Bundle has been licensed by MPL-2.0 and is hereby made publicly available.

The XSD schema of OpenSCENARIO is used under the license of ASAM, which can be found here.

The XSD schemas of OpenDRIVE are used under the license of ASAM, which can be found here

The Standalone Checker of the OpenSCENARIO API and the corresponding GitHub action are used under the Apache 2.0 license.

BMW is not liable for the correctness and completeness of the OpenSCENARIO files. The legal text is authoritative.

osc-alks-scenarios's People

Contributors

arauschert avatar arundas1 avatar eknabevcc avatar jakobkaths avatar jdsika avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

osc-alks-scenarios's Issues

esmini 2.0

Tomorrow (Friday) afternoon is planned release of esmini 2.0. Most significant news is support of OSC controller concept. A positive side effect is that we could reduce the palette of "applications". As you also pointed out, the interactive, external and hybrid modes are now implemented as controllers instead of specific application features.
Now, this led us to take the opportunity and do some desired restructuring and renaming of esmini modules. So far so good. Downside is broken backward compatibility.

There are two changes affecting your project:

  1. "EgoSimulator" renamed to "esmini"
  2. Trails is off by default. Instead a single argument "--trails" will turn them on. So the script option "--trails off" will actually turn them on and the "off" part will be parsed as an unknown argument and put a warning on stdout. However, esmini will run nonetheless, with trails.

First issue I've solved short term by providing a copy of esmini(.exe) named EgoSimulator(.exe). Let's say that we provide this copy during a deprecation period of a few releases.
Second issue is not a showstopper. Actually I find the trails useful since it gives a sense of speed and motion forward along the OpenDRIVE features lines. So, even though not critical, my suggestion is to eventually change into "--trails".

I've checked all 15 ALKS scenarios of yours. As far as I can see, they run all fine in esmini 2.0 BETA.

This is a heads-up in order to dampen the surprise of esmini 2.0 release tomorrow afternoon. Link to a beta version in case you would like to test before release.

Let me know if you see any issues that I did not think of!

Steering amount in axle definition should be in radians

This looks like a value in degrees, while the standard specifies it should be in radians.
<FrontAxle maxSteering="30" wheelDiameter="0.8" trackWidth="1.68" positionX="2.98" positionZ="0.4" />

maxSteering | double | 1..1 | XSDattribute | Maximum steering angle which can be performed by the wheels on this axle. Unit: rad; Range: [0;PI]

XML validation failed

Hi I tried to execute the supported osc files in Carla 0.9.11 (same version for scenario runner), however the xmlschema validator is throwing back errors. I tried the 4.1.1 (free driving scenario), and get an error at this first instance (I think there could be more incompatibility later on the osc file as well)

xmlschema.validators.exceptions.XMLSchemaValidationError: failed validating <Element 'ParameterDeclaration' at 0x7f54c24c36b0> with XsdElement(name='ParameterDeclaration', occurs=[0, None]):

Reason: character data is not allowed because the type's content is empty

Schema:

  <xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" maxOccurs="unbounded" minOccurs="0" name="ParameterDeclaration" type="ParameterDeclaration" />

Instance:

  <ParameterDeclaration name="Ego_InitSpeed_Ve0_kph" parameterType="double" value="60.0">
    <ConstraintGroup>
      
      <ValueConstraint rule="greaterThan" value="0.0" />
      <ValueConstraint rule="lessOrEqual" value="60.0" />
    </ConstraintGroup>
  </ParameterDeclaration>

Driver model behaviour from ECE regulation

Hi,

is it on your list to implement also the driver model from ECE regulation (including the jerk times, the lateral movement possibilities until perception, perception time, risk evaluation time, ... and also the AEB as baseline with its jerk time, delay and 0.85G deceleration, ...) as baseline for the comparison of the results?

Kind regards,

Thaddäus

UN No.157: Update to 130km/h

There has been an update on the regulation regarding the upgrade from the previous limit of 60km/h to 130km/h. I guess we need a bigger task force to upgrade to these requirements I guess? see here

AttributeError: Only OpenSCENARIO 1.0 is supported

Hi, I tried with my own custom .xosc file. My xosc file is created in openscenario 1.1 standard. I run the file in OSC-ALKS 0.4 release the attribute error is shown. please let me know how to solve this issue.

Usage of environment variables / Missing options to manually set filepath in "run_Scenarios.bat"

While I see the benefit in using environment variables in "run_Sceanrios.bat", defining or changing them requires administrative rights on Windows machines.

The usability of the script could be improved by adding options that allow the user to set the directory path manually,
e.g. do a
SET ESMINI=My\Path\to\esmini\binary\directory
or a
SET OPENPASS=My\Path\to\openpass\binary\directory

A script for linux based systems (as reqested in #27 ), should provide the same functionality ... ;)

Naming of ALKS controller elements is not consistent

The conditions within the ActivateALKSControllerStory do not have a consistent naming. They are named ActivateALKSControllerStart and ActivateALKSControllerStartCondition instead of ActivateALKSControllerActCondition and ActivateALKSControllerEventCondition

Test scenarios with CARLA 0.9.13

CARLA 0.9.13 is released with improved OpenSCENARIO 1 support. We need to test how many scenarios we can now run with it (and check, if OSC 1.1 is supported)

Add a solution for running on Linux

Most developers working on Automated Driving stacks are using Linux as their desktop operating system because 'everything just works'. Would it be possible to also add instructions and support for running on Linux x86_64?

trigger conditions correct?

Hi,

if I understand you correctly, then you are focusing on xosc v1.1 instead of v1.0.
If so, then you should use for many triggers lessOrEqual instead of lessThan (e.g. distances) and greaterOrEqual instead of greaterThan (e.g. start time). What do you mean?

Kind regards,

Thaddäus

Lane ID parameters need to be of type integer

in the parameter declaraions for some scenarios lane IDs are defined. In their usage they need to be strings, but this doesn't work for constraints (e.g. 3 < LaneId < 5). Therefore the parameters should be defined as integer, so they can be used for checking constraints and within expressions. They would need to be implicitly converted to a string when they are used as string attribute for a laneID

mixture of entity refs for cut-in scenarios, false unit for deceleration?

Hi,

  1. in Cut-In scenarios the entity ref of Cut-In story is well defined as CutInVehicle. But the entity ref inside this story of the triggering entities is ego. Would it be not also correct and more consistent to switch the entity refs of triggering entities and relativeDistanceCondition?

  2. In followLeadVehicle scenario the variable is called LeadVehicle_BrakeRate_Gx_max, which seems to lead to unit G, but it is directly the input of rate, thus I think the unit is mpss?

Kind regards,

Thaddäus

Use of 'sinusoidal' dynamicsShape and 'rate' dynamicsDimension

Hello, we noticed that a few ALKS scenarios define a LaneChangeAction with, among other things, the following LaneChangeActionDynamics: dynamicsShape="sinusoidal", dynamicsDimension="rate". According to the OpenSCENARIO standard, the "rate" value is only used for the dynamicsShape="linear". Now I would like to ask why this combination is used e.g. in the ALKS_Scenario_4.4_1_CutInNoCollision_TEMPLATE.xosc? Thank you in advance!

ALKS Controller activation too late

For the activation of the ALKS controller the condition is SimulationTime=10000 sec. This raised some questions, since the scenario doesn't last that long.
The idea is that this value has to be changed to e.g. 1 sec., if an external controller is connected to the environment simulation.
Maybe there are more intuitive ways to model this without having to use further OpenSCENARIO 1 features. (e.g. an additional parameter "external_ego_control" with type="boolean" and default value="false" and an additional ParameterValueCondition with parameter="external_ego_control" rule="equalsTo" value="true" would also work, but not used yet in the scenarios).

First action for swerving lead vehicle doesn´t end

The LaneOffsetAction of the lead vehicle in scenario 4.1_2 has continuous=true as attribute. This means, it doesn´t end after the offset has been reached. Therefore the following LaneOffsetActions would not start since their start conditions are that the previous action has ended.
The attribute continuous needs to be "false" for all LaneOffsetActions.

Create functions

Hi , base on your structure you have made I am trying to replicate for another functions , still not able to understand how to implement the functions (reaction) , for now created simple scenario (Open scenario , esmini ..) , how did you ? I did not know where to raise my question as it is not issue

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.