本博文参考GEYAO 大神的github
另外GEYAO大神也给出了100HZ数据集的微云下载链接
本人自己根据 GEYAO大神制作的数据集,百度云下载
链接:https://pan.baidu.com/s/18XaZfkjf_WbI6rWl807Szg
提取码:yrzr
到kitti 官网下载 2011_10_03_drive_0027 的extract数据集 (原来的 sync数据集为去除相机畸变的数据集,但是IMU发布频率只有10HZ 显然不满足进行多传感器融合处理,extract的数据集为raw_data ,IMU频率为100HZ,但是没有进行相机去畸变)
网址 : http://www.cvlibs.net/datasets/kitti/raw_data.php?type=residential
参考 GEYTAO 的github
将extract.zip中的oxts重命名为oxts_extract, 拷贝至sync的文件目录下
将sync中的oxts重命名为oxts_sync
新建 scripts.py 源码来自 GEYTAO 的github
放在 /2011_10_03路径下
注意使用python2 运行
python2 scripts.py -i 2011_10_03_drive_0027_sync
新建 kitti2bag.py 源码来自 GEYTAO 的github
放在 /2011_10_03 同一路径下
注意 要使用 python2 运行
python2 kitti2bag.py -t 2011_10_03 -r 0027 raw_synced
根据GEYAO所说
进入到自己的工作空间下,编译运行
git clone https://github.com/AtsushiSakai/rosbag_filter_gui.git
下载 pyqt4
sudo apt install pyqt4
运行
python2 rosbag_filter_gui.py
选择 synced.bag
select 需要keep的topic
生成 synced_filtered.bag
点击 ok 后 转换中
查看 rosbag filter 处理后的 synced_filter.bag 的 info
rosbag info synced_filtered.bag
可看到没有了 /tf_static, /tf 两个topic
path: synced_filtered.bag
version: 2.0
duration: 7:50s (470s)
start: Oct 03 2011 12:55:34.93 (1317617734.93)
end: Oct 03 2011 13:03:25.83 (1317618205.83)
size: 24.0 GB
messages: 54528
compression: none [18177/18177 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]
topics: /kitti/camera_color_left/camera_info 4544 msgs : sensor_msgs/CameraInfo
/kitti/camera_color_left/image_raw 4544 msgs : sensor_msgs/Image
/kitti/camera_color_right/camera_info 4544 msgs : sensor_msgs/CameraInfo
/kitti/camera_color_right/image_raw 4544 msgs : sensor_msgs/Image
/kitti/camera_gray_left/camera_info 4544 msgs : sensor_msgs/CameraInfo
/kitti/camera_gray_left/image_raw 4544 msgs : sensor_msgs/Image
/kitti/camera_gray_right/camera_info 4544 msgs : sensor_msgs/CameraInfo
/kitti/camera_gray_right/image_raw 4544 msgs : sensor_msgs/Image
/kitti/oxts/gps/fix 4544 msgs : sensor_msgs/NavSatFix
/kitti/oxts/gps/vel 4544 msgs : geometry_msgs/TwistStamped
/kitti/oxts/imu 4544 msgs : sensor_msgs/Imu
/kitti/velo/pointcloud 4544 msgs : sensor_msgs/PointCloud2
保留 topic
查看 rosbag filter 处理后的 extracted_filtered.bag 的 info
rosbag info extracted_filtered.bag
extract.bag 只剩下 5个 topic
path: extracted_filtered.bag
version: 2.0
duration: 7:51s (471s)
start: Oct 03 2011 12:55:34.48 (1317617734.48)
end: Oct 03 2011 13:03:26.01 (1317618206.01)
size: 65.4 MB
messages: 229130
compression: none [84/84 chunks]
types: geometry_msgs/TwistStamped [98d34b0043a2093cf9d9345ab6eef12e]
sensor_msgs/Imu [6a62c6daae103f4ff57a132d6f95cec2]
sensor_msgs/NavSatFix [2d3a8cd499b9b4a0249fb98fd05cfa48]
tf2_msgs/TFMessage [94810edda583a504dfda3829e70d7eec]
topics: /kitti/oxts/gps/fix 45826 msgs : sensor_msgs/NavSatFix
/kitti/oxts/gps/vel 45826 msgs : geometry_msgs/TwistStamped
/kitti/oxts/imu 45826 msgs : sensor_msgs/Imu
/tf 45826 msgs : tf2_msgs/TFMessage
/tf_static 45826 msgs : tf2_msgs/TFMessage
rosrun rosbag topic_renamer.py /kitti/oxts/imu extracted_filtered.bag /kitti/oxts/imu/extract extracted_filtered2.bag
rosrun rosbag topic_renamer.py /kitti/oxts/gps/fix extracted_filtered2.bag /kitti/oxts/gps/fix/extract extracted_filtered3.bag
rosrun rosbag topic_renamer.py /kitti/oxts/gps/vel extracted_filtered3.bag /kitti/oxts/gps/vel/extract extracted_filtered4.bag
rosbag info extracted_filtered.bag
path: extracted_filtered4.bag
version: 2.0
duration: 7:51s (471s)
start: Oct 03 2011 12:55:34.48 (1317617734.48)
end: Oct 03 2011 13:03:26.01 (1317618206.01)
size: 65.4 MB
messages: 229130
compression: none [84/84 chunks]
types: geometry_msgs/TwistStamped [98d34b0043a2093cf9d9345ab6eef12e]
sensor_msgs/Imu [6a62c6daae103f4ff57a132d6f95cec2]
sensor_msgs/NavSatFix [2d3a8cd499b9b4a0249fb98fd05cfa48]
tf2_msgs/TFMessage [94810edda583a504dfda3829e70d7eec]
topics: /kitti/oxts/gps/fix/extract 45826 msgs : sensor_msgs/NavSatFix
/kitti/oxts/gps/vel/extract 45826 msgs : geometry_msgs/TwistStamped
/kitti/oxts/imu/extract 45826 msgs : sensor_msgs/Imu
/tf 45826 msgs : tf2_msgs/TFMessage
/tf_static 45826 msgs : tf2_msgs/TFMessage
使用 GEYAO 的 scripts/merge_bags.py
合并 两个 bag
python2 merge_bags.py 2011_10_03_filtered.bag synced_filtered.bag extracted_filtered4.bag
大功告成
path: 2011_10_03_filtered.bag
version: 2.0
duration: 7:51s (471s)
start: Oct 03 2011 12:55:34.93 (1317617734.93)
end: Oct 03 2011 13:03:26.01 (1317618206.01)
size: 24.1 GB
messages: 283658
compression: none [18260/18260 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 4544 msgs : sensor_msgs/CameraInfo
/kitti/camera_color_left/image_raw 4544 msgs : sensor_msgs/Image
/kitti/camera_color_right/camera_info 4544 msgs : sensor_msgs/CameraInfo
/kitti/camera_color_right/image_raw 4544 msgs : sensor_msgs/Image
/kitti/camera_gray_left/camera_info 4544 msgs : sensor_msgs/CameraInfo
/kitti/camera_gray_left/image_raw 4544 msgs : sensor_msgs/Image
/kitti/camera_gray_right/camera_info 4544 msgs : sensor_msgs/CameraInfo
/kitti/camera_gray_right/image_raw 4544 msgs : sensor_msgs/Image
/kitti/oxts/gps/fix 4544 msgs : sensor_msgs/NavSatFix
/kitti/oxts/gps/fix/extract 45826 msgs : sensor_msgs/NavSatFix
/kitti/oxts/gps/vel 4544 msgs : geometry_msgs/TwistStamped
/kitti/oxts/gps/vel/extract 45826 msgs : geometry_msgs/TwistStamped
/kitti/oxts/imu 4544 msgs : sensor_msgs/Imu
/kitti/oxts/imu/extract 45826 msgs : sensor_msgs/Imu
/kitti/velo/pointcloud 4544 msgs : sensor_msgs/PointCloud2
/tf 45826 msgs : tf2_msgs/TFMessage
/tf_static 45826 msgs : tf2_msgs/TFMessage
查看话题发布频率
10HZ发布
rostopic hz /kitti/oxts/imu
subscribed to [/kitti/oxts/imu]
average rate: 17.196
min: 0.012s max: 0.109s std dev: 0.04000s window: 10
average rate: 12.273
min: 0.012s max: 0.111s std dev: 0.03687s window: 19
average rate: 11.220
min: 0.012s max: 0.122s std dev: 0.03196s window: 29
average rate: 10.823
min: 0.012s max: 0.122s std dev: 0.02874s window: 38
average rate: 10.523
min: 0.012s max: 0.122s std dev: 0.02669s window: 48
average rate: 10.355
min: 0.012s max: 0.122s std dev: 0.02485s window: 58
average rate: 10.259
min: 0.012s max: 0.122s std dev: 0.02354s window: 67
^Caverage rate: 10.252
min: 0.012s max: 0.122s std dev: 0.02337s window: 68
100HZ发布
rostopic hz /kitti/oxts/imu/extract
subscribed to [/kitti/oxts/imu/extract]
average rate: 100.007
min: 0.008s max: 0.012s std dev: 0.00036s window: 95
average rate: 100.011
min: 0.008s max: 0.012s std dev: 0.00030s window: 195
average rate: 100.015
min: 0.008s max: 0.012s std dev: 0.00029s window: 295
average rate: 100.013
min: 0.008s max: 0.012s std dev: 0.00028s window: 396
average rate: 100.010
min: 0.008s max: 0.012s std dev: 0.00025s window: 496
average rate: 100.011
min: 0.008s max: 0.012s std dev: 0.00024s window: 596
average rate: 100.009
min: 0.008s max: 0.012s std dev: 0.00027s window: 696
average rate: 100.013
min: 0.007s max: 0.013s std dev: 0.00029s window: 796
average rate: 100.011
min: 0.007s max: 0.013s std dev: 0.00029s window: 896
average rate: 100.006
min: 0.007s max: 0.013s std dev: 0.00030s window: 996
average rate: 100.011
min: 0.007s max: 0.013s std dev: 0.00030s window: 1096
^Caverage rate: 100.011
min: 0.007s max: 0.013s std dev: 0.00030s window: 1111