Skip to content

Commit c2193e4

Browse files
Merge branch 'master' of https://github.com/OpenSimulationInterface/open-simulation-interface into bug/ha/dashed-lines-with-gap
Signed-off-by: Thomas Sedlmayer <tsedlmayer@pmsfit.de>
2 parents 0bc4ea4 + 412521e commit c2193e4

File tree

89 files changed

+14272
-8046
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+14272
-8046
lines changed

.github/workflows/protobuf.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,14 @@ jobs:
5454
- name: Prepare C++ Build
5555
run: mkdir build
5656

57-
- name: Prepare Documentation Bukd
57+
# Versioning
58+
- name: Get versioning
59+
id: get_version
60+
run: echo ::set-output name=VERSION::$(git describe --always)
61+
62+
- name: Prepare Documentation Build
5863
run: |
59-
sed -i 's/@VERSION_PATCH@/@VERSION_PATCH@_GitHub_MasterBranch/g' doxygen_config.cmake.in
64+
sed -i 's/PROJECT_NUMBER\s*= @VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@/PROJECT_NUMBER = master (${{ steps.get_version.outputs.VERSION }})/g' doxygen_config.cmake.in
6065
echo "EXCLUDE_PATTERNS = */osi3/* */protobuf-3.15.8/* */proto2cpp/*" >> doxygen_config.cmake.in
6166
echo "GENERATE_TREEVIEW = YES" >> doxygen_config.cmake.in
6267

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ dist/
44
doc/html
55
doc/latex
66
osi/
7+
osi3/
78

89
# Specific extensions
910
*.egg-info
@@ -20,6 +21,7 @@ cmake_install.cmake
2021
install_manifest.txt
2122
osi_version.proto
2223
version.py
24+
pyproject.toml
2325

2426
# Eclipse-specific files, if any
2527
*.cproject

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "flatbuffers"]
2+
path = flatbuffers
3+
url = https://github.com/google/flatbuffers.git

CMakeLists.txt

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ project(open_simulation_interface)
55
# set default compiler
66
set(CMAKE_CXX_STANDARD 11)
77

8+
# Optional Flatbuffer support
9+
set(BUILD_FLATBUFFER OFF CACHE BOOLEAN "Build flatbuffer versions of libraries")
10+
811
# Set a default build type if none was specified
912
set(default_build_type "Release")
1013
if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
@@ -84,6 +87,48 @@ set(OSI_PROTO_FILES
8487
)
8588

8689
protobuf_generate_cpp(PROTO_SRCS PROTO_HEADERS ${OSI_PROTO_FILES})
90+
set(FLAT_HEADERS "")
91+
if(BUILD_FLATBUFFER)
92+
set(FLAT_FBS "")
93+
add_subdirectory("flatbuffers"
94+
${CMAKE_CURRENT_BINARY_DIR}/flatbuffers-build
95+
EXCLUDE_FROM_ALL)
96+
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/descriptor.fbs" "namespace osi3;")
97+
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/include")
98+
list(APPEND FLAT_FBS "${CMAKE_CURRENT_BINARY_DIR}/descriptor.fbs")
99+
foreach (proto ${OSI_PROTO_FILES})
100+
get_filename_component(proto_base ${proto} NAME_WE)
101+
set(fbs "${proto_base}.fbs")
102+
add_custom_command(
103+
OUTPUT "${fbs}"
104+
COMMAND $<TARGET_FILE:flatc> -I "${PROTOBUF_IMPORT_DIRS}" -o "${CMAKE_CURRENT_BINARY_DIR}" --proto "${CMAKE_CURRENT_SOURCE_DIR}/${proto}"
105+
DEPENDS "${proto}" flatc
106+
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
107+
COMMENT "Convert ${proto} to ${fbs} using flatc"
108+
)
109+
list(APPEND FLAT_FBS "${CMAKE_CURRENT_BINARY_DIR}/${fbs}")
110+
endforeach()
111+
112+
foreach (flat ${FLAT_FBS})
113+
get_filename_component(flat_base ${flat} NAME_WE)
114+
set(fbs "${flat_base}.fbs")
115+
set(fbh "${flat_base}_generated.h")
116+
add_custom_command(
117+
OUTPUT "include/${fbh}"
118+
COMMAND $<TARGET_FILE:flatc> -o "${CMAKE_CURRENT_BINARY_DIR}/include" --cpp --gen-mutable --gen-name-strings --scoped-enums "${fbs}"
119+
DEPENDS "${FLAT_FBS}" flatc
120+
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
121+
COMMENT "Process ${fbs} to ${fbh} using flatc"
122+
)
123+
list(APPEND FLAT_HEADERS "${CMAKE_CURRENT_BINARY_DIR}/include/${fbh}")
124+
endforeach()
125+
126+
add_custom_target(${PROJECT_NAME}_fbs_build ALL DEPENDS "${FLAT_HEADERS}")
127+
add_library(${PROJECT_NAME}_fbs INTERFACE)
128+
target_include_directories(${PROJECT_NAME}_fbs INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include/>)
129+
target_include_directories(${PROJECT_NAME}_fbs SYSTEM INTERFACE $<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>)
130+
target_link_libraries(${PROJECT_NAME}_fbs INTERFACE flatbuffers)
131+
endif()
87132

