Bag-cat » History » Version 1
Version 1/10
-
Next » -
Current version
J. Moringen, 09/25/2011 01:24 PM
initial version
bag-cat
¶
Introduction¶
Like UNIX cat
, the bag-cat
program makes a stream of data available on its standard output stream. Unlike UNIX cat
, the data is obtained by processing log files.
See bag-record for recording and bag-play for replaying events from log files.
Obtaining bag-cat
¶
Binaries of the bag-cat
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-cat
file has to be made executable in most cases. This can be done for example by executing
chmod +x bag-cat
in the download directory.
Checking Versions and Displaying Help¶
Version and help information is displayed when the --version
and --help[-all]
commandline options are specified:
./bag-cat --version ./bag-cat --help ./bag-cat --help-all
The output of --help[-all]
includes a list of supported file formats.
Printing the Contents of Log Files¶
When invoked with a log file, bag-cat
prints the contents of one or more channels to its standard output stream. This is probably most useful for channels containing textual data, since binary content usually requires a form of decoding.
Example:
./bag-cat isr.tide | head <sr db_start="80" db_utt="80" /> <sr db_start="45" db_utt="46" /> <?xml version="1.0" encoding="UTF-8" standalone="no" ?><speech_hyp [...] <?xml version="1.0" encoding="UTF-8" standalone="no" ?><speech_hyp [...] <?xml version="1.0" encoding="UTF-8" standalone="no" ?><speech_hyp [...] <?xml version="1.0" encoding="UTF-8" standalone="no" ?><speech_hyp [...] <?xml version="1.0" encoding="UTF-8" standalone="no" ?><speech_hyp [...] <speech_hyp xmlns:bxml="http://www.sleepycat.com/2002/dbxml" [...] <TIMESTAMP>1290275288296</TIMESTAMP>
Selecting Channels for Playback¶
The default behavior of bag-cat
is to print the contents of all channels found in the given file. However, when only a subset of the recorded channels should be printed, the --channel
(-c
) commandline option can be used to select channels. The following example prints the contents all channels matching one of the regular expressions "hyp" and "param".
./bag-cat -c 'hyp' -c 'param' /tmp/nao.tide
Caveats¶
- Individual entries can no longer be distinguished (unless some in-band properties permit this)
- If multiple channels are printed, the channel from which a given part of the output originated is no longer apparent (unless some in-band properties allow determining this)
- Printing channels which contain binary to a terminal content may mess up the terminal and cause all sorts of mayhem