Bag-play » History » Version 3

Version 2 (J. Moringen, 09/04/2011 03:28 PM) → Version 3/8 (J. Moringen, 09/25/2011 12:06 PM)

h1. @bag-play@

h2. 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|bag-record]] for recording and [[Bag-info|bag-info]] for inspection of log files.

h2. Obtaining @bag-play@

Binaries of the @bag-play@ program can be downloaded from the "continuous integration server":http://ci.cor-lab.org for versions 0.4 and 0.5 of the project:rsb:

* "0.4 Linux i686":https://ci.cor-lab.de/job/cl-rsbag-tools-stable/label=ubuntu_lucid_32bit/
* "0.4 Linux x86_64":https://ci.cor-lab.de/job/cl-rsbag-tools-stable/label=ubuntu_lucid_64bit/


* "0.5 Linux i686":https://ci.cor-lab.de/job/cl-rsbag-tools/label=ubuntu_lucid_32bit/
* "0.5 Linux x86_64":https://ci.cor-lab.de/job/cl-rsbag-tools/label=ubuntu_lucid_64bit/
* "0.5 MacOS x86_64":https://ci.cor-lab.de/job/cl-rsbag-tools/label=MAC_OS_lion_64bit/


After the download, the @bag-play@ file has to be made executable in most cases. This can be done for example by executing
<pre>
chmod +x bag-play
</pre>
in the download directory.

h2. Checking Versions and Displaying Help

Version and help information is displayed when the @--version@ and @--help[-all]@ commandline options are specified:
<pre>
./bag-play --version
./bag-play --help
./bag-play --help-all
</pre>

The output of @--help[-all]@ includes a list of supported file formats.

h2. Playback of Previously Recorded Events

h3. 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:
# The log file from which events should be read
# 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

<pre>
./bag-play /tmp/nao.tide 'spread://remote:4803' &#x27;spread://remote4803&#x27;
</pre>

For details regarding the URI syntax involved in transport and channel specifications, see [[rsb:URI_Schema|URI Schema]].

h3. 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".

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

h3. 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:

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

h3. Controlling Replay Timing

Different strategies for controlling the replay timing can be used. Strategies and their parameters are specified using the @--replay-strategy@ (@-r@) commandline option. The default replay strategy tries to mimic the original timing.

Other strategies include
* Replay events as fast as possible
* Replay events at a fixed rate

In addition, some strategies permit modification of their behavior via parameters. For example:
<pre>
-r 'fixed-rate :rate 20'
-r 'recorded-timing :speed 1.5'
</pre>

Available strategies and their parameters are described in the output of @bag-play --help@.