先安装工具
1 roscd image_view
2 rosmake image_view
3 sudo apt-get install mjpegtools
#find image topics
>rosbag info xx.bag
#write ros launch
>vim export.launch
<launch>
<node pkg="rosbag" type="play" name="rosbag" required="true" args="PATH/xx.bag"/>
<node name="extract" pkg="image_view" type="extract_images" respawn="false" required="true" output="screen" cwd="ROS_HOME">
<!-- to image topic -->
<remap from="image" to="/cam0/image_raw"/>
</node>
</launch>
#mv export images from ros_home
>mv ~/.ros/frame* xxx
可参考http://wiki.ros.org/rosbag/Tutorials/Exporting%20image%20and%20video%20data
其他topics写出 比如imu
>rosbag info xx.bag #查看imu topic
>rostopic echo -b xxx.bag -p /TOPIC > xxx.csv(或者.txt)