As I couldn't find any package on GitHub for directly converting raw KITTI data into ROS2 bag, I decided to create this repository.
The current version of this repository only supports the conversion of KITTI raw data into ROS2 bag. Contributions are welcome.
git clone https://github.com/Chris7462/kitti_to_ros2bag.git
Modify the kitti_to_ros2bag.yaml file under params folder.
For example:
kitti_path: "/data/kitti/raw/2011_09_29"
data_folder: "2011_09_29_drive_0071_sync"
calib_folder: ""
dirs: ["image_00", "image_01", "image_02", "image_03", "oxts", "velodyne_points"]
The corresponding folder structure:
/data/kitti/raw/2011_09_29/ <--- kitti_path
├── 2011_09_29_drive_0071_sync <--- data_folder
│ ├── image_00 <--- dirs
│ │ ├── data
│ │ │ ├── 0000000000.png
│ │ │ ├── ...
│ │ │ └── 0000001058.png
│ │ └── timestamps.txt
│ ├── image_01
│ │ ├── data
│ │ │ ├── 0000000000.png
│ │ │ ├── ...
│ │ │ └── 0000001058.png
│ │ └── timestamps.txt
│ ├── image_02
│ │ ├── data
│ │ │ ├── 0000000000.png
│ │ │ ├── ...
│ │ │ └── 0000001058.png
│ │ └── timestamps.txt
│ ├── image_03
│ │ ├── data
│ │ │ ├── 0000000000.png
│ │ │ ├── ...
│ │ │ └── 0000001058.png
│ │ └── timestamps.txt
│ ├── oxts
│ │ ├── data
│ │ │ ├── 0000000000.txt
│ │ │ ├── ...
│ │ │ └── 0000001058.txt
│ │ ├── dataformat.txt
│ │ └── timestamps.txt
│ └── velodyne_points
│ ├── data
│ │ ├── 0000000000.bin
│ │ ├── ...
│ │ └── 0000001058.bin
│ ├── timestamps_end.txt
│ ├── timestamps_start.txt
│ └── timestamps.txt
├── calib_cam_to_cam.txt <--- calibrations
├── calib_imu_to_velo.txt
└── calib_velo_to_cam.txt
colcon build --symlink-install --packages-select kitti_to_ros2bag
source ./install/setup.bash
ros2 launch kitti_to_ros2bag kitti_to_ros2bag_launch.py
That's it. You have the file kitti_2011_09_29_drive_0071_sync_bag that contains your data.