delphyne
DataLogger Class Reference

Detailed Description

A class for simulation data logging.

This class mainly logs all ignition transport topics traffic, but it can also log scene mesh geometries.

Log files (with '.dz' extension) are glorified zip files containing both an ignition transport topic log file and a bundled package image (see utility::BundledPackage class documentation) with captured meshes, if any.

#include <src/backend/data_logger.h>

Public Member Functions

 DELPHYNE_NO_COPY_NO_MOVE_NO_ASSIGN (DataLogger)
 
 DataLogger ()=default
 
 ~DataLogger ()
 
void Sync (const ignition::transport::Clock *clock)
 Synchronizes data logging with the given clock. More...
 
void Start (const std::string &filename)
 Starts data logging, to be bundled into filename (plus the '.dz' extension). More...
 
void CaptureMeshes (const ignition::msgs::Scene &scene_msg)
 Logs all meshes found in the given scene_msg to support later visualization during reproduction. More...
 
void Stop ()
 Stops ongoing logging activity and bundles all logged data. More...
 
bool is_logging () const
 Whether the logger is currently logging or not. More...
 
const std::string & logpath () const
 Returns the current log archive filename. More...
 

Constructor & Destructor Documentation

◆ DataLogger()

DataLogger ( )
default

◆ ~DataLogger()

~DataLogger ( )

Member Function Documentation

◆ CaptureMeshes()

void CaptureMeshes ( const ignition::msgs::Scene &  scene_msg)

Logs all meshes found in the given scene_msg to support later visualization during reproduction.

Parameters
[in]scene_msgScene message containing meshes.
Exceptions
std::runtime_errorif the logger is not running already (i.e. is_logging() is false).
std::runtime_errorif it fails to capture a mesh (
See also
utility::BundledPackage::Add).

◆ DELPHYNE_NO_COPY_NO_MOVE_NO_ASSIGN()

DELPHYNE_NO_COPY_NO_MOVE_NO_ASSIGN ( DataLogger  )

◆ is_logging()

bool is_logging ( ) const

Whether the logger is currently logging or not.

◆ logpath()

const std::string& logpath ( ) const

Returns the current log archive filename.

◆ Start()

void Start ( const std::string &  filename)

Starts data logging, to be bundled into filename (plus the '.dz' extension).

Given filename can be either an absolute path or a relative path, which are resolved against the default log location: $DELPHYNE_LOGS_PATH/logs, $HOME/.delphyne/logs or /tmp/delphyne/logs in order, based on envvar availability.

Parameters
[in]filenameLog file name.
Exceptions
std::runtime_errorif the logger is running already (i.e. is_logging() is true).
std::runtime_errorif it fails to setup any associated files in the filesystem.
std::runtime_errorif it cannot start logging topic messages.

◆ Stop()

void Stop ( )

Stops ongoing logging activity and bundles all logged data.

Exceptions
std::runtime_errorif the logger is not running already (i.e. is_logging() is false).

◆ Sync()

void Sync ( const ignition::transport::Clock *  clock)

Synchronizes data logging with the given clock.

Exceptions
std::runtime_errorif clock is nullptr.
std::runtime_errorif the logger is running already (i.e. is_logging() is true).
std::runtime_errorif it fails to synchronize with the given clock.

The documentation for this class was generated from the following files: