orca-robotics


INTRODUCTION
Overview
Download and Install
Quick Start
Documentation
Publications

REPOSITORY
Interfaces
Components
Libraries
Utilities
Software Map

DEVELOPER
Tutorials
Examples
Dev Guide
Dashboard
Wiki
login/pass: orca/orca

PEOPLE
Contributors
Users

SourceForge.net Logo
Project
Download
Mailing lists

 

         

Logger
[UtilitiesStand-Alone ComponentsIceBox ServicesC++Linux]

Logs data and configurations from interfaces. More...
Provides

Requires (any number and combination of the following)

logger.png

Operation
The logger 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 logger instantiates an

Logger class that handles incoming data and writes them to one file each (e.g. for the 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().

See also:
LogPlayer
Configuration
To allow the setup of several interfaces of the same type in one logger, the interface tags are numbered in the configuration file. For example:

Logger.Requires.Laser0.Proxy=laserscanner2d@alpha/laser2d
Logger.Requires.Laser1.Proxy=laserscanner2d@bravo/laser2d
Logger.Requires.Odometry2d0.Proxy=odometry2d@local/segwayrmp

  • Logger.Config.FactoryLibNames (string)
    • A space-separated list of libraries containing slave factories.
    • This list is ordered. Putting a custom library earlier in the list means that it will be used to instantiate slaves before later factories.
    • Default: libOrcaLogFactory.so

  • Logger.Config.FilenameTimestamp (bool)
    • If set to one, creation timestamp is pre-pended to the filenames of the master and log files. Time stamp format is YYMMDD_HHMMSS, e.g. the default master file becomes 060804_153321_master.log. This is usful to avoid accidently overwriting the files when restarting the logger.
    • Default: 1

  • Logger.Config.<interfaceType><number>.Format (string)
    • Specifies the encoding format for the log file
    • Valid values: common formats: {'ice', 'ascii'}. When format is 'ice', the data is logged in binary form and can be easily played back. It is not human-readable however. The 'ascii' format is human-readable but requires parsing to be interpreted. See "Details for specific interfaces" below for supported formats for individual interfaces.
    • Default: 'ice'
    • Example: Logger.Config.Laser0.Format=ascii

Logfile Format
The logger 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 Logger supports two different encoding types {'ice', '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).

Details are given on a separate page: Orca log format

Details for specific interfaces
  • orcalogfactory::DriveBicycleLogger
  • orcalogfactory::LaserScanner2dLogger
  • orcalogfactory::Localise2dLogger
  • orcalogfactory::Localise3dLogger
  • orcalogfactory::Odometry2dLogger

Parsing log files
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

Authors
  • Tobias Kaupp, Alex Brooks, Alexei Makarenko

Writing custom loggers

In order to instantiate interface loggers, the Logger utility dynamically loads libraries using logger factory. New factories can be written for the interfaces which are not in the Orca distribution. This plug-in architecture allows custom loggers to be written outside of the Orca project.

The default logger factory can be extended with new interfaces, e.g. MyInterface by executing the following steps:

  1. Create a MyInterfaceSlave class which inherits from Slave and handles the interface-specific logging (e.g. streaming the data to the file).
  2. Add a few lines of code to [ORCA_SRC]/src/utils/orcalogfactory/defaultlogfactory.cpp
  3. If logging to an 'ascii' file, update the orca_component_logger_formats page (and if you want to parse the 'ascii' log file using Matlab, add a script called [ORCA_SRC]/scripts/matlab/logutils/parse<MyInterface>.m).
  4. Update this documentation page.

To add a new plug-in slave factory, use orcalogfactory as an example. Compile the new factory into a .so, stick it somewhere in your LD_LIBRARY_PATH, and edit Logger.Config.FactoryLibNames to point to it.

 

Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)


Generated for Orca Robotics by  doxygen 1.4.5