Skip to content

Commit a837fc4

Browse files
fmirusfred-labs
authored andcommitted
update from OpenSCENARIO 2.0 to OpenSCENARIO DSL V2.1.0 (IntelLabs#221)
1 parent 19049da commit a837fc4

File tree

27 files changed

+116
-1123
lines changed

27 files changed

+116
-1123
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![Super-Linter](https://github.com/IntelLabs/Scenario_Execution/actions/workflows/scan.yml/badge.svg)](https://github.com/marketplace/actions/super-linter)
44
[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/IntelLabs/scenario_execution/badge)](https://scorecard.dev/viewer/?uri=github.com/IntelLabs/scenario_execution)
55

6-
Scenario execution is a backend- and middleware-agnostic library written in Python based on the generic scenario description language [OpenSCENARIO 2](https://www.asam.net/static_downloads/public/asam-openscenario/2.0.0/welcome.html) and [pytrees](https://py-trees.readthedocs.io/en/devel/).
6+
Scenario execution is a backend- and middleware-agnostic library written in Python based on the generic scenario description language [OpenSCENARIO DSL](https://www.asam.net/standards/detail/openscenario-dsl/) and [pytrees](https://py-trees.readthedocs.io/en/devel/).
77
It reads a scenario definition from a file and then executes it, reusing available checks and actions. It is easily extendable through a library mechanism.
88
This separation of the scenario definition from implementation massively reduces the manual efforts of scenario creation.
99

docs/architecture.rst

+7-7
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Architecture
77

88
Overview of Scenario Execution
99

10-
Scenario execution is built as a Python library on top of two open-source components: the generic scenario description language `OpenSCENARIO 2 <https://www.asam.net/index.php?eID=dumpFile&t=f&f=3460&token=14e7c7fab9c9b75118bb4939c725738fa0521fe9>`_ and `PyTrees <https://py-trees.readthedocs.io/en/devel/introduction.html>`_.
11-
In general, the user defines a scenario in the OpenSCENARIO 2 language, scenario execution parses the scenario, translates it to a behavior tree, executes it and finally gathers the test results.
10+
Scenario execution is built as a Python library on top of two open-source components: the generic scenario description language `OpenSCENARIO DSL <https://www.asam.net/index.php?eID=dumpFile&t=f&f=3460&token=14e7c7fab9c9b75118bb4939c725738fa0521fe9>`_ and `PyTrees <https://py-trees.readthedocs.io/en/devel/introduction.html>`_.
11+
In general, the user defines a scenario in the OpenSCENARIO DSL language, scenario execution parses the scenario, translates it to a behavior tree, executes it and finally gathers the test results.
1212

1313

1414
.. figure:: images/scenario_execution_arch.png
@@ -18,7 +18,7 @@ In general, the user defines a scenario in the OpenSCENARIO 2 language, scenario
1818

1919
Our implementation is highly modular separating the core components from simulation- and/or middleware-specific modules realized through a plugin-based approach.
2020
In principle, any additional feature that is required by a specific scenario and that can be implemented in Python could be realized as additional library.
21-
A library typically provides an OpenSCENARIO 2 file with additional definitions and may provide code implementing additional functionality such as conditions or actions.
21+
A library typically provides an OpenSCENARIO DSL file with additional definitions and may provide code implementing additional functionality such as conditions or actions.
2222

2323
Currently, the following sub-packages and libraries are available:
2424

@@ -63,11 +63,11 @@ The Internal Model Builder, implemented as a Model Listener does an initial chec
6363
Modules
6464
-------
6565

66-
- ``scenario_execution``: The base package for scenario execution. It provides the parsing of OpenSCENARIO 2 files and the conversion to py-trees. It's middleware agnostic and can therefore be used as a basis for more specific implementations (e.g. ROS). It also provides basic OpenSCENARIO 2 libraries and actions.
67-
- ``scenario_execution_ros``: This package uses ``scenario_execution`` as a basis and implements a ROS2 version of scenario execution. It provides a OpenSCENARIO 2 library with basic ROS2-related actions like publishing on a topic or calling a service.
66+
- ``scenario_execution``: The base package for scenario execution. It provides the parsing of OpenSCENARIO DSL files and the conversion to py-trees. It's middleware agnostic and can therefore be used as a basis for more specific implementations (e.g. ROS). It also provides basic OpenSCENARIO DSL libraries and actions.
67+
- ``scenario_execution_ros``: This package uses ``scenario_execution`` as a basis and implements a ROS2 version of scenario execution. It provides a OpenSCENARIO DSL library with basic ROS2-related actions like publishing on a topic or calling a service.
6868
- ``scenario_execution_control``: Provides code to control scenario execution (in ROS2) from another application such as RViz.
69-
- ``scenario_execution_coverage``: Provides tools to generate concrete scenarios from abstract OpenSCENARIO 2 scenario definition and execute them.
70-
- ``scenario_execution_gazebo``: Provides a `Gazebo <https://gazebosim.org/>`_-specific OpenSCENARIO 2 library with actions.
69+
- ``scenario_execution_coverage``: Provides tools to generate concrete scenarios from abstract OpenSCENARIO DSL scenario definition and execute them.
70+
- ``scenario_execution_gazebo``: Provides a `Gazebo <https://gazebosim.org/>`_-specific OpenSCENARIO DSL library with actions.
7171
- ``scenario_execution_interfaces``: Provides ROS2 `interfaces <https://docs.ros.org/en/rolling/Concepts/Basic/About-Interfaces.html>`__, more specifically, messages and services, which are used to interface ROS2 with the ``scenario_execution_control`` package.
7272
- ``scenario_execution_rviz``: Contains several `rviz <https://github.com/ros2/rviz>`__ plugins for visualizing and controlling scenarios when working with ROS2.
7373
- ``simulation/gazebo_tf_publisher``: Publish ground truth transforms from simulation within TF.

docs/index.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Scenario Execution
33
==================
44

55
Scenario Execution for Robotics is a backend- and middleware-agnostic library, that enables the robotics community to perform reproducible experiments at scale and allows a seamless transition from simulation to real-world experiments.
6-
Scenario Execution is written in Python and builds upon the generic scenario description language `OpenScenario2 <https://www.asam.net/static_downloads/public/asam-openscenario/2.0.0/welcome.html>`__ and `pytrees <https://py-trees.readthedocs.io/en/devel/>`__.
6+
Scenario Execution is written in Python and builds upon the generic scenario description language `OpenSCENARIO DSL <https://www.asam.net/standards/detail/openscenario-dsl/>`__ and `pytrees <https://py-trees.readthedocs.io/en/devel/>`__.
77

88
Scenario Execution reads a scenario definition from a file, translates it to a py-trees behavior tree and then executes it. This separation of the scenario definition from the implementation massively reduces the manual efforts of (robotics) scenario creation.
99
Although Scenario Execution can be used as a pure Python library, it is mainly targeted to be used with the `Robot Operating System (ROS2) <https://www.ros.org/>`__. The backend-agnostic implementation allows Scenario Execution to be used with both, robotics simulators such as `Gazebo <https://gazebosim.org/>`__ and physical robots, with minimal adaptations necessary in the scenario description file. 
@@ -37,5 +37,5 @@ If you use Scenario Execution for Robotics in your scientific work, please cite
3737
architecture
3838
libraries
3939
development
40-
openscenario2
40+
openscenarioDSL
4141
how_to_cite

docs/libraries.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Libraries
22
=========
33

4-
Beside ``osc.standard`` provided by OpenSCENARIO 2 (which we divide into ``osc.standard`` and ``osc.standard_base``), multiple libraries are provided with scenario execution.
4+
Beside ``osc.standard`` and ``osc.types`` provided by OpenSCENARIO DSL, multiple libraries are provided with scenario execution.
55

66
.. list-table::
77
:widths: 40 60

docs/openscenario2.rst docs/openscenarioDSL.rst

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
OpenSCENARIO 2
2-
==============
1+
OpenSCENARIO DSL
2+
================
33

44
General
55
-------
66

7-
This tool supports a subset of the `OpenSCENARIO
8-
2 <https://www.asam.net/project-detail/asam-openscenario-v20-1/>`__ standard.
7+
This tool supports a subset of the `OpenSCENARIO DSL <https://www.asam.net/standards/detail/openscenario-dsl/>`__ standard.
98

109
The official documentation is available
11-
`here <https://www.asam.net/static_downloads/public/asam-openscenario/2.0.0/welcome.html>`__.
10+
`here <https://publications.pages.asam.net/standards/ASAM_OpenSCENARIO/ASAM_OpenSCENARIO_DSL/latest/index.html>`__.
1211

1312
The `standard library of
14-
OSC2 <https://www.asam.net/static_downloads/public/asam-openscenario/2.0.0/domain-model/standard_library.html>`__
13+
OSC2 <https://publications.pages.asam.net/standards/ASAM_OpenSCENARIO/ASAM_OpenSCENARIO_DSL/latest/domain-model/_attachments/ASAM_OpenSCENARIO_DSL_v2.1.0_Domain_model_library.zip>`__
1514
was adapted to be usable by the current parsing support of scenario execution.
1615

1716

@@ -46,7 +45,7 @@ Mapping to py-trees
4645
Supported features
4746
------------------
4847

49-
In the following the OpenSCENARIO 2 keywords are listed with their current support status.
48+
In the following the OpenSCENARIO DSL keywords are listed with their current support status.
5049

5150

5251
======================= ==================== =============================

docs/tutorials.rst

+8-8
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ Code for all tutorials is available in :repo_link:`examples`.
88
Define and Execute Scenario
99
---------------------------
1010

11-
To create a scenario in OpenSCENARIO 2 syntax, first create a file
11+
To create a scenario in OpenSCENARIO DSL syntax, first create a file
1212
with the extension ``.osc``. Input the following code in the file.
1313

1414
.. code-block::
1515
1616
# import the libraries with import expression
17-
import osc.standard.base
17+
import osc.types
1818
import osc.helpers
1919
2020
# declare the scenario by the syntax: "scenario scenario_name:"
@@ -25,17 +25,17 @@ with the extension ``.osc``. Input the following code in the file.
2525
wait elapsed(3s) # wait three seconds
2626
log("Good Bye!") # log another message
2727
28-
The first two lines ``import osc.standard.base`` and ``import osc.helpers`` will import the named libraries that provide required definitions. In this example ``helpers`` library provides the ``log`` action and ``standard.base`` provides the definition of the `s` unit to specify seconds.
28+
The first two lines ``import osc.types`` and ``import osc.helpers`` will import the named libraries that provide required definitions. In this example ``helpers`` library provides the ``log`` action and ``types`` provides the definition of the `s` unit to specify seconds.
2929

3030
.. note::
31-
Comments in OpenSCENARIO 2 always start with ``#``.
31+
Comments in OpenSCENARIO DSL always start with ``#``.
3232

3333
Then, a scenario with the name ``hello_world`` get declared. The following colon states that all following and indented lines
3434
are part of it. The single top-level action of the scenario is defined in the ``do`` directive.
3535
The term ``serial`` states that the included actions will be executed in sequence.
3636

3737
.. note::
38-
OpenSCENARIO 2 supports the following compositions:
38+
OpenSCENARIO DSL supports the following compositions:
3939

4040
* ``parallel``: execute actions in parallel, continue afterwards
4141
* ``serial``: execute actions, one after the other
@@ -70,11 +70,11 @@ Create Scenario Library
7070
-----------------------
7171

7272
To add new features to scenario execution, extensions libraries can be created. An extension library typically provides one or more
73-
OpenSCENARIO 2 definition files and might additionally provide action implementations.
73+
OpenSCENARIO DSL definition files and might additionally provide action implementations.
7474

7575
To show how to create such a library for scenario execution, we will add a ``custom_action`` action as an example.
7676

77-
First, we need to define the ``custom_action`` in a OpenSCENARIO 2 file.
77+
First, we need to define the ``custom_action`` in a OpenSCENARIO DSL file.
7878

7979
.. code-block::
8080
@@ -417,7 +417,7 @@ It is possible to call external python methods and use their return value within
417417

418418
.. code-block::
419419
420-
import osc.standard.base
420+
import osc.types
421421
import osc.helpers
422422
423423
struct lib:
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import osc.standard.base
1+
import osc.types
22
import osc.helpers
33

44
struct lib:
@@ -7,4 +7,4 @@ struct lib:
77
scenario example_external_method:
88

99
do serial:
10-
log(lib.factorial(4))
10+
log(lib.factorial(4))

examples/example_scenario/hello_world.osc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import osc.standard.base
1+
import osc.types
22
import osc.helpers
33

44
scenario hello_world:

libs/scenario_execution_floorplan_dsl/scenario_execution_floorplan_dsl/lib_osc/floorplan_dsl.osc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import osc.standard.base
1+
import osc.types
22

33
actor floorplan_generator:
44
result: string

libs/scenario_execution_gazebo/scenario_execution_gazebo/lib_osc/gazebo.osc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import osc.standard.base
1+
import osc.types
22
import osc.robotics
33

44
action actor_exists:

libs/scenario_execution_kubernetes/scenario_execution_kubernetes/lib_osc/kubernetes.osc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import osc.standard.base
1+
import osc.types
22

33
enum kubernetes_element_type: [
44
pod,

libs/scenario_execution_kubernetes/scenarios/test_kubernetes_create_delete.osc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import osc.standard.base
1+
import osc.types
22
import osc.kubernetes
33
import osc.helpers
44

libs/scenario_execution_kubernetes/scenarios/test_kubernetes_pod_exec.osc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import osc.standard.base
1+
import osc.types
22
import osc.kubernetes
33
import osc.helpers
44

libs/scenario_execution_moveit2/scenario_execution_moveit2/lib_osc/moveit2.osc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import osc.standard.base
1+
import osc.types
22
import osc.robotics
33

44
enum move_group_type: [
@@ -46,4 +46,4 @@ action arm.move_to_pose:
4646
max_velocity_scaling_factor: float = 0.1 # Scaling factors for optionally reducing the maximum joint velocities
4747
namespace_override: string = '' # if set, it's used as namespace (instead of the associated actor's name)
4848
action_topic: string = 'move_action' # Name of action
49-
success_on_acceptance: bool = false # succeed on goal acceptance
49+
success_on_acceptance: bool = false # succeed on goal acceptance

libs/scenario_execution_nav2/scenario_execution_nav2/lib_osc/nav2.osc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import osc.standard.base
1+
import osc.types
22
import osc.robotics
33

44
action differential_drive_robot.init_nav2:
@@ -21,4 +21,4 @@ action differential_drive_robot.nav_to_pose:
2121
goal_pose: pose_3d # goal pose to navigate to
2222
namespace_override: string = '' # if set, it's used as namespace (instead of the associated actor's name)
2323
action_topic: string = 'navigate_to_pose' # Name of action
24-
success_on_acceptance: bool = false # succeed on goal acceptance
24+
success_on_acceptance: bool = false # succeed on goal acceptance

libs/scenario_execution_pybullet/scenario_execution_pybullet/lib_osc/pybullet.osc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import osc.standard.base
1+
import osc.types
22
import osc.robotics
33

44
actor simulation_pybullet
@@ -20,4 +20,4 @@ action actor_pybullet.set_joint_motor_control:
2020

2121
action actor_pybullet.distance_traveled:
2222
# Wait until a defined distance was traveled, based on simulation ground truth
23-
distance: length # traveled distance at which the action succeeds.
23+
distance: length # traveled distance at which the action succeeds.

libs/scenario_execution_x11/scenario_execution_x11/lib_osc/x11.osc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import osc.standard.base
1+
import osc.types
22

33
action capture_screen:
44
# Capture the screen content within a video

scenario_execution/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ The `scenario_execution` package is the core package of Scenario Execution for R
44

55
Furthermore, it provides the following scenario execution libraries:
66

7-
- `standard.osc`: The OpenSCENARIO 2 standard library. It is slightly modified to be in sync with the feature set of scenario execution and imports `standard_base.osc`.
8-
- `standard_base.osc`: The base parts of the OpenSCENARIO 2 standard library such as units and basic structs. For convenience, numerical struct members are initialized with 0.
7+
- `standard.osc`: The OpenSCENARIO DSL standard library. It is slightly modified to be in sync with the feature set of scenario execution and imports `standard_base.osc`.
8+
- `standard_base.osc`: The base parts of the OpenSCENARIO DSL standard library such as units and basic structs. For convenience, numerical struct members are initialized with 0.
99
- `robotics.osc`: robotic-specific specifications.
1010
- `helper.osc`: helper actions such as logging or running external processes.
1111

scenario_execution/scenario_execution/get_osc_library.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ def get_standard_library():
2626
return 'scenario_execution', 'standard.osc'
2727

2828

29-
def get_standard_base_library():
30-
return 'scenario_execution', 'standard_base.osc'
29+
def get_types_library():
30+
return 'scenario_execution', 'types.osc'

scenario_execution/scenario_execution/lib_osc/helpers.osc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import osc.standard.base
1+
import osc.types
22

33
enum signal: [
44
sighup = 1,
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import osc.standard.base
1+
import osc.types
22

33
actor robot inherits osc_actor

0 commit comments

Comments
 (0)