rosbag录制和回放消息

话题录制:

录制所有发布出来的话题,此时默认将话题保存在一个以当时时间戳命名的文件夹中:

$ rosbag record -a

录制指定话题:

$ rosbag record /topic1 /topic12

话题回放:

基本功能:
$ rosbag play <your bagfile name>
等待一定时间之后发布bag文件中的内容
$ rosbag play <your bagfile name> -d <delay time>
按一定频率回放,-r选项用来设定消息发布速率,如下面命令则表示以3倍原始速率发布话题
$ rosbag play -r 3 <your bagfile name>

回放指定话题:

$ rosbag play <your bagfile name> --topics <topics>

其他指令:

展示bag文件中所包含话题的名称、类型和消息数量:

$ rosbag info <your bagfile name>

更加灵活的回放方式,例如回放除了某个话题以外的所有话题:
参考:https://answers.ros.org/question/228676/exclude-some-topics-from-rosbag-play/

猜你喜欢

转载自blog.csdn.net/qq_27251141/article/details/89848643