Ask Your Question
0

rosbag file cannot be made // .bag.active

asked 2012-07-29 22:32:53 -0500

allelujah-wang gravatar image

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

edit retag flag offensive close merge delete

Comments

The .bag.active file is big, about 3.5GB each round. I started the rosbag at the very beginning. @ Lorenz

allelujah-wang gravatar imageallelujah-wang ( 2012-07-29 22:55:31 -0500 )edit

And how did you stop it? Just by pressing Ctrl-C and waiting or by killing it (e.g. Ctrl-\, or closing the window)?

Lorenz gravatar imageLorenz ( 2012-07-30 10:30:03 -0500 )edit

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.

namanskumar gravatar imagenamanskumar ( 2016-09-22 00:47:55 -0500 )edit

3 Answers

Sort by » oldest newest most voted
1

answered 2012-07-29 22:47:41 -0500

Lorenz gravatar image

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.

edit flag offensive delete link more
9

answered 2015-11-14 04:02:14 -0500

Roger Yau gravatar image

updated 2015-11-14 04:03:26 -0500

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/Commandlin...

edit flag offensive delete link more

Comments

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.

namanskumar gravatar imagenamanskumar ( 2016-09-22 00:45:24 -0500 )edit

thanks, it really work!

jiashiwei gravatar imagejiashiwei ( 2017-03-24 01:33:00 -0500 )edit

Thanks, its worked for me!

cesarhcq gravatar imagecesarhcq ( 2019-06-30 17:29:41 -0500 )edit
2

answered 2012-09-15 14:08:28 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

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

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2012-07-29 22:32:53 -0500

Seen: 10,111 times

Last updated: Nov 14 '15