Skip to content
This repository was archived by the owner on Jul 16, 2025. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e8dd496

Browse files
fmirusfred-labs
authored andcommittedNov 20, 2024
update from OpenSCENARIO 2.0 to OpenSCENARIO DSL V2.1.0 (#221)
1 parent cf5582d commit e8dd496

File tree

27 files changed

+116
-1123
lines changed

27 files changed

+116
-1123
lines changed
 

‎README.md

Lines changed: 1 addition & 1 deletion
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

Lines changed: 7 additions & 7 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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 renamed to ‎docs/openscenarioDSL.rst

Lines changed: 6 additions & 7 deletions
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

Lines changed: 8 additions & 8 deletions
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:
Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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,
Lines changed: 1 addition & 1 deletion
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

‎scenario_execution/scenario_execution/lib_osc/standard.osc

Lines changed: 23 additions & 990 deletions
Large diffs are not rendered by default.

‎scenario_execution/scenario_execution/lib_osc/standard_base.osc renamed to ‎scenario_execution/scenario_execution/lib_osc/types.osc

Lines changed: 39 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,35 @@
11
###########
2-
# Standard: OpenSCENARIO 2.0 domain model
3-
# Copyright: ASAM 2021-2022
4-
# Version:
5-
# Standard Publication Date:
6-
# Publication Reference Document:
7-
# Reference Document Date:
2+
# ASAM OpenSCENARIO(R) DSL V2.1.0
3+
#
4+
# (C) 2024 ASAM e.V.
5+
#
6+
# Domain model library
7+
# This file is informative. The normative definitions are published in the specification.
8+
#
9+
# Any use is limited to the scope described in the ASAM license terms.
10+
# See http://www.asam.net/license.html for further details.
11+
# In alteration to the regular license terms, ASAM allows unrestricted distribution of this standard.
12+
# paragraph 2 (1) of ASAM's regular license terms is therefore substituted by the following clause:
13+
# "The licensor grants everyone a basic, non-exclusive and unlimited license to use the standard ASAM OpenSCENARIO DSL".
814
###########
915

16+
###########
17+
# ATTENTION: This file is modified to be compatible with
18+
# the feature set of scenario execution.
19+
# - default values added
20+
# - additional types added
21+
# - namespace disabled
22+
###########
23+
24+
# TODO: enable once namespaces are supported
25+
# namespace stdtypes
26+
#
27+
# export *
28+
1029
########################
1130
# Scalar types and units
1231
########################
1332

14-
# tag::library-physical-length[]
1533
type length is SI(m: 1)
1634
unit nanometer of length is SI(m: 1, factor: 0.000000001)
1735
unit nm of length is SI(m: 1, factor: 0.000000001)
@@ -28,9 +46,7 @@ unit inch of length is SI(m: 1, factor: 0.0254)
2846
unit feet of length is SI(m: 1, factor: 0.3048)
2947
unit mile of length is SI(m: 1, factor: 1609.344)
3048
unit mi of length is SI(m: 1, factor: 1609.344)
31-
# end::library-physical-length[]
3249

33-
# tag::library-physical-time[]
3450
type time is SI(s: 1)
3551
unit millisecond of time is SI(s: 1, factor: 0.001)
3652
unit ms of time is SI(s: 1, factor: 0.001)
@@ -41,9 +57,7 @@ unit minute of time is SI(s: 1, factor: 60)
4157
unit min of time is SI(s: 1, factor: 60)
4258
unit hour of time is SI(s: 1, factor: 3600)
4359
unit h of time is SI(s: 1, factor: 3600)
44-
# end::library-physical-time[]
4560

46-
# tag::library-physical-speed[]
4761
type speed is SI(m: 1, s: -1)
4862
unit meter_per_second of speed is SI(m: 1, s: -1, factor: 1)
4963
unit mps of speed is SI(m: 1, s: -1, factor: 1)
@@ -55,9 +69,7 @@ unit mph of speed is SI(m: 1, s: -1, factor: 0.447038889)
5569
unit miph of speed is SI(m: 1, s: -1, factor: 0.447038889)
5670
unit mmph of speed is SI(m: 1, s: -1, factor: 0.000000278)
5771
unit millimeter_per_hour of speed is SI(m: 1, s: -1, factor: 0.000000278)
58-
# end::library-physical-speed[]
5972

60-
# tag::library-physical-acceleration[]
6173
type acceleration is SI(m: 1, s: -2)
6274
unit meter_per_sec_sqr of acceleration is SI(m: 1, s: -2, factor: 1)
6375
unit mpsps of acceleration is SI(m: 1, s: -2, factor: 1)
@@ -66,183 +78,132 @@ unit kilometer_per_hour_per_sec of acceleration is SI(m: 1, s: -2, factor: 0.277
6678
unit kmphps of acceleration is SI(m: 1, s: -2, factor: 0.277777778)
6779
unit mile_per_hour_per_sec of acceleration is SI(m: 1, s: -2, factor: 0.447038889)
6880
unit miphps of acceleration is SI(m: 1, s: -2, factor: 0.447038889)
69-
# end::library-physical-acceleration[]
7081

71-
# tag::library-physical-jerk[]
7282
type jerk is SI(m: 1, s: -3)
7383
unit meter_per_sec_cubed of jerk is SI(m: 1, s: -3, factor: 1)
7484
unit mpspsps of jerk is SI(m: 1, s: -3, factor: 1)
7585
unit mile_per_sec_cubed of jerk is SI(m: 1, s: -3, factor: 1609.344)
7686
unit mipspsps of jerk is SI(m: 1, s: -3, factor: 1609.344)
77-
# end::library-physical-jerk[]
7887

79-
# tag::library-physical-angle[]
8088
type angle is SI(rad: 1)
81-
unit degree of angle is SI(rad: 1, factor: 57.295779513)
82-
unit deg of angle is SI(rad: 1, factor: 57.295779513)
89+
unit degree of angle is SI(rad: 1, factor: 0.01745329252)
90+
unit deg of angle is SI(rad: 1, factor: 0.01745329252)
8391
unit radian of angle is SI(rad: 1, factor: 1)
8492
unit rad of angle is SI(rad: 1, factor: 1)
85-
# end::library-physical-angle[]
8693

87-
# tag::library-physical-angular_rate[]
8894
type angular_rate is SI(rad: 1, s: -1)
89-
unit degree_per_sec of angular_rate is SI(rad: 1, s: -1, factor: 57.295779513)
90-
unit degps of angular_rate is SI(rad: 1, s: -1, factor: 57.295779513)
95+
unit degree_per_sec of angular_rate is SI(rad: 1, s: -1, factor: 0.01745329252)
96+
unit degps of angular_rate is SI(rad: 1, s: -1, factor: 0.01745329252)
9197
unit radian_per_sec of angular_rate is SI(rad: 1, s: -1, factor: 1)
9298
unit radps of angular_rate is SI(rad: 1, s: -1, factor: 1)
93-
# end::library-physical-angular_rate[]
9499

95-
# tag::library-physical-angular_acceleration[]
96100
type angular_acceleration is SI(rad: 1, s: -2)
97-
unit degree_per_sec_sqr of angular_acceleration is SI(rad: 1, s: -2, factor: 57.295779513)
98-
unit degpsps of angular_acceleration is SI(rad: 1, s: -2, factor: 57.295779513)
101+
unit degree_per_sec_sqr of angular_acceleration is SI(rad: 1, s: -2, factor: 0.01745329252)
102+
unit degpsps of angular_acceleration is SI(rad: 1, s: -2, factor: 0.01745329252)
99103
unit radian_per_sec_sqr of angular_acceleration is SI(rad: 1, s: -2, factor: 1)
100104
unit radpsps of angular_acceleration is SI(rad: 1, s: -2, factor: 1)
101-
# end::library-physical-angular_acceleration[]
102105

103-
# tag::library-physical-mass[]
104106
type mass is SI(kg: 1)
105107
unit gram of mass is SI(kg: 1, factor: 0.001)
106108
unit kilogram of mass is SI(kg: 1, factor: 1)
107109
unit kg of mass is SI(kg: 1, factor: 1)
108110
unit ton of mass is SI(kg: 1, factor: 1000)
109111
unit pound of mass is SI(kg: 1, factor: 0.45359237)
110112
unit lb of mass is SI(kg: 1, factor: 0.45359237)
111-
# end::library-physical-mass[]
112113

113-
# tag::library-physical-temperature[]
114114
type temperature is SI(K: 1)
115115
unit K of temperature is SI(K: 1, factor: 1)
116116
unit kelvin of temperature is SI(K: 1, factor: 1)
117117
unit celsius of temperature is SI(K: 1, factor: 1, offset: 273.15)
118118
unit C of temperature is SI(K: 1, factor: 1, offset: 273.15)
119119
unit fahrenheit of temperature is SI(K: 1, factor: 0.555555556, offset: 255.372222222)
120120
unit F of temperature is SI(K: 1, factor: 0.555555556, offset: 255.372222222)
121-
# end::library-physical-temperature[]
122121

123-
# tag::library-physical-pressure[]
124122
type pressure is SI(kg: 1, m: -1, s: -2)
125123
unit newton_per_meter_sqr of pressure is SI(kg: 1, m: -1, s: -2, factor: 1)
126124
unit Pa of pressure is SI(kg: 1, m: -1, s: -2, factor: 1)
127125
unit pascal of pressure is SI(kg: 1, m: -1, s: -2, factor: 1)
128126
unit hPa of pressure is SI(kg: 1, m: -1, s: -2, factor: 100)
129127
unit atm of pressure is SI(kg: 1, m: -1, s: -2, factor: 101325)
130-
# end::library-physical-pressure[]
131128

132-
# tag::library-physical-luminous_intensity[]
133129
type luminous_intensity is SI(cd: 1)
134130
unit cd of luminous_intensity is SI(cd: 1, factor: 1)
135131
unit candela of luminous_intensity is SI(cd: 1, factor: 1)
136-
# end::library-physical-luminous_intensity[]
137132

138-
# tag::library-physical-luminous_flux[]
139133
type luminous_flux is SI(cd: 1, rad: 2)
140134
unit lm of luminous_flux is SI(cd: 1, rad: 2, factor: 1)
141135
unit lumen of luminous_flux is SI(cd: 1, rad: 2, factor: 1)
142-
# end::library-physical-luminous_flux[]
143136

144-
# tag::library-physical-illuminance[]
145137
type illuminance is SI(cd: 1, rad: 2, m: -2)
146138
unit lx of illuminance is SI(cd: 1, rad: 2, m: -2, factor: 1)
147139
unit lux of illuminance is SI(cd: 1, rad: 2, m: -2, factor: 1)
148-
# end::library-physical-illuminance[]
149140

150-
# tag::library-physical-electrical_current[]
151141
type electrical_current is SI(A: 1)
152142
unit ampere of electrical_current is SI(A: 1, factor: 1)
153143
unit A of electrical_current is SI(A: 1, factor: 1)
154-
# end::library-physical-electrical_current[]
155144

156-
# tag::library-physical-amount_of_substance[]
157145
type amount_of_substance is SI(mol: 1)
158146
unit mole of amount_of_substance is SI(mol: 1, factor: 1)
159147
unit mol of amount_of_substance is SI(mol: 1, factor: 1)
160-
# end::library-physical-amount_of_substance[]
161148

162149
###########
163150
# Structs
164151
###########
165152

166-
# tag::library-position_3d[]
167-
struct position_3d:
153+
struct position
154+
155+
struct position_3d inherits position:
168156
x: length = 0.0m
169157
y: length = 0.0m
170158
z: length = 0.0m
171-
#def norm() -> length is undefined
172-
# end::library-position_3d[]
159+
# def norm() -> length is undefined
173160

174-
# tag::library-celestial_position_2d[]
175-
struct celestial_position_2d:
161+
struct celestial_position_2d inherits position:
176162
azimuth: angle = 0.0rad
177163
elevation: angle = 0.0rad
178-
# end::library-celestial_position_2d[]
179164

180-
# tag::library-geodetic_position_2d[]
181-
struct geodetic_position_2d:
165+
struct geodetic_position_2d inherits position:
182166
latitude: angle = 0.0rad
183167
longitude: angle = 0.0rad
184-
# end::library-geodetic_position_2d[]
185168

186-
# tag::library-orientation_3d[]
187169
struct orientation_3d:
188170
roll: angle = 0.0rad
189171
pitch: angle = 0.0rad
190172
yaw: angle = 0.0rad
191-
# end::library-orientation_3d[]
192173

193-
# tag::library-pose_3d[]
194174
struct pose_3d:
195175
position: position_3d
196176
orientation: orientation_3d
197-
# end::library-pose_3d[]
198177

199-
# tag::library-translational_velocity_3d[]
200178
struct translational_velocity_3d:
201179
x: speed = 0.0mps
202180
y: speed = 0.0mps
203181
z: speed = 0.0mps
204-
# def norm() -> speed is undefined
205-
# end::library-translational_velocity_3d[]
182+
# def norm() -> speed is undefined
206183

207-
# tag::library-orientation_rate_3d[]
208184
struct orientation_rate_3d:
209185
roll: angular_rate = 0.0radps
210186
pitch: angular_rate = 0.0radps
211187
yaw: angular_rate = 0.0radps
212-
# end::library-orientation_rate_3d[]
213188

214-
# tag::library-velocity_6d[]
215189
struct velocity_6d:
216190
translational: translational_velocity_3d
217191
angular: orientation_rate_3d
218-
# end::library-velocity_6d[]
219192

220-
# tag::library-translational_acceleration_3d[]
221193
struct translational_acceleration_3d:
222194
x: acceleration = 0.0mpsps
223195
y: acceleration = 0.0mpsps
224196
z: acceleration = 0.0mpsps
225-
# def norm() -> acceleration is undefined
226-
# end::library-translational_acceleration_3d[]
197+
# def norm() -> acceleration is undefined
227198

228-
# tag::library-orientation_acceleration_3d[]
229199
struct orientation_acceleration_3d:
230200
roll: angular_acceleration = 0.0radpsps
231201
pitch: angular_acceleration = 0.0radpsps
232202
yaw: angular_acceleration = 0.0radpsps
233-
# end::library-orientation_acceleration_3d[]
234203

235-
# tag::library-acceleration_6d[]
236204
struct acceleration_6d:
237205
translational: translational_acceleration_3d
238206
angular: orientation_acceleration_3d
239-
# end::library-acceleration_6d[]
240-
241-
struct bounding_box:
242-
center: position_3d # Mandatory: Represents the geometrical center of the bounding box expressed in coordinates that refer to the coordinate system of the physical_object
243-
length: length # Mandatory: Dimension in x-direction of the coordinate system of the physical_object
244-
width: length # Mandatory: Dimension in y-direction of the coordinate system of the physical_object
245-
height: length # Mandatory: Dimension in z-direction of the coordinate system of the physical_object
246207

247208
# ###########
248209
# # Actor

‎scenario_execution/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
'scenario_execution.osc_libraries': [
7979
'helpers = scenario_execution.get_osc_library:get_helpers_library',
8080
'standard = scenario_execution.get_osc_library:get_standard_library',
81-
'standard.base = scenario_execution.get_osc_library:get_standard_base_library',
81+
'types = scenario_execution.get_osc_library:get_types_library',
8282
'robotics = scenario_execution.get_osc_library:get_robotics_library',
8383
]
8484
},

‎scenario_execution/test/test_osc2_parser_not_supported.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def test_cast(self):
116116

117117
def test_sample(self):
118118
scenario_content = """
119-
import osc.standard.base
119+
import osc.types
120120
121121
scenario simple_drive:
122122
environment: environment

‎scenario_execution/test/test_osc2_standard_osc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ def test_standard_osc(self):
4343

4444
def test_standard_common_osc(self):
4545
scenario_content = """
46-
import osc.standard.base
46+
import osc.types
4747
"""
4848
model = self.parse(scenario_content)

‎scenario_execution/test/test_run_process.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def execute(self, scenario_content):
4545

4646
def test_failure(self):
4747
scenario_content = """
48-
import osc.standard.base
48+
import osc.types
4949
import osc.helpers
5050
5151
scenario test_run_process:
@@ -59,7 +59,7 @@ def test_failure(self):
5959

6060
def test_success(self):
6161
scenario_content = """
62-
import osc.standard.base
62+
import osc.types
6363
import osc.helpers
6464
6565
scenario test_run_process:
@@ -73,7 +73,7 @@ def test_success(self):
7373

7474
def test_multi_element_command(self):
7575
scenario_content = """
76-
import osc.standard.base
76+
import osc.types
7777
import osc.helpers
7878
7979
scenario test_run_process:
@@ -86,7 +86,7 @@ def test_multi_element_command(self):
8686

8787
def test_wait_for_shutdown_false(self):
8888
scenario_content = """
89-
import osc.standard.base
89+
import osc.types
9090
import osc.helpers
9191
9292
scenario test_run_process:
@@ -108,7 +108,7 @@ def test_wait_for_shutdown_false(self):
108108

109109
def test_signal_parsing(self):
110110
scenario_content = """
111-
import osc.standard.base
111+
import osc.types
112112
import osc.helpers
113113
114114
scenario test_run_process:

0 commit comments

Comments
 (0)
This repository has been archived.