Giter VIP home page Giter VIP logo

esmini's Introduction

Environment Simulator Minimalistic (esmini)

esmini is a basic OpenSCENARIO player

License: MPL 2.0 Build Status

Screenshot

It contains the following main libraries:

  • RoadManager (esminiRMLib). A library providing an interface to road networks described in the OpenDRIVE format.
  • ScenarioEngine (esminiLib). The main library providing a viewer and API interface to traffic scenarios described in the OpenSCENARIO format. This library includes RoadManager.

and a few applications that can be used as is or provide ideas for customized solutions:

  • esmini. A scenario player application linking esmini modules statically.
  • esmini-dyn. A minimalistic example using the esminiLib to play OpenSCENARIO files.
  • odrplot. Produces a data file from OpenDRIVE for plotting the road network in Python.
  • odrviewer. Visualize OpenDRIVE road network with populated dummy traffic.
  • replayer. Re-play previously executed scenarios.
  • osireceiver. A simple application receiving OSI messages from esmini over UDP.

Repository: https://github.com/esmini/esmini

Pre-built demo packages are available here. Unzip, navigate to "esmini\run\esmini" and run any of the example scripts. See more info below under "Binaries and demos".

Please note: From version 1.5 esmini only supports OpenSCENARIO v1.0. All demo scenarios has been updated from 0.9.1 to 1.0. ASAM provides a transformation scheme (migration0_9_1to1_0.xslt, part of the OpenSCENARIO 1.0 release bundle) that can be used with tools for automatic migration of XML files.

The code was initially a result from the Swedish collaborative research project Simulation Scenarios, and is now further developed based on users need and OpenSCENARIO development.

For more information about the esmini software parts, please see Inner Workings of esmini.

Background

