GithubHelp home page GithubHelp logo

gaofei / open-simulation-interface Goto Github PK

View Code? Open in Web Editor NEW

This project forked from opensimulationinterface/open-simulation-interface

0.0 1.0 0.0 39.27 MB

A generic interface for the environmental perception of automated driving functions in virtual scenarios.

License: Other

CMake 11.62% Python 87.44% Shell 0.94%

open-simulation-interface's Introduction

Open Simulation Interface (OSI)

Travis Build Status

The Open Simulation Interface [1] (OSI) is a generic interface based on Google's protocol buffers for the environmental perception of automated driving functions in virtual scenarios.

As the complexity of automated driving functions rapidly increases, the requirements for test and development methods are growing. Testing in virtual environments offers the advantage of completely controlled and reproducible environment conditions.

In this context, OSI defines generic interfaces to ensure modularity, integrability, and interchangeability of the individual components:

For more information on OSI see the official documentation or the official reference documentation for defined protobuf messages.

[1] A generic interface for the environment perception of automated driving functions in virtual scenarios.(Dated 03.02.2017) T. Hanke, N. Hirsenkorn, C. van-Driesten, P. Garcia-Ramos, M. Schiementz, S. Schneider, E. Biebl

Usage

Example of writing and reading an OSI message in Python
from osi3.osi_sensorview_pb2 import SensorView
from osi3.osi_sensordata_pb2 import SensorData

def main():
    """Initialize SensorView and SensorData"""
    sensorview = SensorView()
    sensordata = SensorData()

    """Clear SensorData"""
    sensordata.Clear()

    """Get boundary line attributes from SensorView"""
    sv_ground_truth = sensorview.global_ground_truth
    sv_lane_boundary = sv_ground_truth.lane_boundary.add()
    sv_boundary_line = sv_lane_boundary.boundary_line.add()
    sv_boundary_line.position.x = 1699.20
    sv_boundary_line.position.y = 100.16
    sv_boundary_line.position.z = 0.0
    sv_boundary_line.width = 0.13
    sv_boundary_line.height = 0.0

    """Set boundary line attributes to SensorData"""
    sd_lane_boundary = sensordata.lane_boundary.add()
    sd_boundary_line = sd_lane_boundary.boundary_line.add()
    sd_boundary_line.position.x = sv_boundary_line.position.x
    sd_boundary_line.position.y = sv_boundary_line.position.y
    sd_boundary_line.position.z = sv_boundary_line.position.z
    sd_boundary_line.width = sv_boundary_line.width
    sd_boundary_line.height = sv_boundary_line.height

    """Serialize SensorData which can be send"""
    string_buffer = sensordata.SerializeToString()

    """Clear SensorData to show parsing from string"""
    sensordata.Clear()

    """The received string buffer can now be parsed"""
    sensordata.ParseFromString(string_buffer)

    """Print SensorData"""
    print(sensordata)

if __name__ == "__main__":
    main()

Output:

lane_boundary {
  boundary_line {
    position {
      x: 1699.2
      y: 100.16
      z: 0.0
    }
    width: 0.13
    height: 0.0
  }
}

See Google's documentation for more tutorials on how to use protocol buffers with Python or C++.

Installation

Dependencies

Install cmake 3.10.2:

$ sudo apt-get install cmake

Install pip3 and missing python packages:

$ sudo apt-get install python3-pip python3-setuptools

Install protobuf 3.0.0:

$ sudo apt-get install libprotobuf-dev protobuf-compiler
Build and install for C++ usage:
$ git clone https://github.com/OpenSimulationInterface/open-simulation-interface.git
$ cd open-simulation-interface
$ mkdir build
$ cd build
$ cmake ..
$ make
$ sudo make install
Install for Python usage:

Local:

$ git clone https://github.com/OpenSimulationInterface/open-simulation-interface.git
$ cd open-simulation-interface
$ sudo pip3 install virtualenv
$ virtualenv -p python3 venv
$ source venv/bin/activate
$ python3 -m pip install .

Global:

$ git clone https://github.com/OpenSimulationInterface/open-simulation-interface.git
$ cd open-simulation-interface
$ sudo pip3 install .

For Windows installation see here for more information.

open-simulation-interface's People

Contributors

jdsika avatar carsten-kuebler avatar pmai avatar mbinna avatar soyka-zz avatar ahmedmzid avatar vkresch avatar philipproethigbmw avatar cmuck avatar mgalos avatar timohankebmw avatar fabelealtran avatar martin-fzd avatar cezaryszyszkaaltran avatar hanneskaeufler avatar kolodkin avatar marcin-piatek avatar nkm8 avatar nikolavasiljevski avatar phrosenberger avatar schreinerkarl avatar tbreitenbergerconti avatar ndunningbmw avatar

Watchers

James Cloos 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.