rosbag

rosbag is the original ROS 1 tool and file format for recording and replaying a robot's timestamped message streams, stored as .bag files. It is the predecessor to rosbag2, the ROS 2 recording framework, which writes to storage formats like MCAP or SQLite3.

What is rosbag?

rosbag is how robots running ROS (the Robot Operating System) save what their sensors and software produce. It records the messages flowing across a robot's topics, LiDAR scans, camera frames, transforms, and control commands, into a single timestamped log you can replay later to debug, analyze, or build datasets.
The term has three meanings people routinely run together. rosbag is the ROS 1 tool and its .bag file format. rosbag2 is its ROS 2 successor, a recording framework that is storage-agnostic rather than a single format. MCAP is one of the file formats rosbag2 can write to, and the current default. Keeping the tool separate from the format is the key to the whole picture.

Key takeaways

  • rosbag is the ROS 1 recording tool and the .bag file format, the way a robot logs its message streams.
  • rosbag2 is the ROS 2 successor, a storage-agnostic framework, not a single file format, that records to MCAP or SQLite3.
  • MCAP is a file format, not a tool, and is the default storage backend for rosbag2 since the ROS 2 Iron release.

What rosbag provides

How rosbag, rosbag2, and MCAP relate, and why they are not interchangeable.
How rosbag, rosbag2, and MCAP relate, and why they are not interchangeable.
TermWhat it isLevel
rosbagThe ROS 1 tool and .bag file format for recording message streamsROS 1, end of life
rosbag2The ROS 2 recording framework, storage-plugin based, not a single formatA tool, writes .mcap or .db3
MCAPAn open, general-purpose container format for timestamped multi-stream dataA format, the rosbag2 default, also used outside ROS

How it works

rosbag records the topics and messages flowing through a running ROS system into a single .bag file with its own index, and its defining feature is faithful playback, replaying a log as if the robot were live. The original rosbag is tied to ROS 1, which reached end of life in 2025, so new work uses rosbag2, which reads and helps convert older .bag data and adds the pluggable storage that brought in MCAP.

Why it matters

rosbag is where most robotics data starts its life, the raw recording that later becomes training and evaluation data for physical AI. The most common and costly confusion in this space is treating rosbag2 and MCAP as competing choices, when one is a tool and the other is a format it writes. "Should we use rosbag2 or MCAP" is a category error, because you use rosbag2 to record, and MCAP is the format it records into by default. The real decisions are which ROS version you are on, ROS 1's rosbag or ROS 2's rosbag2, and which storage backend rosbag2 should use, MCAP or SQLite3. Getting that hierarchy right is what lets a team reason clearly about its own recordings.

Frequently asked questions

What is the difference between rosbag and rosbag2?

rosbag is the ROS 1 tool and .bag format. rosbag2 is its ROS 2 successor, a storage-agnostic recording framework that writes to formats like MCAP or SQLite3.

Is rosbag2 the same as MCAP?

No. rosbag2 is a recording tool, MCAP is a file format it can write to. MCAP is also used entirely outside ROS.

What format does rosbag2 use by default?

MCAP, since the ROS 2 Iron release in 2023, with SQLite3 (.db3) still fully supported.

Can rosbag2 read old ROS 1 .bag files?

Yes, with conversion tooling, which is part of the ROS 1 to ROS 2 migration path.

Related terms

Last updated July 9, 2026

Building visual or physical AI?

Let's talk.