Skip to content

Add scheduled play/resume support to Rosbag2 player for distributed replay#2376

Open
MichaelOrlov wants to merge 2 commits intorollingfrom
morlov/resume-play-services-with-timestamp
Open

Add scheduled play/resume support to Rosbag2 player for distributed replay#2376
MichaelOrlov wants to merge 2 commits intorollingfrom
morlov/resume-play-services-with-timestamp

Conversation

@MichaelOrlov
Copy link
Copy Markdown
Contributor

Description

This PR adds time-based playback control to rosbag2_transport::Player so playback can be started or resumed at a specific future time, which is useful for synchronizing multiple player instances.

It updates Play.srv with a new start_time field for scheduled Play requests, and updates Resume.srv to support time-based resume requests. In player.cpp, the player now executes play/resume immediately when the requested time is zero or in the past, or schedules the action for later when a future node time is provided. The player-side Resume service also validates mode support and rejects unsupported publish_time, receive_time, and tracking_topic_name usage.

The test updates cover the new behavior end-to-end. test_play_services.cpp adds coverage for scheduled future play and resume execution, including expected return codes. test_composable_player.cpp and mock_player.hpp have been updated to support the updated service interface and behavior.

Is this user-facing behavior change?

Yes.

  • Breaking Change: Enhanced service behavior with new scheduling capabilities:
    - Play service call now includes a new field start_time for scheduling future playback operations. If set to zero, it starts playback immediately.
  • Backwards Compatibility: Existing behavior is preserved:
    - Resume service call uses existing field resume_time for scheduling. If set to zero, resumes immediately.

Did you use Generative AI?

Yes. Codex gpt-5.4 was used to help updating README.md file and Copilot gpt-4.2 was used to help with tests.

Additional Information

It has updates in the API Play.srv service definition and can't be backported.

@MichaelOrlov MichaelOrlov self-assigned this Mar 15, 2026
@MichaelOrlov MichaelOrlov marked this pull request as ready for review March 15, 2026 04:39
MichaelOrlov and others added 2 commits April 22, 2026 22:26
- Extend Play.srv with start_time and update Resume.srv for time-based
  resume requests, implement future-scheduled play and resume handling
  in rosbag2_transport::Player, and add/adjust player mocks and service
  tests to cover the new scheduling behavior in composable and
  service-based playback.

Co-authored-by: ap-apexai <anup.patel@apex.ai>
Signed-off-by: Michael Orlov <morlovmr@gmail.com>
- Update the playback services section to describe player-side
 time-based play and resume behavior, including the new Play.start_time
 field, future scheduling semantics, node clock usage, and
 player-specific return behavior for resume, seek, and stop.

Signed-off-by: Michael Orlov <morlovmr@gmail.com>
@MichaelOrlov MichaelOrlov force-pushed the morlov/resume-play-services-with-timestamp branch from b24ef4e to 24e13de Compare April 23, 2026 05:27
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.

Enable coordination across multiple recorder/player instances by scheduling services at a shared future timestamp

1 participant