INTRODUCTION Overview Download and Install Quick Start Documentation Publications NONFRAMEWORK CODE Driver Interfaces Drivers Libraries Utilities FRAMEWORK CODE Interfaces Components Libraries Utilities Full Software Listings DEVELOPER Tutorials Examples Dev Guide Dashboard PEOPLE Contributors Users Project Download Mailing lists
|
LogRecorder
|
Logs data and configurations from interfaces.
The logrecorder logs data on a per-Slice-interface basis, i.e. it can connect to provided interfaces of components. For each interface defined in Orca2, the logrecorder instantiates an <Interface>LogRecorder class that handles incoming data and writes them to one file each (e.g. for the orca_interface_laserscanner2d interface, the LaserScanner2dLogger class writes data to laserscanner2d0.log). Data is received by either pulling data e.g. with getData() or by subscribing for data pushes e.g. with subscribe().
To allow the setup of several interfaces of the same type in one logrecorder, the interface tags are numbered in the configuration file. For example:
LogRecorder.Requires.Laser0.Proxy=laserscanner2d@alpha/laser2d LogRecorder.Requires.Laser1.Proxy=laserscanner2d@bravo/laser2d LogRecorder.Requires.Odometry2d0.Proxy=odometry2d@local/segwayrmp
LogRecorder.Config.FactoryLibNames
(string)LogRecorder.Config.FilenameTimestamp
(bool)LogRecorder.Config
.<interfaceType><number>.Format (string)LogRecorder.Config.Laser0.Format=ascii
The logrecorder writes a single master file containing all relevant information to replay the data using the LogPlayer. Example for a set of files (3 interfaces were logged on 04/08/06 at 15:33:21):
060804_153321_master.log 060804_153321_laserscanner0.log 060804_153321_laserscanner1.log 060804_153321_camera0.log
The first records in each subfile are configuration data, after that all records are "pure" data. Subfiles are named according to the interfaces you're logging and have a number attached in case you want to log the same interface type several times (e.g. when logging several lasers). Don't change the file names because they are also recorded in the corresponding master file.
Subfiles contain the logged data. The Orca LogRecorder supports three different encoding types {'ice', 'asciigenerated', 'ascii'} which can be configured on a per-interface basis. 'ice' produces binary files which are generated by Slice's built-in streaming functionality. The disadvantage is that they are not human-readable. 'ascii' produces human-readable ascii files but the streaming functions need to be implemented manually which is error-prone. They are useful because they can be easily parsed (e.g. using Matlab). The 'asciigenerated' format is intended as a safe (automatically generated) alternative to the manual 'ascii' format.
Details are given on a separate page: Orca log format
Log files in 'ice' format are not human-readable.
To parse the 'ascii' log files in Matlab, you can use the files provided in [ORCA_SRC]/scripts/matlab/logutils/parse<interfaceType>data.m. Usage information is provided through matlab help:
>> help parse<interfaceType>data
The default logrecorder factory can be extended with new interfaces, e.g. MyInterface
by executing the following steps:
MyInterfaceLogWriter
class which inherits from orcalog::LogWriter
and handles the interface-specific logging (e.g. streaming the data to the file).In order to instantiate interface logwriters, the LogRecorder utility dynamically loads libraries using logrecorder factories. New factories can be written for the interfaces which are not in the Orca distribution. This plug-in architecture allows logging data from interfaces which are part of an Orca satellite project.
To add a new plug-in logrecorder factory, use orcalogfactory as an example. Compile the new factory into a .so, stick it somewhere in your LD_LIBRARY_PATH, and edit LogRecorder.Config.FactoryLibNames to point to it.
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)