Skip to content

Conversation

@MichaelOrlov
Copy link
Contributor

Description

This PR adds a direct API for rosbag2_transport::Recorder to enable direct use of the recorder without creating any subscriptions. For instance, from device drivers.

Added direct recorder API add_channel(..) and write_message(..)
Added direct write_message(..) API with recv_timestamp
Added direct on_messages_lost_in_transport(..) API
Note: The on_messages_lost_in_transport(..) method is expected to be called when messages are lost in the transport layer.
Added get_total_num_messages_lost_in_transport() getter method.

Is this user-facing behavior change?

No. However, the new API will become available

Did you use Generative AI?

Yes, I am using GitHub Copilot, GPT-5 in my workflow, mostly to help with writing tests and documentation.

Additional Information

This PR will be difficult to backport since it depends on the non-backportable other PR #2215

@MichaelOrlov MichaelOrlov changed the title Morlov/add direct recorder api Add a direct API for rosbag2_transport::Recorder Nov 3, 2025
Add direct recorder API add_channel(..) and write_message(..)
Add direct write_message(..) API with recv_timestamp
Add direct `on_messages_lost_in_transport(..)` API
 Note: The `on_messages_lost_in_transport(..)` method is expected to be
 called when messages are lost in the transport layer.
Also added `get_total_num_messages_lost_in_transport()` getter method.

Signed-off-by: Michael Orlov <[email protected]>
@MichaelOrlov MichaelOrlov force-pushed the morlov/add-direct-recorder-api branch from 8da4b27 to b3ff13d Compare November 6, 2025 21:07
@MichaelOrlov MichaelOrlov marked this pull request as ready for review November 6, 2025 21:08
@MichaelOrlov
Copy link
Contributor Author

Pulls: #2221
Gist: https://gist.githubusercontent.com/MichaelOrlov/df277b214be56f941548fa2ac2b8347b/raw/5c2e131defa568d48f5861a6cf5b27a6d3ec0732/ros2.repos
BUILD args: --packages-above-and-dependencies rosbag2_transport
TEST args: --packages-above rosbag2_transport
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/17427

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

@MichaelOrlov MichaelOrlov merged commit d20f755 into rolling Nov 11, 2025
12 checks passed
@MichaelOrlov MichaelOrlov deleted the morlov/add-direct-recorder-api branch November 11, 2025 04:03
@MichaelOrlov MichaelOrlov restored the morlov/add-direct-recorder-api branch November 14, 2025 04:11
@MichaelOrlov MichaelOrlov deleted the morlov/add-direct-recorder-api branch November 14, 2025 04:13
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.

Direct API for the Rosbag2 recorder

4 participants