本文主要部分来源于ROS官网的Tutorials.

Description: This tutorial will teach you how to record data from a running ROS system into a .bag file, and then to play back the data to produce similar behavior in a running system.

roscore &
rosrun turtlesim turtlesim_node &
rosrun turtlesim turtle_teleop_key
rostopic list -v  # examine the full list of topics that are currently being published in the running system.

# making a temporary directory to record data and then running rosbag record with the option -a
mkdir ~/bagfiles
cd ~/bagfiles
rosbag record -a # Now all published topics will be accumulated in a bag file.

现在可以用方向键控制乌龟运动,所有Topics都会被记录到*.bag文件,本例文件名是当前时间。

接下来回放:

rosbag play <your bagfile>

可以看到乌龟根据回放的message运动。

Recording a subset of the data

rosrun turtlesim turtlesim_node
rosrun turtlesim turtle_teleop_key rosbag record -O subset /turtle1/cmd_vel /turtle1/pose # 只记录感兴趣的topics, 记录到subset.bag中

The limitations of rosbag record/play

play(回放模拟)的效果可能和record(真实历史)时不完全一样,因为:

  • rosbag是通过记录topics来回放模拟历史msgs信息。
  • 仿真的轨迹与 初始状态有关系。
  • 考虑到系统调度的复杂性,难以保证时间完全精确, 仿真的轨迹与 微小的时间差 也有关系。

Learning ROS: Recording and playing back data的更多相关文章

  1. Recording and playing back data

    Recording and playing back data This tutorial will teach you how to record data from a running ROS s ...

  2. Learning ROS for Robotics Programming Second Edition学习笔记(七) indigo PCL xtion pro live

    中文译著已经出版,详情请参考:http://blog.csdn.net/ZhangRelay/article/category/6506865 Learning ROS forRobotics Pro ...

  3. Learning ROS for Robotics Programming - Second Edition(《学习ROS机器人编程-第二版》)

    Learning ROS for Robotics Programming - Second Edition <学习ROS机器人编程-第二版> ----Your one-stop guid ...

  4. 论文笔记之:Playing for Data: Ground Truth from Computer Games

    Playing for Data: Ground Truth from Computer Games ECCV 2016 Project Page:http://download.visinf.tu- ...

  5. Learning ROS for Robotics Programming Second Edition学习笔记(十) indigo Gazebo rviz slam navigation

    中文译著已经出版,详情请参考:http://blog.csdn.net/ZhangRelay/article/category/6506865 moveit是书的最后一章,由于对机械臂完全不知,看不懂 ...

  6. Learning ROS forRobotics Programming Second Edition学习笔记(八)indigo rviz gazebo

    中文译著已经出版,详情请参考:http://blog.csdn.net/ZhangRelay/article/category/6506865 Learning ROS forRobotics Pro ...

  7. Learning ROS for Robotics Programming Second Edition学习笔记(六) indigo xtion pro live

    中文译著已经出版,详情请参考:http://blog.csdn.net/ZhangRelay/article/category/6506865 Learning ROS for Robotics Pr ...

  8. Learning ROS for Robotics Programming Second Edition学习笔记(五) indigo computer vision

    中文译著已经出版,详情请参考:http://blog.csdn.net/ZhangRelay/article/category/6506865 Learning ROS for Robotics Pr ...

  9. Learning ROS for Robotics Programming Second Edition学习笔记(四) indigo devices

    中文译著已经出版,详情请参考:http://blog.csdn.net/ZhangRelay/article/category/6506865 Learning ROS for Robotics Pr ...

随机推荐

  1. [HNOI2008]GT考试 题解

    这题比较难搞.考虑设计状态:\(f_{i,j}\) 表示当前考虑到 \(X_i\) 位,且 \(X\) 的后 \(j\) 位刚好与 \(A\) 列匹配时的方案数.最终答案为 \(\sum_{i=0}^ ...

  2. ssm框架下 数据库连接异常 java.sql.SQLException: The server time zone value '???&#250;&#177;&#234;&#215;??&#177;??' is unrecognized or represents more

    1.错误截图 2.修改操作 我是在框架的中连接的数据库,如果在类中把    &换成& 修改前代码 <property value="com.mysql.jdbc.Dri ...

  3. JSON数据的HTTP Header应该怎么标记?

    第一种 header('Content-type: application/json'); 另一种 header('Content-type: text/json');

  4. JAVAWEB - Servlet原理及其使用>从零开始学JAVA系列

    目录 Servlet原理及其使用 什么是Servlet Servlet的使用 编写一个Servlet,使用继承HttpServlet的方式 配置web.xml 很简单的几个JSP文件 小提示,如果继承 ...

  5. 后台程序编译过程报错PCC-F-02104, Unable to connect to Oracle

    偶然重新编译了一下后台程序,发现编译过程报错无法连接数据库.但通过sqlplus登录数据库是正常的.后台程序改动中也做了详细的分析,没有改动相关数据库的参数和配置. 最后通过浏览器查看了很多相关问题的 ...

  6. Mol Cell丨吕志民团队揭示琥珀酰化介导的肿瘤细胞氧化应激调控新机制

    蛋白质琥珀酰化修饰 (succinylation) ,作为赖氨酸酰化修饰家族的重要一员,于2011年由芝加哥大学赵英明教授团队在Nature Chemical Biology 发文被首次报道,并被评为 ...

  7. Bugku-misc 1-8题总结

    1.签到题 略过 2.这是一张单纯的图片 拉入winhex,在最后面有一段Uniocde编码,解码得到flag. 3.隐写 题目是隐写,binwalk打开分析 得到两个Zlib(提供数据压缩用的函式库 ...

  8. 【笔记】scikit-learn中的Scaler(归一化)

    scikit-learn中的数据归一化 在机器学习使用数据归一化的时候有一个重要的注意事项 我们对训练数据进行均值和方差的处理,得到mean_train以及std_train,但是在对测试数据进行归一 ...

  9. Azure Bicep 开发利器

    Bicep 是一种用于声明式部署Azure资源的领域特定语言.它的目标是通过更清晰的语法.改进的类型安全性.以及对模块化和代码重用的更好支持,彻底简化编写体验. Bicep 其实是对 ARM 模板的透 ...

  10. 为何要打印日志?C++在高并发下如何写日志文件(附源码)?

    为何要打印日志?让程序裸奔不是一件很快乐的事么? 有些BUG就像薛定谔的猫,具有波粒二象性,当你试图去观察它时它就消失了,当你不去观察它时,它又会出现.当你在测试人员面前赌咒发誓,亲自路演把程序跑一遍 ...