0
$\begingroup$

Rosanswers logo

Hello, guys! When I was using the rosbag tool to record the real data for our robot, I used the command : rosbag record -a when the whole mission was accomplished, there was no .bag file made in that folder. Instead, there was a .bag.active file was made in that folder. However, when I want to replay the data, the "rosbag play " command cannot read the .bag.active file, which made it impossible to analysis the data. I cannot find a proper answer from the pages, so I hope you guys can help me. THX


Originally posted by allelujah-wang on ROS Answers with karma: 5 on 2012-07-29

Post score: 0


Original comments

Comment by allelujah-wang on 2012-07-29:
The .bag.active file is big, about 3.5GB each round. I started the rosbag at the very beginning. @ Lorenz

Comment by Lorenz on 2012-07-30:
And how did you stop it? Just by pressing Ctrl-C and waiting or by killing it (e.g. Ctrl-, or closing the window)?

Comment by namanskumar on 2016-09-22:
I have the same issue. The mistake committed was that I closed the bag file using Ctrl+Z, instead of closing the bag file using Ctrl+C.

$\endgroup$

3 Answers 3

0
$\begingroup$

Rosanswers logo

I guess the rosbag process didn't shut down cleanly at the end. After recording, it might need to write an index so it must shut down cleanly.

How did you start rosbag? If you were using roslaunch and the bag file is big, it might happen that roslaunch kills rosbag after 10 seconds.


Originally posted by Lorenz with karma: 22731 on 2012-07-29

This answer was ACCEPTED on the original site

Post score: -2


Original comments

Comment by Marcel Usai on 2020-02-07:
Why is this answer accepted? It does not answer the question!

$\endgroup$
0
$\begingroup$

Rosanswers logo

You may need to use rosbag fix or rosbag reindex to fix the bagfile if it shutdown while recording.


Originally posted by tfoote with karma: 58457 on 2012-09-15

This answer was NOT ACCEPTED on the original site

Post score: 4

$\endgroup$
0
$\begingroup$

Rosanswers logo

If a bag was not closed cleanly, then the index information may be corrupted. Two steps are needed to repair the bag:

$ rosbag reindex *.bag.active

$ rosbag fix *.bag.active repaired.bag

http://wiki.ros.org/rosbag/Commandline#reindex


Originally posted by Roger Yau with karma: 211 on 2015-11-14

This answer was NOT ACCEPTED on the original site

Post score: 21


Original comments

Comment by namanskumar on 2016-09-22:
I tried repairing the bag as suggested and converted it to txt file using the following command

      rostopic echo –b file.bag /rostopic> filename2.txt

The filename2.txt file is empty without any data inside it.

Found repaired.bag is not having any data inside it.

Comment by jiashiwei on 2017-03-24:
thanks, it really work!

Comment by cesarhcq on 2019-06-30:
Thanks, its worked for me!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.