Bag-play » History » Version 1

Version 1/8 - Next » - Current version
J. Moringen, 08/29/2011 01:05 AM
initial version


bag-play

Introduction

The bag-play program can be used to publish RSB events from a log file of recorded events. Replaying event flows as closely to the original as possible or with certain modifications can be very useful when debugging components, doing performance or regressions tests or testing the influence of parameters.

See bag-record for recording and bag-info for inspection of log files.

Obtaining bag-play

Binaries of the bag-play program can be downloaded from the continuous integration server for versions 0.4 and 0.5 of the Robotics Service Bus:

After the download, the bag-play file has to be made executable in most cases. This can be done for example by executing

chmod +x bag-play

in the download directory.

Checking Versions and Displaying Help

Version and help information is displayed when the --version and --help commandline options are specified:

./bag-play --version
./bag-play --help

The output of --help includes a list of supported file formats.

Playback of Previously Recorded Events

Playback of All Recorded Channels

To play all recorded events of a log file on their original channels, two commandline arguments have to be specified:
  1. The log file from which events should be read
  2. The "base" RSB scope to which events should be published
    In the following example, the specified scope is "/" which causes all events to be played on their original scopes since recorded event scopes are appended to the specified base scope
./bag-play /tmp/nao.tide 'spread://remote4803'

Selecting Channels for Playback

The default behavior of bag-play is to play back all channels found in the given file. However, when only a subset of the recorded channels should be played back, the --channel (-c) commandline option can be used to select channels for playback. The following example plays all channels matching one of the regular expressions "vision" and "audio".

./bag-play -c 'vision' -c 'audio' /tmp/nao.tide 'spread:?name=5555'

Selecting Temporal Intervals for Playback

The default behavior of bag-play is to play back all events of the selected channels ordered by timestamp, from earliest to latest. However, it is possible to select a subset of these events by specifying temporal or index-based intervals.

The
  • --start-index (-s)
  • --end-index (-e)
  • --start-time (-S)
  • --end-time (-E)

commandline options allow specifying these restrictions.

For example, to replay the events of a log file starting with the 1000-th event, the following command can be used:

./bag-play --start-index 1000 /tmp/nao.tide 'spread:?name=5555'