1.安装图像处理的工具包
sudo apt-get install mjepgtools
sudo apt-get install ffmpeg
如果安装报错请自行谷歌解决。
2.新建储存图片文件夹,进入改文件目录下运行:
mkdir FILE_NAME
cd FILE_NAME
首先运行:
roscore
rosrun image_view extract_images _sec_per_frame:=0.01 image:=/image_topic
其中,/image_topic替换为你的图像话题,可通过_sec_per_frame设置图像截取间隔。
然后播放你的rosbag:
rosbag play /BAG_PATH/BAG_NAME.bag