Skip to content

Commit 91cc877

Browse files
committed
Add remaining missing top-level interfaces and tests
Add all remaining top-level interfaces, fix documentation list of said interfaces and add tests for all interfaces to the osi_trace tests. Signed-off-by: Pierre R. Mai <pmai@pmsf.de>
1 parent 8f5a8fc commit 91cc877

File tree

4 files changed

+443
-17
lines changed

4 files changed

+443
-17
lines changed

doc/architecture/architecture_overview.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ OSI contains an object-based environment description that uses the message forma
88
Google developed and maintains the Protocol Buffer library.
99
OSI defines top-level messages that are used to exchange data between separate models.
1010
Top-level messages define the `GroundTruth` interface, the `SensorData` interface, and – since OSI version 3.0.0 – the interfaces `SensorView` and `SensorViewConfiguration`.
11-
Further top-level messages that were added in later versions of OSI are `TrafficCommand`, `TrafficUpdate`, `MotionRequest`, and `StreamingUpdate`.
11+
Further top-level messages that were added in later versions of OSI are `TrafficCommand`, `TrafficCommandUpdate`, `TrafficUpdate`, `MotionRequest`, and `StreamingUpdate`.
1212

1313
The following figure shows the interfaces and models involved in modeling a sensor.
1414

osi3trace/osi2read.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
python3 osi2read.py -d trace.osi -o myreadableosifile
66
"""
77

8-
from osi3trace.osi_trace import OSITrace
8+
from osi3trace.osi_trace import OSITrace, MESSAGES_TYPE
99
import argparse
1010
import pathlib
1111

@@ -28,14 +28,7 @@ def command_line_arguments():
2828
"--type",
2929
"-t",
3030
help="Name of the type used to serialize data.",
31-
choices=[
32-
"SensorView",
33-
"GroundTruth",
34-
"SensorData",
35-
"TrafficUpdate",
36-
"TrafficCommand",
37-
"TrafficCommandUpdate",
38-
],
31+
choices=list(MESSAGES_TYPE.keys()),
3932
default="SensorView",
4033
type=str,
4134
required=False,

osi3trace/osi_trace.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,24 @@
88
from osi3.osi_sensorview_pb2 import SensorView
99
from osi3.osi_groundtruth_pb2 import GroundTruth
1010
from osi3.osi_sensordata_pb2 import SensorData
11+
from osi3.osi_sensorviewconfiguration_pb2 import SensorViewConfiguration
1112
from osi3.osi_trafficupdate_pb2 import TrafficUpdate
1213
from osi3.osi_trafficcommand_pb2 import TrafficCommand
1314
from osi3.osi_trafficcommandupdate_pb2 import TrafficCommandUpdate
15+
from osi3.osi_motionrequest_pb2 import MotionRequest
16+
from osi3.osi_streamingupdate_pb2 import StreamingUpdate
1417

1518

1619
MESSAGES_TYPE = {
1720
"SensorView": SensorView,
1821
"GroundTruth": GroundTruth,
1922
"SensorData": SensorData,
23+
"SensorViewConfiguration": SensorViewConfiguration,
2024
"TrafficUpdate": TrafficUpdate,
2125
"TrafficCommand": TrafficCommand,
2226
"TrafficCommandUpdate": TrafficCommandUpdate,
27+
"MotionRequest": MotionRequest,
28+
"StreamingUpdate": StreamingUpdate,
2329
}
2430

2531

0 commit comments

Comments
 (0)