Skip to content

Commit 545402c

Browse files
author
Jakub Lenner
committed
added page for converting ROS2 to ROS1 bag for the Kalibr
1 parent 8cbb8e4 commit 545402c

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Converting from ROS2 bag file to ROS1 bag file
2+
3+
Good tool for this is the `rosags-convert` utility.
4+
5+
1. install rosbags package
6+
7+
```bash
8+
pip install rosbags
9+
```
10+
11+
2. Now you can convert the bag. Example:
12+
13+
```bash
14+
rosbags-convert /rosbag2_2025_11_05-14_01_53/
15+
```
16+
17+
This directory should contain `metadata,yaml` file. For this concrete example, the output should be in the file `rosbag2_2025_11_05-14_01_53.bag`.
18+
19+
If you are getting error like this:
20+
21+
```bash
22+
ERROR: Reading source bag: Rosbag2 version 9 not supported; please report issue.
23+
```
24+
25+
simply open the `/rosbag2_<timestamp>/metadata.yaml` file and lower the version number at the beginning of the file.
26+
27+
```yaml
28+
rosbag2_bagfile_information:
29+
version: 9
30+
```
31+
32+
In our case, just lowering it from `9` to `8` helped. This does not feel very correct, but if it works...

docs/90-software/kalibr.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ The Kalibr docker image is sourced from the `ctumrs` [dockerhub](https://hub.doc
1818

1919
## Howto
2020

21+
0. If you have bag file from ROS2, you need to first [convert it to the ROS1 bag format](../120-miscellaneous/bagfile_convert_ros1_ros2.md)
22+
23+
2124
1. clone the [ctu-mrs/kalibr_docker](https://github.com/ctu-mrs/kalibr_docker) repository
2225
2. `cd compose_session`
2326
2. Pull the docker image by calling `docker compose pull`

0 commit comments

Comments
 (0)