Record and replay Bag files in ROS - AUV-IITK/AUVWiki GitHub Wiki
Maintainers:Suryansh Agarwal, Akash Kumar Singh
- Make a directory for storing the bag files
mkdir ~/bagfiles - Move into the directory
cd ~/bagfiles
- Run the command
rosbag record -a. - A bag file will be created with a name that begins with the year, date, and time and the suffix .bag.
- We can get details about the bag file by the command
rosbag info <bag file>.This will give information about the topics and the number of messages recorded.
- Run the command
rosbag record -O subset /topic1 /topic2 - This will record all the data published on the
topic1andtopic2and save it insubset.bag
Now for playing back the rosbag file run rosbag play <your bagfile>
NOTE: All the data recorded will be published on the specified topic.
For tutorials, click here