如何从ros bag中提取相机信息和图像?

时间:2019-03-05 02:56:27

标签: camera ros bag

我有一个ros袋及其信息如下

path:        zed.bag

version:     2.0

duration:    3:55s (235s)

start:       Nov 12 2014 04:28:20.90 (1415737700.90)

end:         Nov 12 2014 04:32:16.65 (1415737936.65)

size:        668.3 MB

messages:    54083

compression: none [848/848 chunks]

types:       sensor_msgs/CameraInfo      [c9a58c1b0b154e0e6da7578cb991d214]
             sensor_msgs/CompressedImage [8f7a12909da2c9d3332d540a0977563f]
             tf2_msgs/TFMessage          [94810edda583a504dfda3829e70d7eec]

topics:      /stereo_camera/left/camera_info_throttle              3741 msgs    : sensor_msgs/CameraInfo  
             /stereo_camera/left/image_raw_throttle/compressed     3753 msgs    : sensor_msgs/CompressedImage
             /stereo_camera/right/camera_info_throttle             3741 msgs    : sensor_msgs/CameraInfo 
             /stereo_camera/right/image_raw_throttle/compressed    3745 msgs    : sensor_msgs/CompressedImage
             /tf                                                  39103 msgs    : tf2_msgs/TFMessage          (2 connections)

我可以通过以下方式提取图像  http://wiki.ros.org/rosbag/Tutorials/Exporting%20image%20and%20video%20data 但是当我想获取相机信息时出现问题,有人知道如何解决吗?

1 个答案:

答案 0 :(得分:1)

可以使用rostopic将基于文本的信息回显到文件中来解决该问题:

rostopic echo -b zed.bag /stereo_camera/left/camera_info_throttle > data.txt