Skip to content

Latest commit

History

1,106 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Open Simulation Interface (OSI)

ProtoBuf CI Builds

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.

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

[1] Hanke, T., Hirsenkorn, N., van-Driesten, C., Garcia-Ramos, P., Schiementz, M., Schneider, S. & Biebl, E. (2017, February 03). A generic interface for the environment perception of automated driving functions in virtual scenarios. Retrieved January 25, 2020, from https://www.hot.ei.tum.de/forschung/automotive-veroeffentlichungen/

Usage

Example of generating OSI messages in Python
# generate_osi_messages.pyfromosi3.osi_sensorview_pb2importSensorViewimportstructNANO_INCREMENT=10000000MOVING_OBJECT_LENGTH=5MOVING_OBJECT_WIDTH=2MOVING_OBJECT_HEIGHT=1defmain():
"""Initialize SensorView"""f=open("sv_330_361_1000_movingobject.osi", "ab")
sensorview=SensorView()
sv_ground_truth=sensorview.global_ground_truthsv_ground_truth.version.version_major=3sv_ground_truth.version.version_minor=5sv_ground_truth.version.version_patch=0sv_ground_truth.timestamp.seconds=0sv_ground_truth.timestamp.nanos=0moving_object=sv_ground_truth.moving_object.add()
moving_object.id.value=42# Generate 1000 OSI messages for a duration of 10 secondsforiinrange(1000):
# Increment the timeifsv_ground_truth.timestamp.nanos>1000000000:
sv_ground_truth.timestamp.seconds+=1sv_ground_truth.timestamp.nanos=0sv_ground_truth.timestamp.nanos+=NANO_INCREMENTmoving_object.vehicle_classification.type=2moving_object.base.dimension.length=MOVING_OBJECT_LENGTHmoving_object.base.dimension.width=MOVING_OBJECT_WIDTHmoving_object.base.dimension.height=MOVING_OBJECT_HEIGHTmoving_object.base.position.x+=0.5moving_object.base.position.y=0.0moving_object.base.position.z=0.0moving_object.base.orientation.roll=0.0moving_object.base.orientation.pitch=0.0moving_object.base.orientation.yaw=0.0"""Serialize"""bytes_buffer=sensorview.SerializeToString()
f.write(struct.pack("<L", len(bytes_buffer)))
f.write(bytes_buffer)
f.close()
if__name__=="__main__":
main()

To run the script execute the following command in the terminal:

python3 generate_osi_messages.py

This will output an osi file (sv_330_361_1000_movingobject.osi) which can be visualized and played back by the osi-visualizer.

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:

$ 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.

About

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

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages