ROS进二阶学习笔记(6) -- ROS Bag
2017-01-03 14:41
786 查看
ROS Bag是ROS计算图级的一个概念:
Bags:
ref : http://wiki.ros.org/Bags
创建bags, 收听topic,记录数据。可以回放或者remap到别的topic。
rosbag还能处理具有时间戳的数据,publish一个 simulated clock that corresponds to the time the data was recorded in the file。
bag文件的格式用来记录和回放数据都是非常高效的,消息都是跟在ros里一样的格式记录的。
具体command-line使用方法:
rosbag command-line usage
rqt_bag: http://wiki.ros.org/rqt_bag
Display messages in a bag file:
$ rostopic echo -b log_file.bag /topic_name
rostopic list
list
Display a list of current topics.
$ rostopic list
list <namespace>
List topics in the specified namespace. In previous versions, this is equivalent to the rostopic info command.
$ rostopic list /namespace
-b
List topics in a bag file.
-p
List only publishers.
-s
List only subscribers.
-v
Verbose mode.
$ rostopic list -v
--host New in Diamondback
Group list by hostname.
ref more: http://wiki.ros.org/rostopic
Programmatic APIs - rosbag工具
rosbag 工具可以更快速操作bag文件,这让你提取满足特定filter的消息到一个新的bag文件。
参考: rosbag Code API, Cookbook examples,
rosrecord 包里有APIs,可以让其他的C++/python 包有能力to iterate over stored messages,它老了,已经被rosbag取代了。
msg文件有更新时,bag file可以轻易地被提取。bag 文件格式里存有与之所存数据匹配的 msg 文件。像rosbagmigration这样的工具可以写规则进去,来自动的更新bag files当它变得out of date.
>> rqt_bag: graphical tool for visualizing bag file data.
>> rostopic: the echo and list commands are compatible with bag files.
>> rosrecord
>> rosplay
>> rosrebag
The underlying format of a bag file should not be relevant to the average user. It is subject to change, but backwards compatibility will be maintained by the programmatic access
libraries, or custom conversion libraries.
===================
如何在程序中使用bag 文件
问题1: 数据的记录和回放到console
ref: http://wiki.ros.org/rosbag/Code%20API
问题2: a collection of code fragments demonstrating use of the rosbag APIs.
ref: http://wiki.ros.org/rosbag/Cookbook
更多高级的玩法
当需要更高级的功能时,得ref:
rosBag 的 API 文档
提取数据时,可能会涉及到 tuples Generator 的操作。
Bags:
ref : http://wiki.ros.org/Bags
在 计算图里 在线使用
工具:rosbag创建bags, 收听topic,记录数据。可以回放或者remap到别的topic。
rosbag还能处理具有时间戳的数据,publish一个 simulated clock that corresponds to the time the data was recorded in the file。
bag文件的格式用来记录和回放数据都是非常高效的,消息都是跟在ros里一样的格式记录的。
具体command-line使用方法:
rosbag command-line usage
离线使用和数据迁移
有多种离线使用方式。工具:rqt_bag
可以让你可视化bag数据,plot 或者image。refrqt_bag: http://wiki.ros.org/rqt_bag
工具:rostopic
快速查看bag文件,list topics 和 echoing data to console.Display messages in a bag file:
$ rostopic echo -b log_file.bag /topic_name
rostopic list
list
Display a list of current topics.
$ rostopic list
list <namespace>
List topics in the specified namespace. In previous versions, this is equivalent to the rostopic info command.
$ rostopic list /namespace
-b
List topics in a bag file.
-p
List only publishers.
-s
List only subscribers.
-v
Verbose mode.
$ rostopic list -v
--host New in Diamondback
Group list by hostname.
ref more: http://wiki.ros.org/rostopic
Programmatic APIs - rosbag工具
rosbag 工具可以更快速操作bag文件,这让你提取满足特定filter的消息到一个新的bag文件。参考: rosbag Code API, Cookbook examples,
rosrecord 包里有APIs,可以让其他的C++/python 包有能力to iterate over stored messages,它老了,已经被rosbag取代了。
msg文件有更新时,bag file可以轻易地被提取。bag 文件格式里存有与之所存数据匹配的 msg 文件。像rosbagmigration这样的工具可以写规则进去,来自动的更新bag files当它变得out of date.
工具:
>> rosbag: unified console tool for recording, playback, and other operations.>> rqt_bag: graphical tool for visualizing bag file data.
>> rostopic: the echo and list commands are compatible with bag files.
Older tools
The following tools have been superceded by rosbag, but are still supported:>> rosrecord
>> rosplay
>> rosrebag
格式
bag文件的格式与普通用户没多大关系了。The underlying format of a bag file should not be relevant to the average user. It is subject to change, but backwards compatibility will be maintained by the programmatic access
libraries, or custom conversion libraries.
===================
如何在程序中使用bag 文件
问题1: 数据的记录和回放到consoleref: http://wiki.ros.org/rosbag/Code%20API
问题2: a collection of code fragments demonstrating use of the rosbag APIs.
ref: http://wiki.ros.org/rosbag/Cookbook
更多高级的玩法
当需要更高级的功能时,得ref:rosBag 的 API 文档
提取数据时,可能会涉及到 tuples Generator 的操作。
相关文章推荐
- Spark介绍与环境搭建
- opencv 训练自己的分类器
- A Horrible Poem(bzoj 2795)
- Cocos2d-x 3.x 图形学渲染系列一
- “异地多活”多机房部署经验谈_运维管理_数据中心_中国IDC圈
- 公共组件使用手册
- 自定义控件之ImageView实现点击之后有阴影效果
- MBG(MyBatis Generator):MyBatis自动代码生成;
- RenderTexture
- Java OCR tesseract 图像智能字符识别技术 Java代码实现
- 开源 java CMS - FreeCMS2.6发布
- Eclipse 插件安装、升级和卸载的方法
- Android蓝牙基础方法
- Linux命令备忘
- spring容器无法注入service(No qualifying bean of type)
- 2016一路有你,2017一起同行
- spring中@param和mybatis中@param使用区别
- Ajax使用WCF实现小票pos机打印源码
- 编译Android2.2源码(2):运行模拟器
- 【腾讯优测干货分享】如何降低App的待机内存(四)——进阶:内存原理