Skip to content

Conversation

@MichaelOrlov
Copy link
Contributor

@MichaelOrlov MichaelOrlov commented Oct 25, 2025

Description

This PR adds a new input[output]_serialization_format fields to the RecordOptions in replacement of the RecordOptions::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:

    • Rosbag2 recorder has an option to avoid conversion to the CDR serialization format if the topic has a different serialization format.

from the #2214

The newly added RecorderOption fields explicitly specify input and output serialization formats for the messages the recorder processes.
Please note that if input_serialization_format and output_serialization_format are 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_format wasn'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_format instead of the RecordOptions::rmw_serialization_format since 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_format wasn'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.

- Rationale: To be able to explicitly specify input and output
 serialization formats from the direct Rosbag2 recorder API in the
 future and avoid unnecessary conversion.
- The former `RecordOptions::rmw_serialization_format` wasn't removed,
 but rather a deprecation message was added in the log if it is used.

Signed-off-by: Michael Orlov <[email protected]>
@MichaelOrlov MichaelOrlov marked this pull request as ready for review October 25, 2025 03:16
@MichaelOrlov
Copy link
Contributor Author

Pulls: #2215
Gist: https://gist.githubusercontent.com/MichaelOrlov/838fd239aa8d0e4390325a83b5b5b71c/raw/3f88f7754d19408de5934f8107f2fc16ce7f6018/ros2.repos
BUILD args: --packages-above-and-dependencies rosbag2_transport rosbag2_tests ros2bag rosbag2_py
TEST args: --packages-above rosbag2_transport rosbag2_tests ros2bag rosbag2_py
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/17377

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

Copy link
Member

@christophebedard christophebedard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@MichaelOrlov MichaelOrlov merged commit 77edeb8 into rolling Nov 6, 2025
12 checks passed
@MichaelOrlov MichaelOrlov deleted the morlov/add-in-out-serialization-format-for-recorder branch November 6, 2025 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants