1.安装kaist2rosbag功能包
cd src
git clone https://github.com/tsyxyz/irp_sen_msgs.git
# (README中的地址有误,已更改)
git clone https://github.com/tsyxyz/kaist2bag.git
cd ..
catkin build
2.编辑配置文件
修改数据集地址,输出rosbag位置,选择需要转换的数据。
dataset: "/media/hzy/06DA9BDADA9BC3F9/dataset38/kasit_urban38"
#kaist数据集路径
save_to: "/home/hzy/TinyGrapeKit-master/app/FilterFusion/dataset"
#生成的bag路径
altimeter: false
altimeter_topic: "/altimeter_data"
encoder: true
encoder_irp_topic: "/encoder_count"
encoder_raw_topic: "/joint_states"
fog: false
fog_topic: "/dsp1760_data"
gps: true
gps_topic: "/fix"
vrs: false
vrs_topic: "/vrs_gps_data"
imu: false
imu_irp_topic: "/xsens_imu_data"
imu_raw_topic: "/imu/data_raw"
imu_mag_topic: "/imu/mag"
velodyne: false
velodyne_left_topic: "/ns2/velodyne_points"
velodyne_right_topic: "/ns1/velodyne_points"
sick: false
sick_back_topic: "/lms511_back/scan"
sick_middle_topic: "/lms511_middle/scan"
stereo: true
stereo_left_topic: "/stereo/left/image_raw"
stereo_right_topic: "/stereo/right/image_raw"
3.运行
source devel/setup.bash
roslaunch kaist2bag kaist2bag.launch
合并多个rosbag
rosrun kaist2bag mergebag.py merged.bag <bag_file_1> ... <bag_file_8>
#merged.bag是合并后的bag包名称