Skip to content

Draft: Add delayed modes for recorder and replay services#2330

Draft
carlos-apex wants to merge 4 commits intoros2:rollingfrom
carlos-apex:add-time-based-recorder-services
Draft

Draft: Add delayed modes for recorder and replay services#2330
carlos-apex wants to merge 4 commits intoros2:rollingfrom
carlos-apex:add-time-based-recorder-services

Conversation

@carlos-apex
Copy link

@carlos-apex carlos-apex commented Feb 10, 2026

Description

  • Add delayed modes for record and replay services:
    • rosbag2_interfaces/srv/SplitBagfile
    • rosbag2_interfaces/srv/Record
    • rosbag2_interfaces/srv/Resume
    • rosbag2_interfaces/srv/Play
    • rosbag2_interfaces/srv/Resume
  • Introduce split modes (node_time, publish_time, receive_time) with tracking topic support and pending split semantics.
  • Extend service responses with explicit return codes/error strings where applicable.

Is this user-facing behavior change?

Yes. Service behavior and request/response fields changed.

Recorder services

  • rosbag2_interfaces/srv/SplitBagfile
    • Added split modes: node_time, publish_time, receive_time.
    • split_time now supports scheduling; past/zero executes immediately.
    • tracking_topic_name optionally scopes publish/receive‑time evaluation.
    • Responses now include explicit return_code/error_string (e.g., not recording, invalid mode/topic, split failed).
  • rosbag2_interfaces/srv/Record
    • start_time allows scheduling a future start; past/zero starts immediately.
    • Response includes return_code/error_string on failure.
  • rosbag2_interfaces/srv/Resume
    • resume_time allows scheduling a future resume; past/zero resumes immediately.

Player services

  • rosbag2_interfaces/srv/Play
    • start_time allows scheduling playback in the future; past/zero starts immediately.
    • Response includes return_code/error_string with explicit enum values.
  • rosbag2_interfaces/srv/Resume
    • resume_time allows scheduling a future resume; past/zero resumes immediately.

Did you use Generative AI?

Yes. OpenAI Codex (GPT‑5) was used to adapt patches from internal changes.

Additional Information

@carlos-apex carlos-apex force-pushed the add-time-based-recorder-services branch from ddbbdc5 to d1a8192 Compare February 11, 2026 11:50
@carlos-apex carlos-apex changed the title Draft: Add time based recorder services Draft: Add time based recorder and replay services Feb 11, 2026
@carlos-apex carlos-apex force-pushed the add-time-based-recorder-services branch 3 times, most recently from 29de30e to 3fcd8e8 Compare February 11, 2026 12:24
Adds a timestamp member for the following services:

- rosbag2_interfaces/srv/Record.srv
- rosbag2_interfaces/srv/Resume.srv
- rosbag2_interfaces/srv/SplitBagfile.srv

A helper RecorderDelayedActionRunner is implemented to runs delayed tasks. It is implemented as a worker thread and time-based priority queue containing actions (callbacks)

Signed-off-by: Carlos San Vicente <carlos.sanvicente@apex.ai>
…to use it in Player

- Rename files and RecorderDelayedActionTaskRunner, RecorderDelayedActionTaskRunnerImpl classes to the DelayedActionTaskRunner
- Minor fixes such as updating error log messages and addressing race condition for the ScheduledActionTask::sequence_id

Signed-off-by: Carlos San Vicente <carlos.sanvicente@apex.ai>
Adds the following split modes:
- node_time: timer-based splitting (already implemented)
- publish_time: message publish (or send) time based splitting
- receive_time: message receive (or log) time based splitting

Signed-off-by: Carlos San Vicente <carlos.sanvicente@apex.ai>
@carlos-apex carlos-apex force-pushed the add-time-based-recorder-services branch from 3fcd8e8 to 9f534cb Compare February 11, 2026 12:24
@carlos-apex carlos-apex changed the title Draft: Add time based recorder and replay services Draft: Add delayed modes for recorder and replay services Feb 12, 2026
@MichaelOrlov
Copy link
Contributor

@carlos-apex Can you please take a look at the test failure?

/tmp/ws/src/rosbag2/rosbag2_transport/test/rosbag2_transport/test_play.cpp:471
Value of: player->wait_for_playback_to_start(10s)
  Actual: false
Expected: true

It seems relevant to the changes.

@carlos-apex
Copy link
Author

@MichaelOrlov I would say the failure is unrelated to the changes, the player behavior is not changed in this PR.

I tried to reproduce the failure locally and it only failed after many many repetitions.

@MichaelOrlov
Copy link
Contributor

@MichaelOrlov I would say the failure is unrelated to the changes, the player behavior is not changed in this PR.

I tried to reproduce the failure locally and it only failed after many many repetitions.

Okay, good, I will try to reproduce it to see what it could cause the failure.

Meanwhile, can you please sign your commits? Please see https://github.com/ros2/rosbag2/pull/2330/checks?check_run_id=63499982511 fro details.

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

2 participants