88133
add_library(${PROJECT_NAME}_static STATIC ${PROTO_SRCS} ${PROTO_HEADERS})
89134
target_include_directories(${PROJECT_NAME}_static
@@ -168,7 +213,7 @@ install(FILES
168213
COMPONENT dev)
169214

170215
# Header files
171-
install(FILES ${PROTO_HEADERS}
216+
install(FILES ${PROTO_HEADERS} ${FLAT_HEADERS}
172217
DESTINATION "${INSTALL_INCLUDE_DIR}")
173218

174219
# Install the export set for use with the install-tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def main():
3030

3131
sv_ground_truth = sensorview.global_ground_truth
3232
sv_ground_truth.version.version_major = 3
33-
sv_ground_truth.version.version_minor = 3
33+
sv_ground_truth.version.version_minor = 4
3434
sv_ground_truth.version.version_patch = 0
3535

3636
sv_ground_truth.timestamp.seconds = 0

VERSION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
VERSION_MAJOR = 3
2-
VERSION_MINOR = 3
3-
VERSION_PATCH = 1
2+
VERSION_MINOR = 4
3+
VERSION_PATCH = 0
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
= Overview of OSI architecture
2+
3+
OSI contains an object-based environment description that uses the message format of the https://github.com/protocolbuffers/protobuf/wiki[Protocol Buffer] library.
4+
Google developed and maintains the Protocol Buffer library.
5+
OSI defines top-level messages that are used to exchange data between separate models.
6+
Top-level messages define the `GroundTruth` interface, the `SensorData` interface, and – since OSI version 3.0.0 – the interfaces `SensorView`, `SensorViewConfiguration`, and `FeatureData`.
7+
8+
The following figure shows the interfaces and models involved in modeling a sensor.
9+
10+
.Open Simulation Interface overview
11+
image::{images_open_simulation_interface}/osi-context.png[1100]
12+
13+
14+
OSI also defines interfaces for traffic participant models.
15+
The `TrafficCommand` interface makes it possible to send commands to traffic participant models.
16+
The `TrafficUpdate` interface makes it possible to receive the updated state from traffic participant models.
17+
The following figure shows the interfaces of a generic traffic participant.
18+
19+
.Interface of a traffic participant
20+
image::{images_open_simulation_interface}/osi-traffic-participant-principle.png[1100]
21+
22+
Traffic participant models may use other OSI interfaces internally, for example, to model autonomous vehicles.
23+
The following figure shows a more advanced use case for traffic participants.
24+
25+
.Traffic participant with sensor models, AD function, and dynamic model
26+
image::{images_open_simulation_interface}/osi-traffic-participant-advanced.png[1100]
27+
28+
The `HostVehicleData` interface describes the measured internal states of a traffic participant.
29+
OSI currently provides only limited support for data structures that describe measured internal states of traffic participants.
30+
Actuator intentions are currently not covered by OSI and must be handled using a different data description format.
31+
32+
All fields in an interface are set to `optional`.
33+
`required` is not used.
34+
This has been done to allow backward-compatible changes in the field.
35+
Additionally, this is the default behavior in Protocol Buffer version 3 that no longer has the `required` type.
36+
Setting all fields to `optional` thus ensures update compatibility.
37+
However, this does not mean that it is optional to fill the field.
38+
For the purpose of providing a complete interface, all existing fields should be set, unless not setting a field carries a specific meaning, as indicated in the accompanying comment.
39+
40+
All field numbers equal to or greater than 10000 are available for user-specific extensions via custom fields.
41+
No future evolution of OSI will therefore use field numbers equal to or greater than 10000.

doc/architecture/data_layer.adoc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
= Data layer
2+
3+
The OSI data layer is defined in the message specifications using the ProtoBuf IDL cite:[protobuf].
4+
This defines the data that can be transmitted using OSI, including the structure and the semantics of the data.
5+
6+
Additionally, it specifies the encoding to be used when OSI data is transmitted.
7+
Currently, ProtoBuf encoding is used, but other encodings are possible with the ProtoBuf IDL.
8+
FlatBuffer encoding has been implemented as an experimental feature.
9+
10+
The data layer does not directly define components and transmission routes.
11+
These are defined in the OSI packaging layer.
12+
There may be different packaging layer implementations using the shared data layer definitions.
13+
The data that is exchanged remains compatible regardless of the packaging layer implementation.
14+
The use of a shared data layer ensures easy bridging between different packaging layer implementations.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
= Environmental effect model
2+
3+
Environmental effect models consume `SensorView` messages and produce `SensorView` messages.
4+
Environmental effect models may, for example, alter `SensorView` messages to include effects and phenomena caused by:
5+
6+
* Shadows and occlusions
7+
* Weather effects
8+
* Physics of a sensor
9+
* Pre-processing of raw sensor data

doc/architecture/feature_data.adoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
= Feature data
2+
3+
`FeatureData` messages contain detected features in the reference frame of a sensor.
4+
`FeatureData` messages are generated from `GroundTruth` messages.
5+
They serve, for example, as an input to sensor models simulating object detection or feature fusion models.

0 commit comments

Comments
 (0)