How to extract data from *.bag?
I recorded my odomerty and laser data using rosbag. I want to extract (specific) data stream(text format) from recorded bagfiles. (time, step, odometry[x,y,...], laser data, ...) Becuase my unfinshied project are programed by matlab.
Question.
- How to extract data from *.bag? (using matlab, C/C++ or ROS API...)
Originally posted by Changhyun Jun on ROS Answers with karma: 231 on 2011-02-16
Post score: 23
Original comments
Comment by mmwise on 2011-02-17:
when you see an answer you like, mark it as an accepted answer
Comment by RB on 2013-10-27:
Ok, is it possible to extract the contents of the bag file time, step, odometry[x,y..] and write our own customize code in cpp or java to move the robot through particular location of the map. Does we need to create the package with our customize code? How to combine all in built packages of ros and our own package?
Comment by mariakatosvich on 2016-09-09:
The script worked well for me, but I didn't test for a bunch of different bags. I'd imagine it wouldn't work if the bag contains data of a type that is not just a simple number
Comment by Ayush Sharma on 2017-03-12:
@changhyun, did you find the relevant solution? I am also trying to retrieve the odom data in terms of each step , data and all. The below "highlighted" answer is not giving me the required output. Did you find the solution? Kindly help