What is a bag file?

A bag file is a container of messages sent by topics that were recorded during a session using a robot or nodes. In brief, they are the log files for the messages transferred during the execution of our system, and they allow us to play back everything, even with time delays, since all messages are recorded with a timestamp-not only the timestamp in the header, but also for the packets contained within the bag file. The difference between the timestamp used to record and the one in the header is that the first one is set once the message is recorded, while the other is set by the producer/publisher of the message.

The data stored in a bag file is in the binary format. The particular structure of this container allows for extremely fast recording throughput, which is the most important concern when saving data. Additionally, the size of the bag file is relevant, but usually at the expense of speed. Nonetheless, we have the option to compress the file on the fly with the bz2 algorithm; just use the -j parameter when you record with rosbag record.

Every message is recorded along with the topic that published it. Therefore, we can specify which topics to record or we can record them all (with -a). Later, when we play the bag file back, we can also select a particular subset of the topics contained in the bag file by indicating the name of the topics we want to publish.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.136.154.103