[Documentation] [TitleIndex] [WordIndex

Usage

The 1.1 bag format is the first format that was officially released. It is used by ROS releases in the 0.4.x line. It appears to have been in use in the repository since at least r2592.

Format

Following the version line, messages are written, one after the other:

#ROSRECORD V1.1<message 1><message 2>....<message N>

Each message has the following format:

<topic>
<md5sum>
<type>
<time_sec><time_nsec><length><data>

Note that the first 3 fields are newline-terminated. The last 4 fields, including data, are not newline-terminated.

Name

Description

Format

Length

topic

topic on which the message arrived

character string

variable length, newline-terminated

md5sum

md5sum for the message type

character string

variable length (should be 32 bytes), newline-terminated

type

message type

character string

variable length, newline-terminated

time_sec

time at which the message was received, integral seconds part

little-endian integer

4 bytes

time_nsec

time at which the message was received, integral nanoseconds part

little-endian integer

4 bytes

length

length, in bytes, of the data to follow

little-endian integer

4 bytes

data

serialized message data

ROS serialization format

length bytes

Example

A 1.1 bag file might start like this (showing the version string and two messages):

#ROSRECORD V1.1
/mechanism_state
2fc442e85b325b48a5c28bfff1aec3e8
robot_msgs/MechanismState
<binary data here, which can include any bytes, including nulls and newlines>/tf_message
bf97565a3af47c603375c0814456d7db
tf/tfMessage
<binary data here, which can include any bytes, including nulls and newlines>

2024-03-23 12:17