Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timestamp split bagfiles instead of serial numbering #1917

Open
Tracked by #1915
emersonknapp opened this issue Feb 22, 2025 · 0 comments
Open
Tracked by #1915

Timestamp split bagfiles instead of serial numbering #1917

emersonknapp opened this issue Feb 22, 2025 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@emersonknapp
Copy link
Collaborator

emersonknapp commented Feb 22, 2025

Description

Name individual bagfiles with a timestamp of their start time, rather than an increasing integer index serial number.

I think most of the time, we don't care which number split a file is, but rather are interested in what time period it represents.

An illustration:

$ ros2 bag record -o my_recording --max-bag-duration 90

Should create this structure

my_recording/
├── my_recording_20250221T162100Z.mcap
├── my_recording_20250221T162230Z.mcap
├── my_recording_20250221T162400Z.mcap
└── my_recording_20250221T162530Z.mcap

Open questions:

  • the format of the timestamp. Should we provide a format string option for the user to specify how they'd like their timestamps output?
  • ROS Time - should the timestamps conform to simulation time when it's provided? Is that an option we even are able to enable on the recorder right now?
  • Clock adjustments: if using system time, theoretically it could jump backward and potentially create the same filename twice - probably extremely unlikely but should be considered. should that be considered problem? should we allow - or force - using monotonic time?

Related Issues

Part of #1915

Discussed in #1910

Completion Criteria

_0, _1, _2 bagfile name suffixes are instead replaced with timestamps.

Implementation Notes / Suggestions

The base feature should be a relatively easy addition in the SequentialWriter, probably using std::strftime (which suggests to me that we could allow user to provide the format string without much issue).

The edge cases may end up introducing complications depending what we decide.

Testing Notes / Suggestions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant