First, see the Installation Instructions at the top of the file: ros_readbagfile.py.
See help menu:
ros_readbagfile -h
Basic usage:
ros_readbagfile <mybagfile.bag> [topic1] [topic2] [topic3] [...topicN]
For a tutorial demonstration, see my ROS tutorial I wrote here: Reading messages from a bag file.
In short:
- Download a 730 MB
demo.bag
file:wget https://open-source-webviz-ui.s3.amazonaws.com/demo.bag
- Now, read a couple topics from this file and store them into a
topics.yaml
file:time ros_readbagfile demo.bag /obs1/gps/fix /diagnostics_agg | tee topics.yaml
Done! Here is a sample topics.yaml
output file obtained by running the commands above: ros_readbagfile_sample_output/topics.yaml.