Skip to content

Commit

Permalink
Add remaining missing top-level interfaces and tests
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
pmai committed Jun 9, 2024
1 parent 8f5a8fc commit 91cc877
Show file tree
Hide file tree
Showing 4 changed files with 443 additions and 17 deletions.
2 changes: 1 addition & 1 deletion doc/architecture/architecture_overview.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ OSI contains an object-based environment description that uses the message forma
Google developed and maintains the Protocol Buffer library.
OSI defines top-level messages that are used to exchange data between separate models.
Top-level messages define the `GroundTruth` interface, the `SensorData` interface, and – since OSI version 3.0.0 – the interfaces `SensorView` and `SensorViewConfiguration`.
Further top-level messages that were added in later versions of OSI are `TrafficCommand`, `TrafficUpdate`, `MotionRequest`, and `StreamingUpdate`.
Further top-level messages that were added in later versions of OSI are `TrafficCommand`, `TrafficCommandUpdate`, `TrafficUpdate`, `MotionRequest`, and `StreamingUpdate`.

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

Expand Down
11 changes: 2 additions & 9 deletions osi3trace/osi2read.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
python3 osi2read.py -d trace.osi -o myreadableosifile
"""

from osi3trace.osi_trace import OSITrace
from osi3trace.osi_trace import OSITrace, MESSAGES_TYPE
import argparse
import pathlib

Expand All @@ -28,14 +28,7 @@ def command_line_arguments():
"--type",
"-t",
help="Name of the type used to serialize data.",
choices=[
"SensorView",
"GroundTruth",
"SensorData",
"TrafficUpdate",
"TrafficCommand",
"TrafficCommandUpdate",
],
choices=list(MESSAGES_TYPE.keys()),
default="SensorView",
type=str,
required=False,
Expand Down
6 changes: 6 additions & 0 deletions osi3trace/osi_trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,24 @@
from osi3.osi_sensorview_pb2 import SensorView
from osi3.osi_groundtruth_pb2 import GroundTruth
from osi3.osi_sensordata_pb2 import SensorData
from osi3.osi_sensorviewconfiguration_pb2 import SensorViewConfiguration
from osi3.osi_trafficupdate_pb2 import TrafficUpdate
from osi3.osi_trafficcommand_pb2 import TrafficCommand
from osi3.osi_trafficcommandupdate_pb2 import TrafficCommandUpdate
from osi3.osi_motionrequest_pb2 import MotionRequest
from osi3.osi_streamingupdate_pb2 import StreamingUpdate


MESSAGES_TYPE = {
"SensorView": SensorView,
"GroundTruth": GroundTruth,
"SensorData": SensorData,
"SensorViewConfiguration": SensorViewConfiguration,
"TrafficUpdate": TrafficUpdate,
"TrafficCommand": TrafficCommand,
"TrafficCommandUpdate": TrafficCommandUpdate,
"MotionRequest": MotionRequest,
"StreamingUpdate": StreamingUpdate,
}


Expand Down
Loading

0 comments on commit 91cc877

Please sign in to comment.