Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 475

Reindex .bag using rosbag API

$
0
0
Hello to everyone, I am trying to reindex a file using rosbag API in a Python script. When running `rosbag reindex <.bag file>` in the command line, everything goes as usual (it creates a backup of the .bag file with the extension *.orig.bag*), and also creates the reindexed .bag file with the original name. Now, in my Python code, I am going with the following: import rosbag #Reindex the .bag file with rosbag.Bag('example.bag', 'w') as inbag: inbag.reindex() print "Reindexing..." It does not work. Instead of giving the same result than the command line, it just take the input .bag file (in my case originally around 500MB), and it "resets" the file, reducing the weight to 4kB. After that, it doesn´t make anything else. Is there anything missing that I am maybe forgetting to include in the script? According to the rosbag API, `reindex(self)` doesn´t required anything more. Thank you.

Viewing all articles
Browse latest Browse all 475

Trending Articles