Repository Summary
Description | |
Checkout URI | https://github.com/ros2/rosbag2.git |
VCS Type | git |
VCS Version | humble |
Last Updated | 2025-08-09 |
Dev Status | DEVELOPED |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
Name | Version |
---|---|
mcap_vendor | 0.15.15 |
ros2bag | 0.15.15 |
rosbag2 | 0.15.15 |
rosbag2_compression | 0.15.15 |
rosbag2_compression_zstd | 0.15.15 |
rosbag2_cpp | 0.15.15 |
rosbag2_interfaces | 0.15.15 |
rosbag2_performance_benchmarking | 0.15.15 |
rosbag2_py | 0.15.15 |
rosbag2_storage | 0.15.15 |
rosbag2_storage_default_plugins | 0.15.15 |
rosbag2_storage_mcap | 0.15.15 |
rosbag2_storage_mcap_testdata | 0.15.15 |
rosbag2_test_common | 0.15.15 |
rosbag2_tests | 0.15.15 |
rosbag2_transport | 0.15.15 |
shared_queues_vendor | 0.15.15 |
sqlite3_vendor | 0.15.15 |
zstd_vendor | 0.15.15 |
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*
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).
Repository Summary
Description | |
Checkout URI | https://github.com/ros2/rosbag2.git |
VCS Type | git |
VCS Version | jazzy |
Last Updated | 2025-08-14 |
Dev Status | DEVELOPED |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
Name | Version |
---|---|
liblz4_vendor | 0.26.9 |
mcap_vendor | 0.26.9 |
ros2bag | 0.26.9 |
rosbag2 | 0.26.9 |
rosbag2_compression | 0.26.9 |
rosbag2_compression_zstd | 0.26.9 |
rosbag2_cpp | 0.26.9 |
rosbag2_examples_cpp | 0.26.9 |
rosbag2_examples_py | 0.26.9 |
rosbag2_interfaces | 0.26.9 |
rosbag2_performance_benchmarking | 0.26.9 |
rosbag2_performance_benchmarking_msgs | 0.26.9 |
rosbag2_py | 0.26.9 |
rosbag2_storage | 0.26.9 |
rosbag2_storage_default_plugins | 0.26.9 |
rosbag2_storage_mcap | 0.26.9 |
rosbag2_storage_sqlite3 | 0.26.9 |
rosbag2_test_common | 0.26.9 |
rosbag2_test_msgdefs | 0.26.9 |
rosbag2_tests | 0.26.9 |
rosbag2_transport | 0.26.9 |
shared_queues_vendor | 0.26.9 |
sqlite3_vendor | 0.26.9 |
zstd_vendor | 0.26.9 |
README
Rosbag2
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
:
ros2 bag burst
ros2 bag convert
ros2 bag info
ros2 bag list
ros2 bag play
ros2 bag record
ros2 bag reindex
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).
Repository Summary
Description | |
Checkout URI | https://github.com/ros2/rosbag2.git |
VCS Type | git |
VCS Version | kilted |
Last Updated | 2025-08-11 |
Dev Status | DEVELOPED |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
Name | Version |
---|---|
liblz4_vendor | 0.32.0 |
mcap_vendor | 0.32.0 |
ros2bag | 0.32.0 |
rosbag2 | 0.32.0 |
rosbag2_compression | 0.32.0 |
rosbag2_compression_zstd | 0.32.0 |
rosbag2_cpp | 0.32.0 |
rosbag2_examples_cpp | 0.32.0 |
rosbag2_examples_py | 0.32.0 |
rosbag2_interfaces | 0.32.0 |
rosbag2_performance_benchmarking | 0.32.0 |
rosbag2_performance_benchmarking_msgs | 0.32.0 |
rosbag2_py | 0.32.0 |
rosbag2_storage | 0.32.0 |
rosbag2_storage_default_plugins | 0.32.0 |
rosbag2_storage_mcap | 0.32.0 |
rosbag2_storage_sqlite3 | 0.32.0 |
rosbag2_test_common | 0.32.0 |
rosbag2_test_msgdefs | 0.32.0 |
rosbag2_tests | 0.32.0 |
rosbag2_transport | 0.32.0 |
sqlite3_vendor | 0.32.0 |
zstd_vendor | 0.32.0 |
README
Rosbag2
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
:
ros2 bag burst
ros2 bag convert
ros2 bag info
ros2 bag list
ros2 bag play
ros2 bag record
ros2 bag reindex
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).
Repository Summary
Description | |
Checkout URI | https://github.com/ros2/rosbag2.git |
VCS Type | git |
VCS Version | rolling |
Last Updated | 2025-08-14 |
Dev Status | DEVELOPED |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
Name | Version |
---|---|
liblz4_vendor | 0.33.0 |
mcap_vendor | 0.33.0 |
ros2bag | 0.33.0 |
rosbag2 | 0.33.0 |
rosbag2_compression | 0.33.0 |
rosbag2_compression_zstd | 0.33.0 |
rosbag2_cpp | 0.33.0 |
rosbag2_examples_cpp | 0.33.0 |
rosbag2_examples_py | 0.33.0 |
rosbag2_interfaces | 0.33.0 |
rosbag2_performance_benchmarking | 0.33.0 |
rosbag2_performance_benchmarking_msgs | 0.33.0 |
rosbag2_py | 0.33.0 |
rosbag2_storage | 0.33.0 |
rosbag2_storage_default_plugins | 0.33.0 |
rosbag2_storage_mcap | 0.33.0 |
rosbag2_storage_sqlite3 | 0.33.0 |
rosbag2_test_common | 0.33.0 |
rosbag2_test_msgdefs | 0.33.0 |
rosbag2_tests | 0.33.0 |
rosbag2_transport | 0.33.0 |
sqlite3_vendor | 0.33.0 |
zstd_vendor | 0.33.0 |
README
Rosbag2
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
:
ros2 bag burst
ros2 bag convert
ros2 bag info
ros2 bag list
ros2 bag play
ros2 bag record
ros2 bag reindex
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).
Repository Summary
Description | |
Checkout URI | https://github.com/ros2/rosbag2.git |
VCS Type | git |
VCS Version | galactic |
Last Updated | 2022-09-29 |
Dev Status | DEVELOPED |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
Name | Version |
---|---|
ros2bag | 0.9.2 |
rosbag2 | 0.9.2 |
rosbag2_compression | 0.9.2 |
rosbag2_compression_zstd | 0.9.2 |
rosbag2_cpp | 0.9.2 |
rosbag2_interfaces | 0.9.2 |
rosbag2_performance_benchmarking | 0.9.2 |
rosbag2_py | 0.9.2 |
bag_recorder_nodes | 0.0.0 |
rosbag2_storage | 0.9.2 |
rosbag2_storage_default_plugins | 0.9.2 |
rosbag2_test_common | 0.9.2 |
rosbag2_tests | 0.9.2 |
rosbag2_transport | 0.9.2 |
shared_queues_vendor | 0.9.2 |
sqlite3_vendor | 0.9.2 |
zstd_vendor | 0.9.2 |
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*
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).
Repository Summary
Description | |
Checkout URI | https://github.com/ros2/rosbag2.git |
VCS Type | git |
VCS Version | iron |
Last Updated | 2024-11-11 |
Dev Status | DEVELOPED |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
Name | Version |
---|---|
mcap_vendor | 0.22.8 |
ros2bag | 0.22.8 |
rosbag2 | 0.22.8 |
rosbag2_compression | 0.22.8 |
rosbag2_compression_zstd | 0.22.8 |
rosbag2_cpp | 0.22.8 |
rosbag2_examples_cpp | 0.22.8 |
rosbag2_examples_py | 0.22.8 |
rosbag2_interfaces | 0.22.8 |
rosbag2_performance_benchmarking | 0.22.8 |
rosbag2_performance_benchmarking_msgs | 0.22.8 |
rosbag2_py | 0.22.8 |
rosbag2_storage | 0.22.8 |
rosbag2_storage_default_plugins | 0.22.8 |
rosbag2_storage_mcap | 0.22.8 |
rosbag2_storage_sqlite3 | 0.22.8 |
rosbag2_test_common | 0.22.8 |
rosbag2_test_msgdefs | 0.22.8 |
rosbag2_tests | 0.22.8 |
rosbag2_transport | 0.22.8 |
shared_queues_vendor | 0.22.8 |
sqlite3_vendor | 0.22.8 |
zstd_vendor | 0.22.8 |
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*
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).