关键词:
ROS Bag是ROS计算图级的一个概念:
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。ref rqt_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: 数据的记录和回放到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 的操作。
ros进二阶学习笔记-rosandmultithread
ROS进二阶学习笔记(4)-ROSandMultithreadI'lldiscussabouttheconceptofthread,multithread,andtheapplicationofmultithreadcodinginROSenv.1.What'smultithread?-Basicsofoperatingsystemref:http:// 查看详情
ros进二阶学习笔记--metapackage
ROS进阶学习笔记(24)--MetapackageMetapackage是ROSFileSystem概念层中的一个概念:2.CreateandConfigureaMetapackage:url:http://wiki.ros.org/catkin/package.xml#MetapackagesUsuallytheparentfolder,namedli 查看详情
ros进二阶学习笔记-programmaticwaytostart/stoparoslaunch(代码片段)
ROS进二阶学习笔记(3)-programmaticwaytostart/stoparoslaunchSometimes,weneedtostart/stoparos.launchfile/rosnodeinaprogrammaticway,especiallywhenwebringintheSMACHmethodtohandleourapplications.Here 查看详情
ros进二阶学习笔记--metapackage
ROS进阶学习笔记(24)--MetapackageMetapackage是ROSFileSystem概念层中的一个概念:2.CreateandConfigureaMetapackage:url:http://wiki.ros.org/catkin/package.xml#MetapackagesUsuallytheparentfolder,namedlikethemetapackageorjustthereponame,containsnopackage.xmlbutallpackage... 查看详情
ros进二阶学习笔记(10)--rospy.publisher()之queue_size
ROS进二阶学习笔记(10)--rospy.Publisher()之queue_sizeref link===============queue_size:publish()behaviorandqueuingpublish()inrospyissyn 查看详情
ros进二阶学习笔记-命名与命名空间
ref:http://wiki.ros.org/Names命名空间(wikipedia)ref:https://zh.wikipedia.org/wiki/命名空间命名空间(英语:Namespace),也称名字空间、名称空间等,它表示着一个标识符(identifier)的可 查看详情
ros进二阶学习笔记(10)--rospy.publisher()之queue_size
ROS进二阶学习笔记(10)--rospy.Publisher()之queue_sizeref link===============queue_size:publish()behaviorandqueuingpublish()inrospyissynchronousbydefault(forbackwardcompatibilityreasons)whichmeansthattheinvocationisbloc... 查看详情
ros进二阶学习笔记--关于overlay:重名package在不同catkinworkspace中,(代码片段)
要把ROS玩转,必须把catkin玩转。http://wiki.ros.org/catkin/Tutorials其中,Overlay问题是重名package在不同catkinworkspace中时,如何处理他们的关系。一个检查的命令:echo$ROS_PACKAGE_PATH可检查overlay用来设置path的命令们:$sou 查看详情
ros进二阶学习笔记--关于rospy和parameters(代码片段)
ref:http://wiki.ros.org/ParameterServer -- 总领阐述parameter的一些概念。比如namespacehttp://wiki.ros.org/rospy/Overview/ParameterServer -- 如何使用Python操作paramshttp://wiki.ros.org/rospy_tutorials/Tutorials/Parameters -- 如何使用Python操作paramshttp://wiki.ros.org/ros... 查看详情
ros进二阶学习笔记--关于rospy和parameters(代码片段)
ref:http://wiki.ros.org/ParameterServer -- 总领阐述parameter的一些概念。比如namespacehttp://wiki.ros.org/rospy/Overview/ParameterServer -- 如何使用Python操作paramshttp://wiki.ros.org/rospy_tutorials/Tutorials/Parameters -- 如何使用Python操作paramshttp://wiki.ros.org/ros... 查看详情
ros学习笔记之——基于已有的rosbag重新录制rosbag(代码片段)
首先通过下面命令查看当前rosbag的topicrosbaginforslidar-outdoor-gps.bag此处把tf去掉rosbagrecord/imu/odom_scout/fix/front_scan/heading/rslidar_points/tf_static但在执行前还需要执行rosparamsetuse_sim_timetruerosparamgetuse_sim_time运 查看详情
ros进二阶学习笔记--关于overlay:重名package在不同catkinworkspace中,(代码片段)
要把ROS玩转,必须把catkin玩转。http://wiki.ros.org/catkin/Tutorials其中,Overlay问题是重名package在不同catkinworkspace中时,如何处理他们的关系。一个检查的命令:echo$ROS_PACKAGE_PATH可检查overlay用来设置path的命令们:$sou... 查看详情
ros学习笔记51--rosbag管理工具分享:时间戳过滤话题过滤多包过滤(代码片段)
环境:ubuntu20.04、ros-noetic、python前言:这是分享一个自己写的rosbag管理工具,个人感觉实用性很强。importrosbagdefmerge():bag1=rosbag.Bag('/home/ylh/dataset/1.bag','r')#包源1bag2=rosb 查看详情
ros学习笔记51--rosbag管理工具分享:时间戳过滤话题过滤多包过滤(代码片段)
环境:ubuntu20.04、ros-noetic、python前言:这是分享一个自己写的rosbag管理工具,个人感觉实用性很强。importrosbagdefmerge():bag1=rosbag.Bag('/home/ylh/dataset/1.bag','r')#包源1bag2=rosbag.Bag('/home/ylh/dataset/... 查看详情
ros学习笔记51--rosbag管理工具分享:时间戳过滤话题过滤多包过滤(代码片段)
环境:ubuntu20.04、ros-noetic、python前言:这是分享一个自己写的rosbag管理工具,个人感觉实用性很强。importrosbagdefmerge():bag1=rosbag.Bag('/home/ylh/dataset/1.bag','r')#包源1bag2=rosbag.Bag('/home/ylh/dataset/... 查看详情
ros学习笔记52--图片从compressed格式转raw格式代码接口介绍(代码片段)
背景:操作rosbag,目的将图片的compressed格式转raw格式,让后进行操作。发现python并没有对应的工具接口实现,而image_transport接口用起来也没有时效性(总不能将bag播放录制,过于费时费存储空间)概要... 查看详情
ros学习rosbag转化为mp4格式视频(代码片段)
文章目录写在前面一、文件准备二、安装依赖三、使用方法四、举例:执行rosbag转化为mp4格式视频的脚本五、参考链接六、附录:rosbag2video.py源码写在前面本文系统测试环境:Ubuntu18.04ROS-melodic一、文件准备从github中... 查看详情
ros相关:使用rospy编写ros程序并使用rosbag存储数据
...言接口简单,更容易编写。并且可以使用python与深度学习的一些框架比如Caffe,TensorFlow,Theano等结合。因此 查看详情