You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One or multiple OSI tracefiles should be packaged within an MCAP container MCAP repository. MCAP is now used for ros2 and is MIT licensed. Recently the requirement for signing a CLA with Foxglove Inc. was lifted. Therefore the broad usage is now unproblematic.
Describe the solution you would like
We analyse the meta data used and proposed in the MCAP project and map it to the meta data information used in the OSI project. The osi tracefile writer python script is extended to also wirte these MCAP traces. The documentation of osi regarding traces is extended with the example and usage guidelines for MCAP. A good usecase are e.g. traffic participant models which have multiple osi trace outputs which are time synchronized and could profit from being stored in a single container.
Describe alternatives you have considered
Consider mentioning the possibility of using ASAM MDF as container. Remark: MCAP is used broadly in simulation context already.
Describe the backwards compatibility
No issues. We should name the tracefiles contained within the MCAP container according to the existing naming conventions.
In the POC, I created an .mcap file consisting of OSI3::SensorView messages using the Python package. I then read this .mcap file using an extended version of the OpenMSL trace-file-player, which fed the data into a co-simulation using openmcx. This combination of Python and C++ worked smoothly.
Now, let's dive into the details:
Timestamps are (more or less) required
If omitted, the MCAP writer will automatically use the time when the message is added.
It’s most practical to use OSI timestamps, which are required in each top-level message since version 3.7.
A topic is required
Each message must be stored under a topic.
We propose using the name of the top-level message class, e.g., SensorView.
mcap can handle compression
MCAP supports data compression, using zstd by default.
Other options include lz4 and no compression.
Further testing is needed to determine if zstd is fast enough for large SensorData messages.
Here's a comparison of file sizes for a short file containing a few SensorView messages:
While specifying the required metadata and formats would be sufficient, we strongly recommend providing implementations of the MCAP writer and reader, similar to the existing osi3trace/osi_trace.py script.
The benefits of providing such implementations, which are essentially thin wrappers, include:
Easier adoption of the MCAP format.
Could be integrated into OSI.
Provides out-of-the-box support.
Enhances user experience and usability.
Automatic selection of topics based on message type (ensuring consistency).
Automatic setting of timestamps to OSI timestamps (ensuring consistency).
Automated handling of metadata.
Avoids reinventing the wheel for tools like the OpenMSL trace file player and writer.
Prevents errors when trying to store non-top-level messages.
I will be out of the office for the next three weeks, but Clemens will be available to discuss this further. Upon my return, I plan to create a branch to provide such an implementation.
@thomassedlmayer could you add the link to the example tracefiles here please? They are MPL-2.0 licensed? I need the example actually quite quickly in order to test it with a visualization tool.
I'm not sure if we can make the repo public because there is some sensor specific code etc. in there. But I'll bring this up for discussion next week because I agree that the sample files should be publicly available.
But since the files are licensed as MPL 2.0 you can of course copy them (I suppose you have access.)
Activity
jdsika commentedon Aug 5, 2024
@TimmRuppert I have invited you to the official team.
jdsika commentedon Aug 5, 2024
Here is a current draft from Pierre for meta data deifnitions for osi tracefiles: GAIA-X4PLC-AAD/ontology-management-base#80
TimmRuppert commentedon Sep 5, 2024
I explored the possibilities of using MCAP, conducted a quick proof of concept (POC), and discussed it with the Persival team.
General overview:
mcapis available, which can be used to display information, among other things. Example:In the POC, I created an .mcap file consisting of
OSI3::SensorViewmessages using the Python package. I then read this .mcap file using an extended version of the OpenMSL trace-file-player, which fed the data into a co-simulation using openmcx. This combination of Python and C++ worked smoothly.Now, let's dive into the details:
Timestamps are (more or less) required
A topic is required
Each message must be stored under a topic.
We propose using the name of the top-level message class, e.g.,
SensorView.mcap can handle compression
Metadata
cration_toolmetadata entry would be a new addition.Specification and Implementation
While specifying the required metadata and formats would be sufficient, we strongly recommend providing implementations of the MCAP writer and reader, similar to the existing
osi3trace/osi_trace.pyscript.The benefits of providing such implementations, which are essentially thin wrappers, include:
I will be out of the office for the next three weeks, but Clemens will be available to discuss this further. Upon my return, I plan to create a branch to provide such an implementation.
ClemensLinnhoff commentedon Sep 5, 2024
@jdsika let's discuss this next week.
ClemensLinnhoff commentedon Oct 2, 2024
Specification
Library
jdsika commentedon Oct 2, 2024
@thomassedlmayer could you add the link to the example tracefiles here please? They are MPL-2.0 licensed? I need the example actually quite quickly in order to test it with a visualization tool.
thomassedlmayer commentedon Oct 2, 2024
@jdsika https://github.com/GAIA-X4PLC-AAD/sensordata/tree/main/ars548/sampledata/119_pmsf_adc_cutout
License information is also given there. (Yes, it's MPL 2.)
jdsika commentedon Oct 2, 2024
Should we just copy the files? The repo is private
thomassedlmayer commentedon Oct 2, 2024
Where do you want to copy the files to?
I'm not sure if we can make the repo public because there is some sensor specific code etc. in there. But I'll bring this up for discussion next week because I agree that the sample files should be publicly available.
But since the files are licensed as MPL 2.0 you can of course copy them (I suppose you have access.)
jdsika commentedon Oct 2, 2024
I think we should use the trace as a test case for the reader/writer utility
pmai commentedon Jul 16, 2026
MCAP implemented in V3.8.0