ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
I looked over the rosbag code. There is function called startReadingVersion200 in bag.cpp that reads in chunk headers and connection index records. The chunk headers are spaced at 1MB interval in the file. So for a 30GB file you have 30000 chunks. I'm guessing that reading each chunk is causing a seek, so with a 5ms seek time reading the file would take around 2min. Which matches what I have seeing. This would explain why it loads quickly when reloading. Because the header don't take up that much space and are probably being buffered by the OS.
The load time could be improved if the chunk headers could be processed as they are encountered in the bag file. I'm not familiar with the bag format so I don't know how easy or hard that would be.