Repository Summary

Checkout URI https://github.com/ros2/rosbag2.git
VCS Type git
VCS Version humble
Last Updated 2025-05-12
Dev Status DEVELOPED
CI status No Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

README

rosbag2

License GitHub Action Status

Repository for implementing rosbag2 as described in its corresponding design article.

Installation instructions

Debian packages

rosbag2 packages are available via debian packages and thus can be installed via

$ export CHOOSE_ROS_DISTRO=crystal # rosbag2 is available starting from crystal
$ sudo apt-get install ros-$CHOOSE_ROS_DISTRO-ros2bag ros-$CHOOSE_ROS_DISTRO-rosbag2*

Note that the above command installs all packages related to rosbag2. This also includes the plugin for reading ROS1 bag files, which brings a hard dependency on the ros1_bridge with it and therefore ROS1 packages. If you want to install only the ROS2 related packages for rosbag, please use the following command:

$ export CHOOSE_ROS_DISTRO=crystal # rosbag2 is available starting from crystal
$ sudo apt-get install ros-$CHOOSE_ROS_DISTRO-ros2bag ros-$CHOOSE_ROS_DISTRO-rosbag2-transport

Build from source

It is recommended to create a new overlay workspace on top of your current ROS 2 installation.

$ mkdir -p ~/rosbag_ws/src
$ cd ~/rosbag_ws/src

Clone this repository into the source folder:

$ git clone https://github.com/ros2/rosbag2.git

[Note]: if you are only building rosbag2 on top of a Debian Installation of ROS2, please git clone the branch following your current ROS2 distribution.

Then build all the packages with this command:

$ colcon build [--merge-install]

The --merge-install flag is optional and installs all packages into one folder rather than isolated folders for each package.

Executing tests

The tests can be run using the following commands:

$ colcon test [--merge-install]
$ colcon test-result --verbose

The first command executes the test and the second command displays the errors (if any).

Using rosbag2

rosbag2 is part of the ROS 2 command line interfaces. This repo introduces a new verb called bag and thus serves as the entry point of using rosbag2. As of the time of writing, there are three commands available for ros2 bag:

  • record
  • play
  • info

Recording data

In order to record all topics currently available in the system:

$ ros2 bag record -a

The command above will record all available topics and discovers new topics as they appear while recording. This auto-discovery of new topics can be disabled by given the command line argument --no-discovery.

To record a set of predefined topics, one can specify them on the command line explicitly.

$ ros2 bag record <topic1> <topic2> … <topicN>

The specified topics don’t necessarily have to be present at start time. The discovery function will automatically recognize if one of the specified topics appeared. In the same fashion, this auto discovery can be disabled with --no-discovery.

If not further specified, ros2 bag record will create a new folder named to the current time stamp and stores all data within this folder. A user defined name can be given with -o, --output.

Simulation time

In ROS 2, “simulation time” refers to publishing a clock value on the /clock topic, instead of using the system clock to tell time. By passing --use-sim-time argument to ros2 bag record, we turn on this option for the recording node. Messages written to the bag will use the latest received value of /clock for the timestamp of the recorded message.

File truncated at 100 lines see the full file

CONTRIBUTING

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that license:

5. Submission of Contributions. Unless You explicitly state otherwise,
   any Contribution intentionally submitted for inclusion in the Work
   by You to the Licensor shall be under the terms and conditions of
   this License, without any additional terms or conditions.
   Notwithstanding the above, nothing herein shall supersede or modify
   the terms of any separate license agreement you may have executed
   with Licensor regarding such Contributions.

