I have datas in bag file such as velocity and acceleration from the sensors. I want to read data with respect to time domain to make calculations in Matlab. How can I gain the data and use in Matlab? Thanks for your answers.
If you play back the bag, you can use:
rostopic echo -p /topic_name
to display the data in a MatLab-friendly format. You can output this to a text file with:
rostopic echo -p /topic_name > data.txt
Or, you can even convert a topic directly to CSV with:
rostopic echo -b file.bag -p /topic
NOTE: This will only work with simple message types. LaserScans, PointClouds, arrays, etc won't work very well because the entire message is rendered to text.
The other option would be to use the rosbag API, located here to load the data into a C++ program and manipulate it that way.
Asked: 2011-09-27 08:21:02 -0500
Seen: 1,615 times
Last updated: Feb 04 '12
Change field's description on a chart plotted with rxbag, plotting dashed or dotted lines
How to get the time on bag file?
Rosbag record in unexisting folder [closed]
How to extract data from *.bag?
How to execute rgbdslam offline [closed]
displaying point cloud in rviz from .bag files, error
ROS Answers is licensed under Creative Commons Attribution 3.0 Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.