writelog
Drivers

Logging data. More...

Logging data.

The writelog driver will write data from another device to a log file. Each data message is written to a separate line. The format for the file is given in the data logging tutorial.

The readlog driver can be used to replay the data (to client programs, the replayed data will appear to come from the real sensors).

The writelog driver logs data independently of any client connections to the devices that it is logging. As long as it's enabled and recording, the writelog driver records data from the specified list of devices at the rate that new data is produced by the first device in that list (so put the fastest one first). Commands are not logged.

For help in remote-controlling logging, try playervcr. Note that you must declare a log device to allow logging control.

Note that unless you plan to remote-control this driver via the log interface (e.g., using playervcr), you should specify the `alwayson` option in the configuration file so that logging start when Player starts.

Compile-time dependencies

- none

Provides

- log : can be used to turn logging on/off

Requires

The writelog driver takes as input a list of devices to log data from. The driver with the highest data rate should be placed first in the list. The writelog driver can will log data from the following interfaces:

- laser
- ranger
- sonar
- position2d
- ptz
- wifi
- wsn
- opaque
- imu
- pointcloud3d
- actarray
- camera
- fiducial
- blobfinder
- gps
- joystick
- position3d
- power
- dio
- aio

Configuration requests

- PLAYER_LOG_REQ_SET_WRITE_STATE
- PLAYER_LOG_REQ_SET_STATE
- PLAYER_LOG_REQ_SET_FILENAME

Configuration file options
  - log_directory (string)
    - Default: Directory player is run from.
    - Name of the directory to store the log file in. Relative paths are taken from the directory player is run from. Absolute paths work as expected. The directory is created if it doesn't exist.
  - timestamp_directory (integer)
    - Default: 0
    - Add a timestamp to log_directory, in the format "YYYY_MM_DD_HH_MM_SS", where YYYY is the year, MM is the month, etc.
  - basename (string)
    - Default: "writelog_"
    - Base name of the log file.
  - timestamp (integer)
    - Default: 1
    - Add a timestamp to each file, in the format "YYYY_MM_DD_HH_MM_SS", where YYYY is the year, MM is the month, etc.
  - extension (string)
    - Default: ".log"
    - File extension for the log file.
  - filename (string)
    - Default: basename+timestamp+extension
    - Use this option to override the default basename/timestamp/extension combination and set your own arbitrary filename for the log.
  - autorecord (integer)
    - Default: 0
    - Default log state; set to 1 for continous logging.
  - camera_log_images (integer)
    - Default: 1
    - Save image data to the log file. If this is turned off, a log line is still generated for each frame, containing all information except the raw image data.
  - camera_save_images (integer)
    - Default: 0
    - Save image data to external files within the log directory. The image files are named "(basename)(timestamp)_camera_II_NNNNNNN.pnm", where II is the device index and NNNNNNN is the frame number.

Example

    # Log data from laser:0 position2d:0 to "/home/data/logs/mydata_YYYY_MM_DD_HH_MM_SS.log"
    driver
    (
      name "writelog"
      log_directory "/home/user/logs"
      basename "mydata"
      requires ["laser:0" "position2d:0"]
      provides ["log:0"]
      alwayson 1
      autorecord 1
    )

Author
  Andrew Howard, Radu Bogdan Rusu, Rich Mattes

Last updated 12 September 2005 21:38:45