Note: This tutorial assumes that you have completed the previous tutorials: Moving the Robot, Controlling the Shadow Hand with a Cyberglove.
(!) Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.

Recording a movement and replaying it.

Description: Records and replays a hand movement.

Tutorial Level: BEGINNER

  Show EOL distros: 

Introduction

In this tutorial we'll use rxbag to record and replay a movement on the Dexterous Hand, using a Cyberglove. Please note that the method is very generic: with rxbag you can record and replay any topics you want.

Recording

We assume you started the Cyberglove and remapper as described in this tutorial. The Hand interface doesn't necessarily need to be started for the time being: we're just going to record the hand targets sent by the remapper node (which are directly remapped from the Cyberglove).

To record those, just run:

$ rxbag --record /srh/sendupdate

You can see the data being recorded. It should look like this: rxbag recording a data sequence

When you close rxbag, you'll see a new file created in the folder you were, the filename should be of the format YYYY-MM-DD-hh-mm-ss.bag.

Replaying

You can now replay your recorded data, just run rxbag on the newly created file (replace by the correct file name):

$ rxbag 2011-04-21-12-37-36.bag

You now need to make sure rxbag is publishing the data: right click on the rxbag window, select Publish->Publish all. Now you can press the play button and your recorded movement will be played back. You'll see the place at which you are in the replayed sequence.

rxbag replaying a data sequence

Introduction

In this tutorial we'll use rosbag to record and rqt_bag to replay a movement on the Dexterous Hand, using a Cyberglove or any other command method. Please note that the method is very generic: with rosbag you can record and replay any topics you want.

Recording

If you are using the Cyberglove we assume you have started the Cyberglove and remapper as described in this tutorial.

Alternatively you could record movements from the GUI Joint sliders or any other node publishing to the hand command topics. The Hand interface doesn't necessarily need to be started for the time being: we're just going to record the hand targets sent on the command topics.

To record the command topics for every joint together, we use rosbag record with a regular expression :

$ rosbag record -e "/sh_(.*)_mixed_position_velocity_controller/command"

You you should see rosbag start recording and subscribe to each of the command topics the data being recorded.

When you close rosbag, you'll see a new file created in your present working directory, the filename should be of the format YYYY-MM-DD-hh-mm-ss.bag.

Replaying

You can now replay your recorded data, just run rqt_gui and select Bag under the plugins menu, then open the newly created file (replace by the correct file name):

$ rxbag 2013-04-21-12-37-36.bag

You now need to make sure rqt_gui is publishing the data: right click on the Bag window, select Publish->Publish all. Now you can press the play button and your recorded movement will be played back. You'll see your current position within the replayed sequence.

rqt_gui replaying a data sequence

Our stacks have not yet been released under Groovy, please use the Fuerte versions.

Our stacks have not yet been released under Hydro, please use the Fuerte versions.

Wiki: sr_hand/Tutorials/Recording a movement and replaying it later (last edited 2013-05-03 04:45:11 by AndrewPether)