深度学习(15):kitti数据集转rosbag包工具kitti2bag使用说明

1 安装

        使用pip安装即可

pip install kitti2bag

        其中kitti2bag的github链接:https://github.com/tomas789/kitti2bag

        如果因为proxy代理的原因,一直pip install不了,可以试试换台电脑转换数据(这或许更有用)

2.下载并解压数据数据

        到网页:The KITTI Vision Benchmark Suite下载数据(可能需要注册);这里下载一个“数据栏”下的scnced+rectified datacalibration文件到同一个目录

        完成后如下所示: (同时创建一个change文件夹)

        下面两步手动解压就是为了将两个压缩包的2011_10_03进行合并

        手动解压2011_10_03_drive_0047_sync.zip到change目录,操作如下:

        手动解压2011_10_03_calib.zip里面的标定文件到change/2011_10_03目录(2011_10_03位上一步解压得到的目录),操作如下(注意:需要选中全部的txt文件,而不是文件夹)

         解压后目录如下:

[meng@meng /media/meng/5418189112144B70/kitti/road/2022_10_03_drive_0047/change]$ tree -L 4
.
└── 2011_10_03
    ├── 2011_10_03_drive_0047_sync
    │   ├── image_00
    │   │   ├── data
    │   │   └── timestamps.txt
    │   ├── image_01
    │   │   ├── data
    │   │   └── timestamps.txt
    │   ├── image_02
    │   │   ├── data
    │   │   └── timestamps.txt
    │   ├── image_03
    │   │   ├── data
    │   │   └── timestamps.txt
    │   ├── oxts
    │   │   ├── data
    │   │   ├── dataformat.txt
    │   │   └── timestamps.txt
    │   └── velodyne_points
    │       ├── data
    │       ├── timestamps_end.txt
    │       ├── timestamps_start.txt
    │       └── timestamps.txt
    ├── calib_cam_to_cam.txt
    ├── calib_imu_to_velo.txt
    └── calib_velo_to_cam.txt

14 directories, 12 files

3 kitti数据转为rosbag数据

        进入change目录

        2011_10_03为数据所在目录,0047为下载数据的序号,其他类推

kitti2bag -t 2011_10_03 -r 0047 raw_synced .

        转换中:

         转换完成:

[meng@meng /media/meng/5418189112144B70/kitti/road/2022_10_03_drive_0047/change]$ kitti2bag -t 2011_10_03 -r 0047 raw_synced .
Exporting static transformations
Exporting time dependent transformations
Exporting IMU
Exporting camera 0
100% (837 of 837) |#######################| Elapsed Time: 0:00:05 Time:  0:00:05
Exporting camera 1
100% (837 of 837) |#######################| Elapsed Time: 0:00:05 Time:  0:00:05
Exporting camera 2
100% (837 of 837) |#######################| Elapsed Time: 0:00:13 Time:  0:00:13
Exporting camera 3
100% (837 of 837) |#######################| Elapsed Time: 0:00:24 Time:  0:00:24
Exporting velodyne data
100% (837 of 837) |#######################| Elapsed Time: 0:01:47 Time:  0:01:47
## OVERVIEW ##
path:        kitti_2011_10_03_drive_0047_synced.bag
version:     2.0
duration:    1:26s (86s)
start:       Oct 03 2011 14:57:27.04 (1317625047.04)
end:         Oct 03 2011 14:58:53.67 (1317625133.67)
size:        4.4 GB
messages:    11718
compression: none [3349/3349 chunks]
types:       geometry_msgs/TwistStamped [98d34b0043a2093cf9d9345ab6eef12e]
             sensor_msgs/CameraInfo     [c9a58c1b0b154e0e6da7578cb991d214]
             sensor_msgs/Image          [060021388200f6f0f447d0fcd9c64743]
             sensor_msgs/Imu            [6a62c6daae103f4ff57a132d6f95cec2]
             sensor_msgs/NavSatFix      [2d3a8cd499b9b4a0249fb98fd05cfa48]
             sensor_msgs/PointCloud2    [1158d486dd51d683ce2f1be655c3c181]
             tf2_msgs/TFMessage         [94810edda583a504dfda3829e70d7eec]
topics:      /kitti/camera_color_left/camera_info    837 msgs    : sensor_msgs/CameraInfo    
             /kitti/camera_color_left/image_raw      837 msgs    : sensor_msgs/Image         
             /kitti/camera_color_right/camera_info   837 msgs    : sensor_msgs/CameraInfo    
             /kitti/camera_color_right/image_raw     837 msgs    : sensor_msgs/Image         
             /kitti/camera_gray_left/camera_info     837 msgs    : sensor_msgs/CameraInfo    
             /kitti/camera_gray_left/image_raw       837 msgs    : sensor_msgs/Image         
             /kitti/camera_gray_right/camera_info    837 msgs    : sensor_msgs/CameraInfo    
             /kitti/camera_gray_right/image_raw      837 msgs    : sensor_msgs/Image         
             /kitti/oxts/gps/fix                     837 msgs    : sensor_msgs/NavSatFix     
             /kitti/oxts/gps/vel                     837 msgs    : geometry_msgs/TwistStamped
             /kitti/oxts/imu                         837 msgs    : sensor_msgs/Imu           
             /kitti/velo/pointcloud                  837 msgs    : sensor_msgs/PointCloud2   
             /tf                                     837 msgs    : tf2_msgs/TFMessage        
             /tf_static                              837 msgs    : tf2_msgs/TFMessage

        播放数据包