Skip to content
This repository was archived by the owner on May 31, 2025. It is now read-only.

Record a maximum number of splits and then begin deleting old files#866

Merged
dirk-thomas merged 3 commits intoros:kinetic-develfrom
contradict:rosbag_fixedsize
Aug 15, 2016
Merged

Record a maximum number of splits and then begin deleting old files#866
dirk-thomas merged 3 commits intoros:kinetic-develfrom
contradict:rosbag_fixedsize

Conversation

@contradict
Copy link
Copy Markdown
Contributor

This patch allows creating a fixed size recording of the most recent data. It add a --max-splits option to rosbag record. When --split is used, after max-splits files have been created, the oldest one is deleted so a fixed size (or fix duration if --duration is used) recording can be made.

("bz2,j", "use BZ2 compression")
("lz4", "use LZ4 compression")
("split", po::value<int>()->implicit_value(0), "Split the bag file and continue recording when maximum size or maximum duration reached.")
("max-splits", po::value<int>()->default_value(0), "Split the bag file at most splits times, then begin erasing the oldest split to keep a constant number of files.")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the new options isn't doing the actual splitting but limits the number of log files I would suggest a help text like this:

Keep a maximum of N bag files, when reaching the maximum erase the oldest one to keep a constant number of files.

The same / similar for the Python help string.

@dirk-thomas
Copy link
Copy Markdown
Member

This is a nice feature. The patch looks fine - I only commented inline on some minor things.

@dirk-thomas
Copy link
Copy Markdown
Member

dirk-thomas commented Aug 15, 2016

Thank you for the patch and iterating on it.

Please consider updating the wiki page to mention the new command line option (with <<Version(ROS Kinetic)>> to indicate that the new option has been added in Kinetic). Please post a link to the diff here for easier discoverability.

@dirk-thomas dirk-thomas merged commit 7e84844 into ros:kinetic-devel Aug 15, 2016
@dirk-thomas
Copy link
Copy Markdown
Member

For the record: http://wiki.ros.org/action/diff/rosbag/Commandline?action=diff&rev1=30&rev2=31 Thanks for updating the page.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants