Earlier this year I had to prepare a ROS2 course for undergraduate students as part of my work, where I had to debug a series of robots over different exercises where topics often changed, which made rosbag2 debugging rather tedious to set up each time.
For this reason, I am currently developing dynrec (short for rosbag2 Dynamic Recorder): a package designed to allow users to dynamically select which topics to record during a rosbag2 run. This means that you could now freely add and remove topics during recording, alternate between topic sets, or pause and resume, all without having to stop the recording process.
Feedback is greatly appreciated, as it helps me improve the project, especially on the early stages.
This is a great idea! Are there any caveats regarding the resulting bag file in terms of playback, indexing, etc. or can it be used just like any other, continuous bag with most ROS tools?
Great question and thank you very much for your comment! So far, the resulting file is identical to the rosbag2 bags in terms of format and tool compatibility (they can be replayed via the standard ros2 bag play or checked via ros2 bag info, although the package offers its own info command).
On the other hand, there are some particularities on the dynamically recorded bags:
There are event topics which signal at which point a topic was added, removed or recording was paused and resumed. These are there so that you can tell whether missing topics are a result of the dynamic recorderโs instructions or due to external factors.
The bags donโt have all the features from the original rosbag2 packages at the moment. Features like compression are missing, but will be added soon.
This is the first noticeable update since the first announcement of the project, and it comes with some new features and changes:
๐๐จ๐ฏ๐๐ฅ๐ญ๐ข๐๐ฌ:
๐๐ข๐ฌ๐ค ๐๐ง๐ ๐ฌ๐ข๐ณ๐ ๐ ๐ฎ๐๐ซ๐๐ฌ: recording stops when free disk space falls below min_free_space / min_free_space_percent, or when the whole bag passes max_bag_size. Each stop is explained by an event written into the bag.
๐๐ข๐ฆ๐ฎ๐ฅ๐๐ญ๐ข๐จ๐ง ๐ญ๐ข๐ฆ๐: with use_sim_time, messages and schedules use the simulation clock, and the recorder waits for /clock before opening the bag.
๐๐๐ญ๐ญ๐๐ซ ๐ฅ๐จ๐ฌ๐ฌ ๐ซ๐๐ฉ๐จ๐ซ๐ญ๐ข๐ง๐ : losses are now broken down per topic in the status.
๐๐จ๐ซ๐ ๐ข๐ง ๐ญ๐ก๐ ๐ฌ๐ญ๐๐ญ๐ฎ๐ฌ: pending schedules are listed, and each file split is recorded as a timestamped event.
๐๐ฅ๐๐ฉ๐ฌ๐๐ ๐ญ๐ข๐ฆ๐ ๐ฌ๐ญ๐จ๐ฉ๐ฌ ๐๐จ๐ฎ๐ง๐ญ๐ข๐ง๐ ๐๐ญ ๐ ๐ฌ๐ญ๐จ๐ฉ, and the status is stamped with the recorders clock.
๐๐ก๐ ๐๐๐ฌ ๐ฅ๐๐ฎ๐ง๐๐ก ๐๐ข๐ฅ๐ ๐ง๐จ๐ฐ ๐ข๐ง๐๐ฅ๐ฎ๐๐๐ฌ ๐ญ๐ก๐ ๐ซ๐๐๐จ๐ซ๐๐๐ซ๐ฌ, so the two share their defaults.
I have also received some comments and private messages asking why I havenโt proposed this as a rosbag2 pull request. I would love to directly contribute to the ROS2 official package list, but I would like more feedback and discussion around the package and the features before even considering to do that.