Contributors must sign-off each commit by adding a Signed-off-by: ... line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the Developer Certificate of Origin (DCO).

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that [license](http://www.apache.org/licenses/LICENSE-2.0.html): ~~~ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. ~~~ Contributors must sign-off each commit by adding a `Signed-off-by: ...` line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the [Developer Certificate of Origin (DCO)](https://developercertificate.org/).

Repository Summary

Checkout URI https://github.com/ros2/rosbag2.git
VCS Type git
VCS Version jazzy
Last Updated 2025-06-26
Dev Status DEVELOPED
CI status No Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

README

Rosbag2

License GitHub Action Status

Rosbag2 — the tool for recording and playback of communications in ROS 2 systems.

This is the ROS 2 successor of https://wiki.ros.org/rosbag.

A “rosbag” is simply a file full of timestamped messages. The first goal of the tool is efficient recording, to support complex systems in real time. Its second goal is efficent playback, to allow for viewing and using recorded data.

For historical context, see the original design article that kicked off the project.

This README has a lot of information. You may want to jump directly to:

Installation

Debian packages

Rosbag2 packages are available via debian packages, and will already be included with any -ros-base installation (which is included within -desktop)

$ export ROS_DISTRO=humble
$ sudo apt-get install ros-$ROS_DISTRO-rosbag2

Other binaries

You can follow the instructions at http://docs.ros.org/en/humble/Installation/Alternatives/Ubuntu-Install-Binary.html (or for your chosen distro), and Rosbag2 will be included in that installation.

Build from source

To build from source, follow the instructions in DEVELOPING.md

Using rosbag2

Rosbag2 is part of the ROS 2 command line interface as ros2 bag. These verbs are available for ros2 bag:

For up-to-date information on the available options for each, use ros2 bag <verb> --help.

Moreover, rosbag2_transport::Player and rosbag2_transport::Recorder components can be instantiated in rclcpp component containers, which makes possible to use intra-process communication for greater efficiency. See composition section for details.

Recording data

In order to record all topics currently available in the system:

$ ros2 bag record -a

The command above will record all available topics and discovers new topics as they appear while recording. This auto-discovery of new topics can be disabled by given the command line argument --no-discovery.

To record a set of predefined topics, one can specify them on the command line explicitly.

$ ros2 bag record <topic1> <topic2> … <topicN>

The specified topics don’t necessarily have to be present at start time. The discovery function will automatically recognize if one of the specified topics appeared. In the same fashion, this auto discovery can be disabled with --no-discovery.

If not further specified, ros2 bag record will create a new folder named to the current time stamp and stores all data within this folder. A user defined name can be given with -o, --output.

Simulation time

In ROS 2, “simulation time” refers to publishing a clock value on the /clock topic, instead of using the system clock to tell time. By passing --use-sim-time argument to ros2 bag record, we turn on this option for the recording node. Messages written to the bag will use the latest received value of /clock for the timestamp of the recorded message.

Note: Until the first /clock message is received, the recorder will not write any messages. Before that message is received, the time is 0, which leads to a significant time jump once simulation time begins, making the bag essentially unplayable if messages are written first with time 0 and then time N from /clock.

Splitting files during recording

Rosbag2 offers the capability to split bag files when they reach a maximum size or after a specified duration. By default Rosbag2 will record all data into a single bag file, but this can be changed using the CLI options.

Splitting by size: ros2 bag record -a -b 100000 will split the bag files when they become greater than 100 kilobytes. Note: the batch size’s units are in bytes and must be greater than 86016. This option defaults to 0, which means data is written to a single file.

Splitting by time: ros2 bag record -a -d 9000 will split the bag files after a duration of 9000 seconds. This option defaults to 0, which means data is written to a single file.

If both splitting by size and duration are enabled, the bag will split at whichever threshold is reached first.

Recording with compression

File truncated at 100 lines see the full file

CONTRIBUTING

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that license:

5. Submission of Contributions. Unless You explicitly state otherwise,
   any Contribution intentionally submitted for inclusion in the Work
   by You to the Licensor shall be under the terms and conditions of
   this License, without any additional terms or conditions.
   Notwithstanding the above, nothing herein shall supersede or modify
   the terms of any separate license agreement you may have executed
   with Licensor regarding such Contributions.

Contributors must sign-off each commit by adding a Signed-off-by: ... line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the Developer Certificate of Origin (DCO).

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that [license](http://www.apache.org/licenses/LICENSE-2.0.html): ~~~ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. ~~~ Contributors must sign-off each commit by adding a `Signed-off-by: ...` line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the [Developer Certificate of Origin (DCO)](https://developercertificate.org/).

Repository Summary

Checkout URI https://github.com/ros2/rosbag2.git
VCS Type git
VCS Version kilted
Last Updated 2025-06-26
Dev Status DEVELOPED
CI status No Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

README

Rosbag2

License GitHub Action Status

Rosbag2 — the tool for recording and playback of communications in ROS 2 systems.

This is the ROS 2 successor of https://wiki.ros.org/rosbag.

A “rosbag” is simply a file full of timestamped messages. The first goal of the tool is efficient recording, to support complex systems in real time. Its second goal is efficent playback, to allow for viewing and using recorded data.

For historical context, see the original design article that kicked off the project.

This README has a lot of information. You may want to jump directly to:

Installation

Debian packages

Rosbag2 packages are available via debian packages, and will already be included with any -ros-base installation (which is included within -desktop)

$ export ROS_DISTRO=humble
$ sudo apt-get install ros-$ROS_DISTRO-rosbag2

Other binaries

You can follow the instructions at http://docs.ros.org/en/humble/Installation/Alternatives/Ubuntu-Install-Binary.html (or for your chosen distro), and Rosbag2 will be included in that installation.

Build from source

To build from source, follow the instructions in DEVELOPING.md

Using rosbag2

Rosbag2 is part of the ROS 2 command line interface as ros2 bag. These verbs are available for ros2 bag:

For up-to-date information on the available options for each, use ros2 bag <verb> --help.

Moreover, rosbag2_transport::Player and rosbag2_transport::Recorder components can be instantiated in rclcpp component containers, which makes possible to use intra-process communication for greater efficiency. See composition section for details.

Recording data

In order to record all topics currently available in the system:

$ ros2 bag record -a

The command above will record all available topics and discovers new topics as they appear while recording. This auto-discovery of new topics can be disabled by given the command line argument --no-discovery.

To record a set of predefined topics, one can specify them on the command line explicitly.

$ ros2 bag record <topic1> <topic2> … <topicN>

The specified topics don’t necessarily have to be present at start time. The discovery function will automatically recognize if one of the specified topics appeared. In the same fashion, this auto discovery can be disabled with --no-discovery.

If not further specified, ros2 bag record will create a new folder named to the current time stamp and stores all data within this folder. A user defined name can be given with -o, --output.

Simulation time

In ROS 2, “simulation time” refers to publishing a clock value on the /clock topic, instead of using the system clock to tell time. By passing --use-sim-time argument to ros2 bag record, we turn on this option for the recording node. Messages written to the bag will use the latest received value of /clock for the timestamp of the recorded message.

Note: Until the first /clock message is received, the recorder will not write any messages. Before that message is received, the time is 0, which leads to a significant time jump once simulation time begins, making the bag essentially unplayable if messages are written first with time 0 and then time N from /clock.

Splitting files during recording

Rosbag2 offers the capability to split bag files when they reach a maximum size or after a specified duration. By default Rosbag2 will record all data into a single bag file, but this can be changed using the CLI options.

Splitting by size: ros2 bag record -a -b 100000 will split the bag files when they become greater than 100 kilobytes. Note: the batch size’s units are in bytes and must be greater than 86016. This option defaults to 0, which means data is written to a single file.

Splitting by time: ros2 bag record -a -d 9000 will split the bag files after a duration of 9000 seconds. This option defaults to 0, which means data is written to a single file.

If both splitting by size and duration are enabled, the bag will split at whichever threshold is reached first.

Recording with compression

File truncated at 100 lines see the full file

CONTRIBUTING

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that license:

5. Submission of Contributions. Unless You explicitly state otherwise,
   any Contribution intentionally submitted for inclusion in the Work
   by You to the Licensor shall be under the terms and conditions of
   this License, without any additional terms or conditions.
   Notwithstanding the above, nothing herein shall supersede or modify
   the terms of any separate license agreement you may have executed
   with Licensor regarding such Contributions.

Contributors must sign-off each commit by adding a Signed-off-by: ... line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the Developer Certificate of Origin (DCO).

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that [license](http://www.apache.org/licenses/LICENSE-2.0.html): ~~~ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. ~~~ Contributors must sign-off each commit by adding a `Signed-off-by: ...` line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the [Developer Certificate of Origin (DCO)](https://developercertificate.org/).

Repository Summary

Checkout URI https://github.com/ros2/rosbag2.git
VCS Type git
VCS Version rolling
Last Updated 2025-06-26
Dev Status DEVELOPED
CI status No Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

README

Rosbag2

License GitHub Action Status

Rosbag2 — the tool for recording and playback of communications in ROS 2 systems.

This is the ROS 2 successor of https://wiki.ros.org/rosbag.

A “rosbag” is simply a file full of timestamped messages. The first goal of the tool is efficient recording, to support complex systems in real time. Its second goal is efficent playback, to allow for viewing and using recorded data.

For historical context, see the original design article that kicked off the project.

This README has a lot of information. You may want to jump directly to:

Installation

Debian packages

Rosbag2 packages are available via debian packages, and will already be included with any -ros-base installation (which is included within -desktop)

$ export ROS_DISTRO=humble
$ sudo apt-get install ros-$ROS_DISTRO-rosbag2

Other binaries

You can follow the instructions at http://docs.ros.org/en/humble/Installation/Alternatives/Ubuntu-Install-Binary.html (or for your chosen distro), and Rosbag2 will be included in that installation.

Build from source

To build from source, follow the instructions in DEVELOPING.md

Using rosbag2

Rosbag2 is part of the ROS 2 command line interface as ros2 bag. These verbs are available for ros2 bag:

For up-to-date information on the available options for each, use ros2 bag <verb> --help.

Moreover, rosbag2_transport::Player and rosbag2_transport::Recorder components can be instantiated in rclcpp component containers, which makes possible to use intra-process communication for greater efficiency. See composition section for details.

Recording data

In order to record all topics currently available in the system:

$ ros2 bag record -a

The command above will record all available topics and discovers new topics as they appear while recording. This auto-discovery of new topics can be disabled by given the command line argument --no-discovery.

To record a set of predefined topics, one can specify them on the command line explicitly.

$ ros2 bag record <topic1> <topic2> … <topicN>

The specified topics don’t necessarily have to be present at start time. The discovery function will automatically recognize if one of the specified topics appeared. In the same fashion, this auto discovery can be disabled with --no-discovery.

If not further specified, ros2 bag record will create a new folder named to the current time stamp and stores all data within this folder. A user defined name can be given with -o, --output.

Simulation time

In ROS 2, “simulation time” refers to publishing a clock value on the /clock topic, instead of using the system clock to tell time. By passing --use-sim-time argument to ros2 bag record, we turn on this option for the recording node. Messages written to the bag will use the latest received value of /clock for the timestamp of the recorded message.

Note: Until the first /clock message is received, the recorder will not write any messages. Before that message is received, the time is 0, which leads to a significant time jump once simulation time begins, making the bag essentially unplayable if messages are written first with time 0 and then time N from /clock.

Splitting files during recording

Rosbag2 offers the capability to split bag files when they reach a maximum size or after a specified duration. By default Rosbag2 will record all data into a single bag file, but this can be changed using the CLI options.

Splitting by size: ros2 bag record -a -b 100000 will split the bag files when they become greater than 100 kilobytes. Note: the batch size’s units are in bytes and must be greater than 86016. This option defaults to 0, which means data is written to a single file.

Splitting by time: ros2 bag record -a -d 9000 will split the bag files after a duration of 9000 seconds. This option defaults to 0, which means data is written to a single file.

If both splitting by size and duration are enabled, the bag will split at whichever threshold is reached first.

Recording with compression

File truncated at 100 lines see the full file

CONTRIBUTING

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that license:

5. Submission of Contributions. Unless You explicitly state otherwise,
   any Contribution intentionally submitted for inclusion in the Work
   by You to the Licensor shall be under the terms and conditions of
   this License, without any additional terms or conditions.
   Notwithstanding the above, nothing herein shall supersede or modify
   the terms of any separate license agreement you may have executed
   with Licensor regarding such Contributions.

Contributors must sign-off each commit by adding a Signed-off-by: ... line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the Developer Certificate of Origin (DCO).

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that [license](http://www.apache.org/licenses/LICENSE-2.0.html): ~~~ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. ~~~ Contributors must sign-off each commit by adding a `Signed-off-by: ...` line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the [Developer Certificate of Origin (DCO)](https://developercertificate.org/).
Repo symbol

rosbag2 repository

Repo symbol

rosbag2 repository

Repository Summary

Checkout URI https://github.com/ros2/rosbag2.git
VCS Type git
VCS Version crystal
Last Updated 2019-04-08
Dev Status DEVELOPED
CI status No Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

README

rosbag2

THIS IS WORK IN PROGRESS AND SHOULD BE USED WITH CARE

Repository for implementing rosbag2 as described in its corresponding design article

Installation instructions

Debian packages

rosbag2 packages are available via debian packages and thus can be installed via

$ export CHOOSE_ROS_DISTRO=crystal # rosbag2 is available starting from crystal
$ sudo apt-get install ros-$CHOOSE_ROS_DISTRO-ros2bag* ros-$CHOOSE_ROS_DISTRO-rosbag2*

For other platforms than Linux, rosbag2 has to be built from source as it’s currently not part of the latest (ros2.repos file)[https://github.com/ros2/ros2/blob/master/ros2.repos].

Build from source

It is recommended to create a new overlay workspace on top of your current ROS 2 installation.

$ mkdir -p ~/rosbag_ws/src
$ cd ~/rosbag_ws/src

Clone this repository into the source folder:

$ git clone https://github.com/ros2/rosbag2.git

Then build all the packages with this command:

$ colcon build [--merge-install]

The --merge-install flag is optional and installs all packages into one folder rather than isolated folders for each package.

Executing tests

The tests can be run using the following commands:

$ colcon test [--merge-install]
$ colcon test-result --verbose

The first command executes the test and the second command displays the errors (if any).

Using rosbag2

rosbag2 is part of the ROS 2 command line interfaces. This repo introduces a new verb called bag and thus serves as the entry point of using rosbag2. As of the time of writing, there are three commands available for ros2 bag:

  • record
  • play
  • info

Recording data

In order to record all topics currently available in the system:

$ ros2 bag record -a

The command above will record all available topics and discovers new topics as they appear while recording. This auto-discovery of new topics can be disabled by given the command line argument --no-discovery.

To record a set of predefined topics, one can specify them on the command line explicitly.

$ ros2 bag record <topic1> <topic2> … <topicN>

The specified topics don’t necessarily have to be present at start time. The discovery function will automatically recognize if one of the specified topics appeared. In the same fashion, this auto discovery can be disabled with --no-discovery.

If not further specified, ros2 bag record will create a new folder named to the current time stamp and stores all data within this folder. A user defined name can be given with -o, --output.

Replaying data

After recording data, the next logical step is to replay this data:

$ ros2 bag play <bag_file>

The bag file is by default set to the folder name where the data was previously recorded in.

Analyzing data

The recorded data can be analyzed by displaying some meta information about it:

File truncated at 100 lines see the full file

CONTRIBUTING

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that license:

5. Submission of Contributions. Unless You explicitly state otherwise,
   any Contribution intentionally submitted for inclusion in the Work
   by You to the Licensor shall be under the terms and conditions of
   this License, without any additional terms or conditions.
   Notwithstanding the above, nothing herein shall supersede or modify
   the terms of any separate license agreement you may have executed
   with Licensor regarding such Contributions.
Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that [license](http://www.apache.org/licenses/LICENSE-2.0.html): ~~~ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. ~~~

Repository Summary

Checkout URI https://github.com/ros2/rosbag2.git
VCS Type git
VCS Version eloquent
Last Updated 2020-11-04
Dev Status DEVELOPED
CI status No Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

README

rosbag2

Repository for implementing rosbag2 as described in its corresponding design article.

Installation instructions

Debian packages

rosbag2 packages are available via debian packages and thus can be installed via

$ export CHOOSE_ROS_DISTRO=crystal # rosbag2 is available starting from crystal
$ sudo apt-get install ros-$CHOOSE_ROS_DISTRO-ros2bag* ros-$CHOOSE_ROS_DISTRO-rosbag2*

For other platforms than Linux, rosbag2 has to be built from source as it’s currently not part of the latest ros2.repos file.

Build from source

It is recommended to create a new overlay workspace on top of your current ROS 2 installation.

$ mkdir -p ~/rosbag_ws/src
$ cd ~/rosbag_ws/src

Clone this repository into the source folder:

$ git clone https://github.com/ros2/rosbag2.git

Then build all the packages with this command:

$ colcon build [--merge-install]

The --merge-install flag is optional and installs all packages into one folder rather than isolated folders for each package.

Executing tests

The tests can be run using the following commands:

$ colcon test [--merge-install]
$ colcon test-result --verbose

The first command executes the test and the second command displays the errors (if any).

Using rosbag2

rosbag2 is part of the ROS 2 command line interfaces. This repo introduces a new verb called bag and thus serves as the entry point of using rosbag2. As of the time of writing, there are three commands available for ros2 bag:

  • record
  • play
  • info

Recording data

In order to record all topics currently available in the system:

$ ros2 bag record -a

The command above will record all available topics and discovers new topics as they appear while recording. This auto-discovery of new topics can be disabled by given the command line argument --no-discovery.

To record a set of predefined topics, one can specify them on the command line explicitly.

$ ros2 bag record <topic1> <topic2> … <topicN>

The specified topics don’t necessarily have to be present at start time. The discovery function will automatically recognize if one of the specified topics appeared. In the same fashion, this auto discovery can be disabled with --no-discovery.

If not further specified, ros2 bag record will create a new folder named to the current time stamp and stores all data within this folder. A user defined name can be given with -o, --output.

Replaying data

After recording data, the next logical step is to replay this data:

$ ros2 bag play <bag_file>

The bag file is by default set to the folder name where the data was previously recorded in.

Analyzing data

The recorded data can be analyzed by displaying some meta information about it:

```

File truncated at 100 lines see the full file

CONTRIBUTING

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that license:

5. Submission of Contributions. Unless You explicitly state otherwise,
   any Contribution intentionally submitted for inclusion in the Work
   by You to the Licensor shall be under the terms and conditions of
   this License, without any additional terms or conditions.
   Notwithstanding the above, nothing herein shall supersede or modify
   the terms of any separate license agreement you may have executed
   with Licensor regarding such Contributions.
Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that [license](http://www.apache.org/licenses/LICENSE-2.0.html): ~~~ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. ~~~

Repository Summary

Checkout URI https://github.com/ros2/rosbag2.git
VCS Type git
VCS Version dashing
Last Updated 2020-10-29
Dev Status DEVELOPED
CI status No Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

README

rosbag2

Repository for implementing rosbag2 as described in its corresponding design article.

Installation instructions

Debian packages

rosbag2 packages are available via debian packages and thus can be installed via

$ export CHOOSE_ROS_DISTRO=crystal # rosbag2 is available starting from crystal
$ sudo apt-get install ros-$CHOOSE_ROS_DISTRO-ros2bag* ros-$CHOOSE_ROS_DISTRO-rosbag2*

For other platforms than Linux, rosbag2 has to be built from source as it’s currently not part of the latest ros2.repos file.

Build from source

It is recommended to create a new overlay workspace on top of your current ROS 2 installation.

$ mkdir -p ~/rosbag_ws/src
$ cd ~/rosbag_ws/src

Clone this repository into the source folder:

$ git clone https://github.com/ros2/rosbag2.git

Then build all the packages with this command:

$ colcon build [--merge-install]

The --merge-install flag is optional and installs all packages into one folder rather than isolated folders for each package.

Executing tests

The tests can be run using the following commands:

$ colcon test [--merge-install]
$ colcon test-result --verbose

The first command executes the test and the second command displays the errors (if any).

Using rosbag2

rosbag2 is part of the ROS 2 command line interfaces. This repo introduces a new verb called bag and thus serves as the entry point of using rosbag2. As of the time of writing, there are three commands available for ros2 bag:

  • record
  • play
  • info

Recording data

In order to record all topics currently available in the system:

$ ros2 bag record -a

The command above will record all available topics and discovers new topics as they appear while recording. This auto-discovery of new topics can be disabled by given the command line argument --no-discovery.

To record a set of predefined topics, one can specify them on the command line explicitly.

$ ros2 bag record <topic1> <topic2> … <topicN>

The specified topics don’t necessarily have to be present at start time. The discovery function will automatically recognize if one of the specified topics appeared. In the same fashion, this auto discovery can be disabled with --no-discovery.

If not further specified, ros2 bag record will create a new folder named to the current time stamp and stores all data within this folder. A user defined name can be given with -o, --output.

Replaying data

After recording data, the next logical step is to replay this data:

$ ros2 bag play <bag_file>

The bag file is by default set to the folder name where the data was previously recorded in.

Analyzing data

The recorded data can be analyzed by displaying some meta information about it:

```

File truncated at 100 lines see the full file

CONTRIBUTING

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that license:

5. Submission of Contributions. Unless You explicitly state otherwise,
   any Contribution intentionally submitted for inclusion in the Work
   by You to the Licensor shall be under the terms and conditions of
   this License, without any additional terms or conditions.
   Notwithstanding the above, nothing herein shall supersede or modify
   the terms of any separate license agreement you may have executed
   with Licensor regarding such Contributions.
Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that [license](http://www.apache.org/licenses/LICENSE-2.0.html): ~~~ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. ~~~

Repository Summary

Checkout URI https://github.com/ros2/rosbag2.git
VCS Type git
VCS Version galactic
Last Updated 2022-09-29
Dev Status DEVELOPED
CI status No Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

README

rosbag2

License GitHub Action Status

Repository for implementing rosbag2 as described in its corresponding design article.

Installation instructions

Debian packages

rosbag2 packages are available via debian packages and thus can be installed via

$ export CHOOSE_ROS_DISTRO=crystal # rosbag2 is available starting from crystal
$ sudo apt-get install ros-$CHOOSE_ROS_DISTRO-ros2bag ros-$CHOOSE_ROS_DISTRO-rosbag2*

Note that the above command installs all packages related to rosbag2. This also includes the plugin for reading ROS1 bag files, which brings a hard dependency on the ros1_bridge with it and therefore ROS1 packages. If you want to install only the ROS2 related packages for rosbag, please use the following command:

$ export CHOOSE_ROS_DISTRO=crystal # rosbag2 is available starting from crystal
$ sudo apt-get install ros-$CHOOSE_ROS_DISTRO-ros2bag ros-$CHOOSE_ROS_DISTRO-rosbag2-transport

Build from source

It is recommended to create a new overlay workspace on top of your current ROS 2 installation.

$ mkdir -p ~/rosbag_ws/src
$ cd ~/rosbag_ws/src

Clone this repository into the source folder:

$ git clone https://github.com/ros2/rosbag2.git

[Note]: if you are only building rosbag2 on top of a Debian Installation of ROS2, please git clone the branch following your current ROS2 distribution.

Then build all the packages with this command:

$ colcon build [--merge-install]

The --merge-install flag is optional and installs all packages into one folder rather than isolated folders for each package.

Executing tests

The tests can be run using the following commands:

$ colcon test [--merge-install]
$ colcon test-result --verbose

The first command executes the test and the second command displays the errors (if any).

Using rosbag2

rosbag2 is part of the ROS 2 command line interfaces. This repo introduces a new verb called bag and thus serves as the entry point of using rosbag2. As of the time of writing, there are three commands available for ros2 bag:

  • record
  • play
  • info

Recording data

In order to record all topics currently available in the system:

$ ros2 bag record -a

The command above will record all available topics and discovers new topics as they appear while recording. This auto-discovery of new topics can be disabled by given the command line argument --no-discovery.

To record a set of predefined topics, one can specify them on the command line explicitly.

$ ros2 bag record <topic1> <topic2> … <topicN>

The specified topics don’t necessarily have to be present at start time. The discovery function will automatically recognize if one of the specified topics appeared. In the same fashion, this auto discovery can be disabled with --no-discovery.

If not further specified, ros2 bag record will create a new folder named to the current time stamp and stores all data within this folder. A user defined name can be given with -o, --output.

Splitting recorded bag files

rosbag2 offers the capability to split bag files when they reach a maximum size or after a specified duration. By default rosbag2 will record all data into a single bag file, but this can be changed using the CLI options.

Splitting by size: ros2 bag record -a -b 100000 will split the bag files when they become greater than 100 kilobytes. Note: the batch size’s units are in bytes and must be greater than 86016. This option defaults to 0, which means data is written to a single file.

File truncated at 100 lines see the full file

CONTRIBUTING

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that license:

5. Submission of Contributions. Unless You explicitly state otherwise,
   any Contribution intentionally submitted for inclusion in the Work
   by You to the Licensor shall be under the terms and conditions of
   this License, without any additional terms or conditions.
   Notwithstanding the above, nothing herein shall supersede or modify
   the terms of any separate license agreement you may have executed
   with Licensor regarding such Contributions.

Contributors must sign-off each commit by adding a Signed-off-by: ... line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the Developer Certificate of Origin (DCO).

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that [license](http://www.apache.org/licenses/LICENSE-2.0.html): ~~~ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. ~~~ Contributors must sign-off each commit by adding a `Signed-off-by: ...` line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the [Developer Certificate of Origin (DCO)](https://developercertificate.org/).

Repository Summary

Checkout URI https://github.com/ros2/rosbag2.git
VCS Type git
VCS Version foxy
Last Updated 2023-05-31
Dev Status DEVELOPED
CI status No Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

README

rosbag2

License GitHub Action Status

Repository for implementing rosbag2 as described in its corresponding design article.

[Note] This branch contains the official binary release of rosbag2 for ROS 2 Foxy. The code here is what you get from the APT repositories.

There is an alternate supported branch foxy-future that contains a version much closer to Galactic, including extensive performance improvements and some features, with modifications to build against the ROS 2 Foxy core. Not all of the improvements could be backported into the binary release without breaking API/ABI, so users who want these improvements can build that branch from source into their application - please see the README on the foxy-future branch for further information.

Installation instructions

Debian packages

rosbag2 packages are available via debian packages and thus can be installed via

$ export CHOOSE_ROS_DISTRO=crystal # rosbag2 is available starting from crystal
$ sudo apt-get install ros-$CHOOSE_ROS_DISTRO-ros2bag ros-$CHOOSE_ROS_DISTRO-rosbag2*

Note that the above command installs all packages related to rosbag2. This also includes the plugin for reading ROS1 bag files, which brings a hard dependency on the ros1_bridge with it and therefore ROS1 packages. If you want to install only the ROS2 related packages for rosbag, please use the following command:

$ export CHOOSE_ROS_DISTRO=crystal # rosbag2 is available starting from crystal
$ sudo apt-get install ros-$CHOOSE_ROS_DISTRO-ros2bag ros-$CHOOSE_ROS_DISTRO-rosbag2-transport

Build from source

It is recommended to create a new overlay workspace on top of your current ROS 2 installation.

$ mkdir -p ~/rosbag_ws/src
$ cd ~/rosbag_ws/src

Clone this repository into the source folder:

$ git clone https://github.com/ros2/rosbag2.git

[Note]: if you are only building rosbag2 on top of a Debian Installation of ROS2, please git clone the branch following your current ROS2 distribution.

Then build all the packages with this command:

$ colcon build [--merge-install]

The --merge-install flag is optional and installs all packages into one folder rather than isolated folders for each package.

Executing tests

The tests can be run using the following commands:

$ colcon test [--merge-install]
$ colcon test-result --verbose

The first command executes the test and the second command displays the errors (if any).

Using rosbag2

rosbag2 is part of the ROS 2 command line interfaces. This repo introduces a new verb called bag and thus serves as the entry point of using rosbag2. As of the time of writing, there are three commands available for ros2 bag:

  • record
  • play
  • info

Recording data

In order to record all topics currently available in the system:

$ ros2 bag record -a

The command above will record all available topics and discovers new topics as they appear while recording. This auto-discovery of new topics can be disabled by given the command line argument --no-discovery.

To record a set of predefined topics, one can specify them on the command line explicitly.

$ ros2 bag record <topic1> <topic2> … <topicN>

The specified topics don’t necessarily have to be present at start time. The discovery function will automatically recognize if one of the specified topics appeared. In the same fashion, this auto discovery can be disabled with --no-discovery.

If not further specified, ros2 bag record will create a new folder named to the current time stamp and stores all data within this folder. A user defined name can be given with -o, --output.

File truncated at 100 lines see the full file

CONTRIBUTING

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that license:

5. Submission of Contributions. Unless You explicitly state otherwise,
   any Contribution intentionally submitted for inclusion in the Work
   by You to the Licensor shall be under the terms and conditions of
   this License, without any additional terms or conditions.
   Notwithstanding the above, nothing herein shall supersede or modify
   the terms of any separate license agreement you may have executed
   with Licensor regarding such Contributions.
Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that [license](http://www.apache.org/licenses/LICENSE-2.0.html): ~~~ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. ~~~

Repository Summary

Checkout URI https://github.com/ros2/rosbag2.git
VCS Type git
VCS Version iron
Last Updated 2024-11-11
Dev Status DEVELOPED
CI status No Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

README

rosbag2

License GitHub Action Status

Repository for implementing rosbag2 as described in its corresponding design article.

Installation instructions

Debian packages

rosbag2 packages are available via debian packages and thus can be installed via

$ export CHOOSE_ROS_DISTRO=crystal # rosbag2 is available starting from crystal
$ sudo apt-get install ros-$CHOOSE_ROS_DISTRO-ros2bag ros-$CHOOSE_ROS_DISTRO-rosbag2*

Note that the above command installs all packages related to rosbag2. This also includes the plugin for reading ROS1 bag files, which brings a hard dependency on the ros1_bridge with it and therefore ROS1 packages. If you want to install only the ROS2 related packages for rosbag, please use the following command:

$ export CHOOSE_ROS_DISTRO=crystal # rosbag2 is available starting from crystal
$ sudo apt-get install ros-$CHOOSE_ROS_DISTRO-ros2bag ros-$CHOOSE_ROS_DISTRO-rosbag2-transport

Build from source

It is recommended to create a new overlay workspace on top of your current ROS 2 installation.

$ mkdir -p ~/rosbag_ws/src
$ cd ~/rosbag_ws/src

Clone this repository into the source folder:

$ git clone https://github.com/ros2/rosbag2.git

[Note]: if you are only building rosbag2 on top of a Debian Installation of ROS2, please git clone the branch following your current ROS2 distribution.

Then build all the packages with this command:

$ colcon build [--merge-install]

The --merge-install flag is optional and installs all packages into one folder rather than isolated folders for each package.

Executing tests

The tests can be run using the following commands:

$ colcon test [--merge-install]
$ colcon test-result --verbose

The first command executes the test and the second command displays the errors (if any).

Using rosbag2

rosbag2 is part of the ROS 2 command line interfaces. This repo introduces a new verb called bag and thus serves as the entry point of using rosbag2. As of the time of writing, there are three commands available for ros2 bag:

  • record
  • play
  • info

Recording data

In order to record all topics currently available in the system:

$ ros2 bag record -a

The command above will record all available topics and discovers new topics as they appear while recording. This auto-discovery of new topics can be disabled by given the command line argument --no-discovery.

To record a set of predefined topics, one can specify them on the command line explicitly.

$ ros2 bag record <topic1> <topic2> … <topicN>

The specified topics don’t necessarily have to be present at start time. The discovery function will automatically recognize if one of the specified topics appeared. In the same fashion, this auto discovery can be disabled with --no-discovery.

If not further specified, ros2 bag record will create a new folder named to the current time stamp and stores all data within this folder. A user defined name can be given with -o, --output.

Simulation time

In ROS 2, “simulation time” refers to publishing a clock value on the /clock topic, instead of using the system clock to tell time. By passing --use-sim-time argument to ros2 bag record, we turn on this option for the recording node. Messages written to the bag will use the latest received value of /clock for the timestamp of the recorded message.

File truncated at 100 lines see the full file

CONTRIBUTING

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that license:

5. Submission of Contributions. Unless You explicitly state otherwise,
   any Contribution intentionally submitted for inclusion in the Work
   by You to the Licensor shall be under the terms and conditions of
   this License, without any additional terms or conditions.
   Notwithstanding the above, nothing herein shall supersede or modify
   the terms of any separate license agreement you may have executed
   with Licensor regarding such Contributions.

Contributors must sign-off each commit by adding a Signed-off-by: ... line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the Developer Certificate of Origin (DCO).

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that [license](http://www.apache.org/licenses/LICENSE-2.0.html): ~~~ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. ~~~ Contributors must sign-off each commit by adding a `Signed-off-by: ...` line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the [Developer Certificate of Origin (DCO)](https://developercertificate.org/).
Repo symbol

rosbag2 repository

Repo symbol

rosbag2 repository

Repo symbol

rosbag2 repository

Repo symbol

rosbag2 repository

Repo symbol

rosbag2 repository

Repo symbol

rosbag2 repository

Repo symbol

rosbag2 repository