赞
踩
kitti2bag程序能够讲kitti原始数据(raw data)转化为rosbag格式,以便于程序测试
步骤一:按照以下顺序安装kitti2bag程序
sudo pip install pandas==0.23.0 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
sudo pip install pykitti -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
sudo pip install kitti2bag -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
前往如下网址下载KITTI原始数据集(需要魔法):
http://www.cvlibs.net/datasets/kitti/raw_data.php
具体说明如下:
步骤二:选择自己该兴趣的包,下载其synced+rectified文件和calibration文件
步骤三:按照以下顺序调整文件结构
我们下载下来的是两个压缩文件
1.首先将其解压
2.然后复制xxxx_xx_xx_calib/xxxx_xx_xx/下的三个标定文件
3.将其粘贴到xxxx_xx_xx_drive_xxxx_sync/xxxx_xx_xx/文件夹下,最终文件结构如图所示:
步骤四:运行kitti2bag,讲kitti数据集转化为rosbag
1.打开终端,来到xxxx_xx_xx_drive_xxxx_sync/文件夹下:
2.按照以下运行命令
kitti2bag -t 2011_09_26 -r 0027 raw_synced .
#2011_09_26是数据集对应的采集日期,在文件夹名字中即可得到
#0027是数据集对应的编号,在synced+rectified文件解压后的文件夹名称中可以得到
#注意最后面有个空格和.
完整运行结果如图:
zhangman@zhangman-G3-3579:~/Downloads/Downlods/2011_09_26_drive_0027_sync$ kitti2bag -t 2011_09_26 -r 0027 raw_synced . Exporting static transformations Exporting time dependent transformations Exporting IMU Exporting camera 0 100% (188 of 188) |#######################| Elapsed Time: 0:00:00 Time: 0:00:00 Exporting camera 1 100% (188 of 188) |#######################| Elapsed Time: 0:00:00 Time: 0:00:00 Exporting camera 2 100% (188 of 188) |#######################| Elapsed Time: 0:00:01 Time: 0:00:01 Exporting camera 3 100% (188 of 188) |#######################| Elapsed Time: 0:00:01 Time: 0:00:01 Exporting velodyne data 100% (188 of 188) |#######################| Elapsed Time: 0:00:24 Time: 0:00:24 ## OVERVIEW ## path: kitti_2011_09_26_drive_0027_synced.bag version: 2.0 duration: 19.4s start: Sep 26 2011 13:21:35.13 (1317014495.13) end: Sep 26 2011 13:21:54.48 (1317014514.48) size: 1020.9 MB messages: 2632 compression: none [752/752 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 188 msgs : sensor_msgs/CameraInfo /kitti/camera_color_left/image_raw 188 msgs : sensor_msgs/Image /kitti/camera_color_right/camera_info 188 msgs : sensor_msgs/CameraInfo /kitti/camera_color_right/image_raw 188 msgs : sensor_msgs/Image /kitti/camera_gray_left/camera_info 188 msgs : sensor_msgs/CameraInfo /kitti/camera_gray_left/image_raw 188 msgs : sensor_msgs/Image /kitti/camera_gray_right/camera_info 188 msgs : sensor_msgs/CameraInfo /kitti/camera_gray_right/image_raw 188 msgs : sensor_msgs/Image /kitti/oxts/gps/fix 188 msgs : sensor_msgs/NavSatFix /kitti/oxts/gps/vel 188 msgs : geometry_msgs/TwistStamped /kitti/oxts/imu 188 msgs : sensor_msgs/Imu /kitti/velo/pointcloud 188 msgs : sensor_msgs/PointCloud2 /tf 188 msgs : tf2_msgs/TFMessage /tf_static 188 msgs : tf2_msgs/TFMe
转化成功后在xxxx_xx_xx_drive_xxxx_sync/文件夹下生成对应的rosbag包
1.运行roscore
roscore
2.另开终端播放rosbag
rosbag play kitti_2011_09_26_drive_0027_synced.bag
3.列出topic列表可见下列topic
zhangman@zhangman-G3-3579:~$ rostopic list /clock /kitti/camera_color_left/camera_info /kitti/camera_color_left/image_raw /kitti/camera_color_right/camera_info /kitti/camera_color_right/image_raw /kitti/camera_gray_left/camera_info /kitti/camera_gray_left/image_raw /kitti/camera_gray_right/camera_info /kitti/camera_gray_right/image_raw /kitti/oxts/gps/fix /kitti/oxts/gps/vel /kitti/oxts/imu /kitti/velo/pointcloud /rosout /rosout_agg /tf /tf_static
4.另开终端运行rviz
rviz
5.在rviz通过topic添加中可看到如下话题
6.添加各项话题,Fixed Frame调整为world,如下:
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。