GitHub - kinglintianxia/bag2tum: ROS bag to tum dataset style files
基于以上代码进行实现:
1.创建文件夹:
image
├── depth
└── rgb
2.修改bag2tum.launch文件中的:save_folder, rgb_topic 和depth_topic参数:
<param name="save_folder" value="/home/nv/zoe/bag2tum/image" />
<param name="rgb_topic" value="/camera/color/image_raw" />
<param name="depth_topic" value="/camera/aligned_depth_to_color/image_raw" />
注:通过查看rostopic的信息,来获取rgb_topic以及depth_topic的信息:
rosbag info xxx.bag
3.创建build文件夹:
cmake ..
make
4.启动roslaunch:
source devel/setup.bash
roslaunch bag2tum bag2tum.launch
5. play bag文件:
rosbag play XX.bag
6.成功之后,生成深度图以及RGB图以及时间戳: