-
Notifications
You must be signed in to change notification settings - Fork 260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
inform storage plugin about message-level compression #1144
Comments
As far as I recall we have discussed per message compression and per message encryption during original
Adding new special field for indicating compression and encryption will cause a big headache for backward compatibility and doesn't look reasonable IMO. |
For completeness we have already passing |
I think compression type and message serialisation format are separate concepts that any consumer will need to handle separately. How they are encoded in the TopicMetadata is an implementation detail. Therefore, the choice comes down to one of:
I'm in favor of (2), assuming it's technically feasible to do so without breaking ABI compatibility. The only reason not to choose (2) would be to avoid the pain of dealing with struct compatibility concerns across ABI boundaries. Before choosing I'd like to understand concretely what these concerns are and what we'd have to do to address them, if we chose to go down the (2) route. If we chose (1), I would want to document a clear definition of the scheme of the |
I would like to make a case that compression options are entirely a storage plugin concern, not a global setting. Different storage plugins will support different compression options. For example:
I think file and message level compression are both strictly worse than chunk compression, and having message encryption as a global setting means that you can currently do silly things like enable both message compression (at the rosbag2 level) and chunk compression (at the mcap storage plugin level). In addition, storage plugins cannot simply treat the messages as binary blobs. MCAP is specifically designed to be self-contained and allow decoding by non-ROS third party tools, so it is not acceptable for the upstream rosbag package to transform the data without the plugin being informed. Concrete proposal: move the current compression options (per file, per message) into the sqlite plugin, and let each plugin handle compression individually. |
@amacneil Your statement about that chunk compression is always better would be true if not considering real world data and in particular camera images and LIDAR data. Please consider a case when for instance we have stream of data from multiple cameras and we want to do per message compression with JPEG and do it HW accelerated on FPGA. And we want to be a valid case if we are not able to compress in This use case doesn't align very well in your paradigm that all compression should be moved to the plugin level. |
JPEG compression is not a responsibility of the recording process. That would require modifying the content of the messages, making them incompatible with their own schema. The logic you describe (compressing a subset of messages with JPEG) belongs at the application layer using the existing ROS concepts (nodes that subscribe and transform messages). |
Copying discussion to issue - below is from @MichaelOrlov .
|
Let me also register the standing goals agreed on at the working group here on this issue:
|
The proposal of dealing with this by adding an I think we should change tactic and not try to pass all of BagMetadata to the storage plugin. At a minimum the storage plugin needs only these data:
My alternate proposal is:
|
@james-rms I've tried to spend some more time trying to consider your proposal with transmitting The problem is that rosbag2/rosbag2_compression/src/rosbag2_compression/sequential_compression_writer.cpp Lines 40 to 45 in 0c7c352
and there are no descent way to pass such parameters aka WriterOptions with rosbag2_compression::CompressionOptions to the base SequentialWriter class to be able to pass this parameter further on to the
To be more clear. Of course we can pass some WriterOptions with rosbag2_compression::CompressionOptions to the SequentialWriter constructor but it will be incorrect from design point of view if we will pass it from SequentialCompressionWriter . Because SequentialWriter shall not be created with WriterOptions::CompressionOptions::compression_mode == message .
If you can come up with less "hucky" solution with concrete implementation in code which align with current rosbag2 design - I am open to consider it. |
Actions from sync:
|
This issue has been mentioned on ROS Discourse. There might be relevant details there: https://discourse.ros.org/t/psa-default-ros-2-bag-storage-format-is-changing-to-mcap-in-iron/28489/1 |
Description
Right now the message-level compression mode being used is not passed to the storage plugin. This means that without the
metadata.yaml
file, we have no way of knowing if adb3
ormcap
's messages are CDR encoded, or CDR encoded and compressed. This information should be stored inside the bag somehow. Specific plugins can choose their own way of storing this and dealing with that information, but for now, this is an issue tracking the storage plugin API's ability to pass that information down at all.Completion Criteria
Implementation Notes / Suggestions
Testing Notes / Suggestions
** All features in this project need tests. Please give some input on cases that will need to be tested - and how the testing might be implemented. **
The text was updated successfully, but these errors were encountered: