本文主要部分来源于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. Receiver class com.mchange.v2.c3p0.impl.NewProxyResultSet does not define or inherit an implementation of the resolved method 'abstract boolean isClosed()' of interface java.sql.ResultSet.

    背景: Mayabtis+springboot项目,连接数据库发生异常 报错内容: java.lang.AbstractMethodError: Receiver class com.mchange. ...

  2. php header 设置文件下载

    控制器 php 代码: $filepath = "http://www.jiesen365.com/uploadfile/20150519044903-897.pdf"; //下载 ...

  3. QT常用控件(一)——菜单栏和对话框

    引言 QMainWindow 是一个为用户提供主窗口程序的类,包含一个菜单栏(menu bar).多个工具栏(tool bars).多个锚接部件(dock widgets).一个状态栏(status ...

  4. QT 如何在调试时能进入源码方式(MacOS)

    最近在学习QT, 遇到一些crash, 也没看过QT源码啊, 就想类似Java一样, 在出错时进入源码跟踪一下, 但是QT和Java太不一样了, 死活进不去. 研究了几天, 发现本来是很简单的事情, ...

  5. ASP.NET MVC部署网站到IIS,只列出网站目录

    解决办法: 1.重启IIS 打开CMD运行以下代码: ps:根据发布网站的的.NET Framework版本进入对应的目录 4.0版本  C:\Windows\Microsoft.NET\Framew ...

  6. [JS]异步任务之事件循环

    前言 常常会听到单线程和多线程这两个名词,单线程即一个时间段内程序从上到下执行任务,多线程即一个时间段内程序同时执行多个任务. 然而 JavaScript 是单线程的,它不像 Java 那样新开启一个 ...

  7. 初探Docker CentOS 7.9 2009 Mini 操作系统环境初始化 和Docker初始化

    初探docker 什么是docker?docker就是一种虚拟化技术,将一个服务虚拟化成一个拥有操作系统内核作为基石的快速使用服务.不用担心环境不同服务效果 不同. docker 官网可以从中央仓库中 ...

  8. C++ //拷贝构造函数调用时机//1.使用一个已经创建完毕的对象来初始化一个新对象 //2.值传递的方式给函数参数传值 //3.值方式返回局部对象

    1 //拷贝构造函数调用时机 2 3 4 #include <iostream> 5 using namespace std; 6 7 //1.使用一个已经创建完毕的对象来初始化一个新对象 ...

  9. gRPC学习之一:在CentOS7部署和设置GO

    欢迎访问我的GitHub https://github.com/zq2599/blog_demos 内容:所有原创文章分类汇总及配套源码,涉及Java.Docker.Kubernetes.DevOPS ...

  10. 【死磕 Java 基础】 — 谈谈那个写时拷贝技术(copy-on-write)

    copy-on-write,即写时复制技术,这是小编在学习 Redis 持久化时看到的一个概念,当然在这个概念很早就碰到过(Java 容器并发有这个概念),但是一直都没有深入研究过,所以趁着这次机会对 ...