ROS rosbag 录制和回放消息实用总结

博客转载自:https://blog.csdn.net/zhanghm1995/article/details/82468754

话题录制

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

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>

回放除了某个话题以外的所有话题

rosbag filter file.bag file-no-tf.bag "topic != '/tf'"

创建一个除了/tf消息的新包

猜你喜欢

转载自www.cnblogs.com/flyinggod/p/12758970.html