-
Notifications
You must be signed in to change notification settings - Fork 263
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
Sequentially play multiple bagfiles without metadata.yaml #1918
Comments
@emersonknapp I was thinking about what if add some intelligence to the Rosbag2 player. In case if someone want to replay the directory with files without rosbag2/rosbag2_cpp/src/rosbag2_cpp/reindexer.cpp Lines 250 to 275 in 0105eec
It seems we already have all the necessary heavy-lifting code in the reindexer class - and the fix is going to be literally in 10 lines of code or so. The benefit of it is a consistent behavior with the rosbag2/rosbag2_cpp/src/rosbag2_cpp/readers/sequential_reader.cpp Lines 112 to 131 in 0105eec
to use reindexing instead of reading metadata from bag file directly. Thoughts? |
Yeah, I think that a "reindex on-demand" type of implementation makes sense to me! It would then validate right at the beginning that the files are playable. I think we'd want to allow for it skipping files it can't play, like other meta-information files, rather than failing, but that's an error handling detail. |
Currently, we have a specific regex for choosing bag file names with recording. Log files and other specific non-robag2 files should already be filtered out by default. |
Description
With continuous or just long recording sessions, users need to retrieve and play back just a specific subset of files or a specific directory, which will not have
metadata.yaml
. That data should not be required to sequentially play a series of files.Related Issues
** Is this feature dependent on any other features? Is it part of a larger project? Note here. **
Completion Criteria
ros2 bag play directory_without_metadata/
will play all discovered files in filesystem order (alphabetical)ros2 bag play fileA.mcap fileB.mcap fileC.mcap
will play all specified files sequentially in the order specifiedMaybe the directory option isn't required, because the user could do file globbing,
ros2 bag play my_recording/*.mcap
Which would be fine except you lose autodetection, and if you do
ros2 bag play my_recording/*
then it might choke on for example
metadata.yaml
, which isn't a bagfile.Implementation Notes / Suggestions
I believe this comes down to removing the
metadata.yaml
requirement checks fromSequentialReader
- and instead falling back to just reading the directory.The multifile option could be as simple as
ros2bag
CLI allowingnargs='+'
, then runningfor bag in args.bags: Play()
though this would be a naive implementation that would lose Publisher continuity and introduce latency on file boundaries. So probably better to pass the list of files toSequentialReader
which would override themetadata.yaml
check.Testing Notes / Suggestions
** All features in this project need tests. Please give some input on cases that will need to be tested - and how the testing might be implemented. **
The text was updated successfully, but these errors were encountered: