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

Update jazzy #223

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Super-Linter](https://github.com/IntelLabs/Scenario_Execution/actions/workflows/scan.yml/badge.svg)](https://github.com/marketplace/actions/super-linter)
[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/IntelLabs/scenario_execution/badge)](https://scorecard.dev/viewer/?uri=github.com/IntelLabs/scenario_execution)

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/).
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/).
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.
This separation of the scenario definition from implementation massively reduces the manual efforts of scenario creation.

Expand Down
14 changes: 7 additions & 7 deletions docs/architecture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ Architecture

Overview of Scenario Execution

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>`_.
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.
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>`_.
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.


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

Our implementation is highly modular separating the core components from simulation- and/or middleware-specific modules realized through a plugin-based approach.
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.
A library typically provides an OpenSCENARIO 2 file with additional definitions and may provide code implementing additional functionality such as conditions or actions.
A library typically provides an OpenSCENARIO DSL file with additional definitions and may provide code implementing additional functionality such as conditions or actions.

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

Expand Down Expand Up @@ -63,11 +63,11 @@ The Internal Model Builder, implemented as a Model Listener does an initial chec
Modules
-------

- ``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.
- ``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.
- ``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.
- ``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.
- ``scenario_execution_control``: Provides code to control scenario execution (in ROS2) from another application such as RViz.
- ``scenario_execution_coverage``: Provides tools to generate concrete scenarios from abstract OpenSCENARIO 2 scenario definition and execute them.
- ``scenario_execution_gazebo``: Provides a `Gazebo <https://gazebosim.org/>`_-specific OpenSCENARIO 2 library with actions.
- ``scenario_execution_coverage``: Provides tools to generate concrete scenarios from abstract OpenSCENARIO DSL scenario definition and execute them.
- ``scenario_execution_gazebo``: Provides a `Gazebo <https://gazebosim.org/>`_-specific OpenSCENARIO DSL library with actions.
- ``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.
- ``scenario_execution_rviz``: Contains several `rviz <https://github.com/ros2/rviz>`__ plugins for visualizing and controlling scenarios when working with ROS2.
- ``simulation/gazebo_tf_publisher``: Publish ground truth transforms from simulation within TF.
Expand Down
6 changes: 5 additions & 1 deletion docs/dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,8 @@ png
svg
Kubernetes
yaml
absolutized
absolutized
moveit
replan
effector
mnt
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Scenario Execution
==================

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.
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/>`__.
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/>`__.

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.
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. 
Expand Down Expand Up @@ -37,5 +37,5 @@ If you use Scenario Execution for Robotics in your scientific work, please cite
architecture
libraries
development
openscenario2
openscenarioDSL
how_to_cite
163 changes: 161 additions & 2 deletions docs/libraries.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Libraries
=========

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

