ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

It would be great if rosbag play had an option or it was possible to write a custom node to play the earliest message loaded into memory as soon as it loads: assuming rosbags are internally sorted chronologically rosbag play *.bag could scan just the timestamp of the first message of each bag and not have to parse the entire thing into memory (or even load the raw file into memory? Which part of loading is taking so long?), and then whichever bag has the earlier message it would continue to load it and publish messages out.

It could still handle interleaved messages across multiple bags with a little extra code.

It's worth trying out the code api http://wiki.ros.org/rosbag/Code%20API and seeing if the bag.open("test.bag", rosbag::bagmode::Read); takes a long time, if it does then more invasive surgery is required to only load in initial chunks of a bag and attempting to parse those.

Maybe short of that dramatically different api loading code the solution would be to reprocess all the bags into much smaller files (10-100MB?) that are guaranteed in order by file name, and have a custom rosbag api using node that only loads one at a time and plays it immediately while queuing up the next in the background. If the disk is slow then there might be a few hiccups in playback, but that is better than the super long load times. `