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

SourceForge.net Logo
Project
Download
Mailing lists

 

         

LogRecorder
[UtilitiesStand-Alone ComponentsIceBox ServicesC++Linux]

Logs data and configurations from interfaces. More...

Logs data and configurations from interfaces.

Provides
  • orca_interface_home
  • orca_interface_status
  • orca_interface_tracer
Requires (any number and combination of the following)
  • orca_interface_camera [LogRecorder.Requires.CameraX]
  • orca_interface_cpu [LogRecorder.Requires.CpuX]
  • orca_interface_drivebicycle [LogRecorder.Requires.DriveBicycleX]
  • orca_interface_gps [LogRecorder.Requires.GpsX]
  • orca_interface_laserscanner2d [LogRecorder.Requires.LaserScanner2dX]
  • orca_interface_localise2d [LogRecorder.Requires.Localise2dX]
  • orca_interface_localise3d [LogRecorder.Requires.Localise3dX]
  • orca_interface_polarfeature2d [LogRecorder.Requires.PolarFeature2dX]
  • orca_interface_odometry2d [LogRecorder.Requires.Odometry2dX]
  • orca_interface_odometry3d [LogRecorder.Requires.Odometry3dX]
  • orca_interface_power [LogRecorder.Requires.PowerX]
logrecorder.png
Operation

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().

See also:
LogPlayer
Configuration

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)
    • A space-separated list of libraries containing logwriter factories.
    • This list is ordered. Putting a custom library earlier in the list means that it will be used to instantiate loggers before later factories.
    • Default: libOrcaLogFactory.so
  • LogRecorder.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 logrecorder.
    • Default: 1
  • LogRecorder.Config.<interfaceType><number>.Format (string)
    • Specifies the encoding format for the log file
    • Valid values: common formats: {'ice', 'asciigenerated', '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. The 'asciigenerated' format is human-readable and easily replayable (the code for log-writing/-reading is automatically generated from slice files see slice2log). The disadvantage compared to 'ice' is higher bandwidth/disk requirements. However, 'asciigenerated' is currently experimental and not well tested. See "Details for specific interfaces" below for supported formats for individual interfaces.
    • Default: 'ice'
    • Example: LogRecorder.Config.Laser0.Format=ascii
Logfile Format

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

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 logwriters

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

  1. Create a MyInterfaceLogWriter class which inherits from orcalog::LogWriter 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/defaultlogautologgerfactory.cpp
  3. Update this documentation page.

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)


Generated for Orca Robotics by  doxygen 1.4.5