.. list-table::
:widths: 40 60
Expand All @@ -10,6 +10,8 @@ Beside ``osc.standard`` provided by OpenSCENARIO 2 (which we divide into ``osc.s

* - Name
- Description
* - ``osc.docker``
- Docker Library (provided with :repo_link:`libs/scenario_execution_docker`)
* - ``osc.gazebo``
- Gazebo Library (provided with :repo_link:`libs/scenario_execution_gazebo`)
* - ``osc.helpers``
Expand All @@ -32,6 +34,163 @@ Beside ``osc.standard`` provided by OpenSCENARIO 2 (which we divide into ``osc.s
Additional features can be implemented by defining your own library.


Docker
------

The library contains actions to interact with `Docker <https://www.docker.com/>`_. Import it with ``import osc.docker``. It's provided by the package :repo_link:`libs/scenario_execution_docker`.

``docker_run()``
^^^^^^^^^^^^^^^^

Runs a Docker container

.. list-table::
:widths: 15 15 5 65
:header-rows: 1
:class: tight-table

* - Parameter
- Type
- Default
- Description
* - ``image``
- ``string``
-
- The image to run
* - ``command``
- ``string``
-
- The command to run in the container
* - ``container_name``
- ``string``
-
- The name for this container
* - ``detach``
- ``bool``
- false
- Whether to run container in the background
* - ``environment``
- ``list of string``
-
- Environment variables to set inside the container, i.e., a list of strings in the format ["SOMEVARIABLE=xxx"].
* - ``network``
- ``string``
-
- Name of the network this container will be connected to at creation time
* - ``privileged``
- ``bool``
- false
- Give extended privileges to this container
* - ``remove``
- ``bool``
- true
- Remove the container when it as finished running
* - ``stream``
- ``bool``
- true
- If true and detach is false, return a log generator instead of a string. Ignored if detach is true.
* - ``volumes``
- ``list of string``
-
- A list of strings which each one of its elements specifies a mount volume: ['/home/user1/:/mount/vol2','/home/user2/:/mount/vol1']

``docker_exec()``
^^^^^^^^^^^^^^^^^

Runs a command inside a given Docker container

.. list-table::
:widths: 15 15 5 65
:header-rows: 1
:class: tight-table

* - Parameter
- Type
- Default
- Description
* - ``container``
- ``string``
-
- The name or id of the container to run the command in
* - ``container``
- ``string``
-
- The name or id of the container to run the command in
* - ``command``
- ``string``
-
- The command to run inside the container
* - ``environment``
- ``list of string``
-
- Environment variables to set inside the container, i.e., a list of strings in the format ["SOMEVARIABLE=xxx"].
* - ``privileged``
- ``bool``
- false
- Give extended privileges to this container
* - ``user``
- ``string``
- root
- User to execute command as
* - ``workdir``
- ``string``
-
- Path to working directory for this exec session

``docker_copy()``
^^^^^^^^^^^^^^^^^

Copy a file or folder from the container.
Note that this actions potentially blocks other action calls if the copied content is large.
In case large files or folders need to be copied, consider mounting a volume to the container instead of this action.

.. list-table::
:widths: 15 15 5 65
:header-rows: 1
:class: tight-table

* - Parameter
- Type
- Default
- Description
* - ``container``
- ``string``
-
- The name or id of the container to run the command in
* - ``file_path``
- ``string``
-
- Path to the file or folder inside the container to retrieve

``docker_put()``
^^^^^^^^^^^^^^^^^

Copy a file or folder from the local system into a running container.
Note that this actions potentially blocks other action calls if the copied content is large.
In case large files or folders need to be copied, consider mounting a volume to the container instead of this action.

.. list-table::
:widths: 15 15 5 65
:header-rows: 1
:class: tight-table

* - Parameter
- Type
- Default
- Description
* - ``container``
- ``string``
-
- The name or id of the container to put the file or folder into
* - ``source_path``
- ``string``
-
- Path to the file or folder in the local system to copy
* - ``target_path``
- ``string``
-
- Target path inside the container to put the file or folder

Gazebo
------

Expand Down Expand Up @@ -1604,4 +1763,4 @@ Capture the screen content within a video.
* - ``frame_rate``
- ``float``
- ``25.0``
- Frame-rate of the resulting video
- Frame-rate of the resulting video
13 changes: 6 additions & 7 deletions docs/openscenario2.rst → docs/openscenarioDSL.rst
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
OpenSCENARIO 2
==============
OpenSCENARIO DSL
================

General
-------

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

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

The `standard library of
OSC2 <https://www.asam.net/static_downloads/public/asam-openscenario/2.0.0/domain-model/standard_library.html>`__
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>`__
was adapted to be usable by the current parsing support of scenario execution.


Expand Down Expand Up @@ -46,7 +45,7 @@ Mapping to py-trees
Supported features
------------------

In the following the OpenSCENARIO 2 keywords are listed with their current support status.
In the following the OpenSCENARIO DSL keywords are listed with their current support status.


======================= ==================== =============================
Expand Down
40 changes: 29 additions & 11 deletions docs/setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,60 @@
Setup
=====

Installation from source as ROS 2 workspace
-------------------------------------------
Installation with ROS 2
-----------------------

Prerequisites
^^^^^^^^^^^^^

Install ROS2 humble following the `installation instructions <https://docs.ros.org/en/humble/Installation.html>`_.
Install ROS2 following the `installation instructions <https://docs.ros.org/en/jazzy/Installation.html>`_ for your distribution `$ROS_DISTRO`.

Installation
^^^^^^^^^^^^^
Scenario execution currently supports the ROS 2 distributions `Humble <https://docs.ros.org/en/humble/index.html>`_ and `Jazzy <https://docs.ros.org/en/jazzy/index.html>`_.

Clone the scenario execution repository
Installation as Debian package (recommended)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

To install scenario execution together with all its libraries, run

.. code-block:: bash

git clone https://github.com/IntelLabs/scenario_execution.git
sudo apt update && sudo apt install -y ros-$ROS_DISTRO-scenario_execution*

To install just the core packages of scenario execution, run

.. code-block:: bash

sudo apt update && sudo apt install -y ros-$ROS_DISTRO-scenario_execution ros-$ROS_DISTRO-scenario_execution_ros ros-$ROS_DISTRO-scenario_execution_rviz

and update its submodules by running the following command in the root folder of the cloned repository

Developer Installation (from source as ROS 2 workspace)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Clone the scenario execution repository

.. code-block:: bash

git submodule update --init
git clone https://github.com/IntelLabs/scenario_execution.git

install the necessary dependencies
and install the necessary dependencies

.. code-block:: bash

rosdep install --from-paths . --ignore-src
pip3 install -r requirements.txt

and build it
Now, build your workspace by running

.. code-block:: bash

colcon build

and source your installation by running

.. code-block:: bash

source /opt/ros/$ROS_DISTRO/setup.bash && source install/setup.bash

.. _install_with_pip:

Installation with pip as standalone Python package
Expand Down
Loading