The purpose of this implementation was to explore and get familiar with the emerging OpenSCENARIO data format. The development aimed at supporting various platforms such as Windows, Mac, Linux, and Android. Tool integration and portability were high priorities, the project outcomes should be capable of incorporation in native C++ applications as well as other frameworks like Unity3D (C#) and MATLAB/Simulink, among many others.

Although allowed by the license this implementation is not primarily intended for production use. The code was developed ad hoc to answer research questions connected with the ongoing project. Therefore, code quality, as expected from standard production applications, is lacking when it comes to clarity, structure, comments, error handling and coding guidelines.

OpenSCENARIO coverage is limited as it was developed on demand and defined by the research scope. Moreover, since the Simulation Scenarios project is closed, no formal support should be expected from the initial contributors.
Nevertheless, regarding the above stated limitations, it was decided to release the code as is, as a public outcome from the project. It can hopefully serve as guidance or just inspiration for those aspiring to build similar tools, or even get accustomed with the OpenSCENARIO format. And of course, all contributions to further development are welcome!

Binaries and demos

Windows, Linux and Mac supported

Latest release including source, binaries and demo packages is found here: https://github.com/esmini/esmini/releases/latest

3D models used by the example scenarios are included in the demo packages. They are also available here. Unpack into esmini/resources. These assets works on all platforms. Environment models (roads, landscape, buildings...) have been created using VIRES Road Network Editor.

Mac specifics tips

On Mac the zip-package might be put in quarantine, to release it: xattr -d com.apple.quarantine file.zip or even better: xattr -c file.zip

If you get the "damaged file" message, please open a terminal in the folder where the esmini-demo was extracted, and run the following command: xattr -c -r esmini-demo

Build

If you want to build yourself, please find some instructions here.

Run esmini

Either get the demo or build yourself. To run demos:

  1. Navigate to run/esmini
  2. Run any of the provided batch-script examples (double click on or run from command line)

Further info:

esmini shared library

The easiest way of integrating esmini in your custom application is to link the all inclusive shared library ScenarioEngineDLL. In spite of the name it's available also on Linux and Mac. See this "Hello World" tutorial on how to create a minimalistic application based on it.

Unity support

esmini shared library works fine also in Unity (Win, Linux, Mac). A simple example can be downloaded from here. The package contains everything needed to get going:

  • esmini library C# wrapper
  • a generic scenario player script
  • a few example scenarios (OpenSCENARIO + OpenDRIVE) including 3D models
  • plugins for all platforms (can be updated of course)
  • and finally a scene connecting the player script to a game object

Run:

  1. Import package (Import Package -> Custom Package).
  2. Load the scene (Assets/Scenes/esmini-scene).
  3. Then just press play-button.

Select (click on) esmini-player in Hierarchy to show up in Inspector, where you can specify scenario file and a few parameters. Note that scenario file and dependent OpenDRIVE and optional 3D scenegraph file must be present in StreamingAssets folder.

Plugins can be updated, but NOTE that you need to restart Unity to (re)load shared library plugins. And, of course, scenario files and other content can be added or replaced.

esmini & Python

see last section in Hello-World_coding-example.

esmini controllers

esmini comes with a few controllers (ways of controlling individual entities in the scenario):

  • DefaultController. Performs actions exactly as specified in the OpenSCENARIO file. Assigned to entities by default.
  • InteractiveController. Hand over control to the user via keyboard arrow keys.
  • FollowGhost. A ghost-twin is performing the events a few seconds ahead. The entity will then follow its trajectory.
  • ExternalController. State (position, rotation ...) expected to be reported from external simulator via API. Ghost trajectory can be created for an external driver model as reference.
  • SumoController. A way of integrating SUMO controlled vehicles in a scenario.

More information here.

Related work

pyoscx

pyoscx is a Python based scenario creation framework. The idea is to write scenarios in a high-level script format and automatically generate the OpenSCENARIO 1.0 XML counterpart.

pyodrx

pyodrx is a Python based road network creation framework. The idea is to write road networks in a high-level script format and automatically generate the OpenDRIVE (1.4 as of today) XML counterpart.

pyoscx/scenariogeneration

pyoscx/scenariogeneration is a simple Python wrapper to combine pyoscx and pyodrx, providing an interface to parametrize and generate linked OpenSCENARIO and OpenDRIVE files to run multiple simulations, including parameter sweeps.

ALKS scenarios

OSC-ALKS-scenarios is a collection of scenarios for Automated Lane Keeping System testing. "BMW has taken on the task of implementing the test scenarios from the ALKS regulation using OpenSCENARIO and OpenDRIVE resulting in a bundle of XML files executable with standard compliant simulators."

Scenario video clip generator

esmini-visualizer is a tool to automatically generate video visualizations of scenarios.

Note that it does not seem to work with Anti-Alias filtering. Therefore make sure to run esmini without Anti-Alias by providing argument --aa_mode 0.

Scenario editor

RControlStation scenario editor. An embryo to an OpenSCENARIO editor, part of Self-Driving Model Vehicle Platform (SDVP).

The implementation is very limited at this point, but some things can be edited and the scenario can be executed and observed from above, as well as exported to the other tools. You have to start by importing one of the existing scenarios into the editor, as it cannot make a scenario from scratch.

Instruction:

  • Get RControlStation source code
git clone https://github.com/vedderb/rise_sdvp
  • Build esmini:
cd rise_sdvp/Linux/RControlStation
git clone https://github.com/esmini/esmini
cd esmini
mkdir build
cd build
cmake ../ -DUSE_OSG=true -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release --target install
cd ../../
  • Edit RControlStation.pro and uncomment the line: #DEFINES += HAS_SIM_SCEN
  • Build and run RControlCenter:
./build_lin
export LD_LIBRARY_PATH=esmini/bin
./build/lin/RControlStation

The editor is the last tab in RControlStation.

Carla Simulator

Carla is an Unreal based open source simulator worth to check out.

Data formats

OpenDRIVE describes the road network, the static part of a scenario.

OpenSCENARIO describes the dynamic content on top of a road network, e.g. traffic maneuvers and weather conditions.

esmini's People

Contributors

aolsso65 avatar balp avatar bertrandrichard avatar brifsttar avatar brunovti avatar cfschaller avatar cjunhua avatar cpettit-lcm avatar davidhesselbomvcc avatar davkap72 avatar dbestelle avatar e9387011 avatar ebadi avatar egunnarsson avatar eidland avatar eknabe avatar eknabevcc avatar erikgunnarssonhiq avatar erikhenrikssonhiq avatar esmini avatar fabianoboril avatar inatale93 avatar jiahui22 avatar johanneswen avatar mander76 avatar mguldogu avatar rjohan69 avatar vedderb avatar zijianhan-volvocars avatar

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.