Add input[output]_serialization_format to the RecordOptions #2215
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds a new
input[output]_serialization_formatfields to theRecordOptionsin replacement of theRecordOptions::rmw_serialization_format. The new options parameters are needed to avoid possible conversion to the CDR serialization if incoming messages are originally serialized in a different format, which is currently made by default.These changes needed to facilitate:
from the #2214
The newly added
RecorderOptionfields explicitly specify input and output serialization formats for the messages the recorder processes.Please note that if
input_serialization_formatandoutput_serialization_formatare different, the Rosbag2 recorder will try to find a plugin and use it for conversion from one serialization format to another.Is this user-facing behavior change?
Note: The former
RecordOptions::rmw_serialization_formatwasn't removed, but rather a deprecation message was added in the log if it is used.While the backward compatibility on the API level is preserved, it is advised to use the newly added
RecordOptions::output_serialization_formatinstead of theRecordOptions::rmw_serialization_formatsince the latter is expected to be removed after the next ROS 2 distro release.Did you use Generative AI?
Yes. I am using GitHub Copilot, GPT-4.1 in my workflow
Additional Information
Note: The former
RecordOptions::rmw_serialization_formatwasn't removed, but rather a deprecation message was added in the log if it is used.This PR can't be backported since it introduces ABI-breaking changes.