ROS使用教程--关于rosbag
来源:互联网 发布:mac office行高 编辑:程序博客网 时间:2024/04/28 13:01
overview
rosbag package提供了一个命令行工具以及cpp类和python的API. rosbag使用命令行能够:录制,从包重新发布,获取包的概括信息,检查包的消息类型,使用Python表达式过滤包中信息,压缩解压缩包,重新索引包
命令行工具
This is the current list of supported commands:
- record. Record a bag file with the contents of specified topics.
$ rosbag record rosout tf cmd_vel
- info. Summarize the contents of a bag file.
- play. Play back the contents of one or more bag files.
- check. Determine whether a bag is playable in the current system, or if it can be migrated.
- fix. Repair the messages in a bag file so that it can be played in the current system.
- filter. Convert a bag file using Python expressions.
- compress. Compress one or more bag files.
- decompress. Decompress one or more bag files.
- reindex. Reindex one or more broken bag files.
如果记录一个高带宽的信息,例如图像信息,最好是在同一个相机节点运行的机器上记录,并指定文件的目的地所属的机器的硬盘
可以使用regex, 指令是-e, -regex
$ rosbag record -e "/(.*)_stereo/(left|right)/image_rect_color"
rosbage info
该工具将保存的bag文件显示出来,包含起止时间,toppics以及其类型,信息数量等.
rqt_bag
提供全方位的图形化界面,具有录制,播放,显示,保存,加载文件,暂停等功能
refer
- https://zhenshenglee.github.io/2016/08/16/160816ROS-Bag%E4%BB%8B%E7%BB%8D/
- http://chenjunjun.bitbucket.org/2016/03/22/ROS-%E6%B6%88%E6%81%AF%E5%BD%95%E5%88%B6%E5%92%8C%E5%9B%9E%E6%94%BE/
rosbag文件中提取视频
方法1
[refer ros wiki page]http://wiki.ros.org/rosbag/Tutorials/Exporting%20image%20and%20video%20data#CA-b03834a5a0917593e18fb84cfab917fbab79f52a_1
<launch> <node pkg="rosbag" type="play" name="rosbag" args="-d 2 $(find image_view)/test.bag"/> <node name="extract" pkg="image_view" type="extract_images" respawn="false" output="screen" cwd="ROS_HOME"> <remap from="image" to="/camera/image_raw"/> </node></launch>
$(find image_view)/test.bag在使用的时候换成自己的bag文件的路径,然后生成一些文件,文件名统一格式为’frame%04d.jpg’,位置在.ros文件中.因此执行一下命令,移动文件,并录制成视频.
cd ~mkdir testmv ~/.ros/frame*.jpg test/cd ~/testmencoder "mf://*.jpg" -mf type=jpg:fps=15 -o output.mpg -speed 1 -ofps 30 -ovc lavc -lavcopts vcodec=mpeg2video:vbitrate=2500 -oac copy -of mpeg
方法2
https://github.com/OSUrobotics/bag2video 未测试.
- ROS使用教程--关于rosbag
- ros中使用rosbag记录数据及转换视频
- ROS使用教程--关于rqt
- ROS使用教程--关于roslaunch
- ROS使用教程-关于ros_info
- ROS使用教程-关于rosparam
- ROS使用教程-关于安装
- ROS相关:使用rospy 编写ros程序并使用rosbag存储数据
- rosbag的使用
- ros中rosbag的记录与重放
- rosbag--ROS中数据的记录与重放
- ROS-从rosbag中提取图像(带时间戳)
- ROS-从rosbag中提取图像(by launch文件)
- ROS关于cv_brige的使用
- ROS教程(九):使用rosed编辑ROS中的文件
- ROS教程:视觉传感器使用漫谈
- ROS教程:视觉传感器使用漫谈
- 使用 QtCreator 编译调试Ros 教程
- 鸡仔单片机成长记----------------51的内部存储及指令运行
- 【bzoj1040】骑士 基环外向树 树规
- 数组函数--php基础最详细教程
- map按value排序
- 单调栈
- ROS使用教程--关于rosbag
- C++笔记2016.8.30
- freescale IMX6Q git 获取源码
- Hibernate的懒加载问题
- Codeforces 217A. Ice Skating 【并查集】
- 搜索算法总结----序
- 关于MapReduce框架中Key-Value对象的重用
- Awesome Adb
- Shell test命令