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

Error opening file written with rosbag?

asked 2014-01-13 17:15:29 -0500

mysteriousmonkey29 gravatar image

Hello, I'm trying to follow the following tutorial so that I can incorporate reading and writing bag files into a program I'm creating:

h t t p : / / w i k i . r o s . o r g / r o s b a g / C o d e % 2 0 A P I # c p p _ a p i

However, there seems to be something going wrong with the writing to the file. When I comment out the file reading section (because this part is causing errors upon compilation), and simply try to open the bag file written in a text editor, I get an error message, saying that the file cannot be read properly or something like that. If I ignore the error, the resulting document looks really weird and has strange symbols and red coloration and just looks very wrong (I'm just trying to write a string and a number).

Anyone know what's going wrong/how to fix it? (I think the error in the reading section is being caused by incorrect writing of the file in the first place)

edit retag flag offensive close merge delete

Comments

What exactly are you doing? What is the exact error message that you get? What would you expect differently? Are you aware that rosbag files are a custom format? http://wiki.ros.org/Support

dornhege gravatar image dornhege  ( 2014-01-13 22:46:03 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-01-14 06:51:55 -0500

ahendrix gravatar image

Compilation errors are not runtime errors, and will never be caused by a corrupt bag file. If you're having trouble compiling, there's a problem with your code or with one of the libraries.

Bag files are a binary format; they will not be readable in a standard text editor. You can read them with the rosbag command line tool, or using the rqt_bag GUI tool.

If you can post samples of your code and the compilation errors you're seeing, you'll get more specific answers.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2014-01-13 17:15:29 -0500

Seen: 3,426 times

Last updated: Jan 14 '14