diff --git a/README.md b/README.md index 3cf3b7b48..26464592e 100644 --- a/README.md +++ b/README.md @@ -7,82 +7,18 @@ The Open Simulation Interface [[1]](https://www.hot.ei.tum.de/forschung/aut 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](https://opensimulationinterface.github.io/osi-documentation/) or the [official reference documentation](https://opensimulationinterface.github.io/open-simulation-interface/) for defined protobuf messages. - - +For more information on OSI see the [official documentation](https://opensimulationinterface.github.io/osi-antora-generator/asamosi/latest/specification/index.html) or the [class list](https://opensimulationinterface.github.io/osi-antora-generator/asamosi/latest/gen/annotated.html) 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` -```python -# generate_osi_messages.py -from osi3.osi_sensorview_pb2 import SensorView -import struct - -NANO_INCREMENT = 10000000 -MOVING_OBJECT_LENGTH = 5 -MOVING_OBJECT_WIDTH = 2 -MOVING_OBJECT_HEIGHT = 1 - -def main(): - """Initialize SensorView""" - f = open("sv_330_361_1000_movingobject.osi", "ab") - sensorview = SensorView() - - sv_ground_truth = sensorview.global_ground_truth - sv_ground_truth.version.version_major = 3 - sv_ground_truth.version.version_minor = 5 - sv_ground_truth.version.version_patch = 0 - - sv_ground_truth.timestamp.seconds = 0 - sv_ground_truth.timestamp.nanos = 0 - - moving_object = sv_ground_truth.moving_object.add() - moving_object.id.value = 42 - - # Generate 1000 OSI messages for a duration of 10 seconds - for i in range(1000): - - # Increment the time - if sv_ground_truth.timestamp.nanos > 1000000000: - sv_ground_truth.timestamp.seconds += 1 - sv_ground_truth.timestamp.nanos = 0 - sv_ground_truth.timestamp.nanos += NANO_INCREMENT - - moving_object.vehicle_classification.type = 2 - - moving_object.base.dimension.length = MOVING_OBJECT_LENGTH - moving_object.base.dimension.width = MOVING_OBJECT_WIDTH - moving_object.base.dimension.height = MOVING_OBJECT_HEIGHT - - moving_object.base.position.x += 0.5 - moving_object.base.position.y = 0.0 - moving_object.base.position.z = 0.0 - - moving_object.base.orientation.roll = 0.0 - moving_object.base.orientation.pitch = 0.0 - moving_object.base.orientation.yaw = 0.0 - - """Serialize""" - bytes_buffer = sensorview.SerializeToString() - f.write(struct.pack(" 1000000000: + sv_ground_truth.timestamp.seconds += 1 + sv_ground_truth.timestamp.nanos = 0 + sv_ground_truth.timestamp.nanos += NANO_INCREMENT + + moving_object.vehicle_classification.type = 2 + + moving_object.base.dimension.length = MOVING_OBJECT_LENGTH + moving_object.base.dimension.width = MOVING_OBJECT_WIDTH + moving_object.base.dimension.height = MOVING_OBJECT_HEIGHT + + moving_object.base.position.x += 0.5 + moving_object.base.position.y = 0.0 + moving_object.base.position.z = 0.0 + + moving_object.base.orientation.roll = 0.0 + moving_object.base.orientation.pitch = 0.0 + moving_object.base.orientation.yaw = 0.0 + + """Serialize""" + bytes_buffer = sensorview.SerializeToString() + f.write(struct.pack("