delphyne
|
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... | |
|
default |
~DataLogger | ( | ) |
void CaptureMeshes | ( | const ignition::msgs::Scene & | scene_msg | ) |
Logs all meshes found in the given scene_msg
to support later visualization during reproduction.
[in] | scene_msg | Scene message containing meshes. |
std::runtime_error | if the logger is not running already (i.e. is_logging() is false). |
std::runtime_error | if it fails to capture a mesh ( |
DELPHYNE_NO_COPY_NO_MOVE_NO_ASSIGN | ( | DataLogger | ) |
bool is_logging | ( | ) | const |
Whether the logger is currently logging or not.
const std::string& logpath | ( | ) | const |
Returns the current log archive filename.
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.
[in] | filename | Log file name. |
std::runtime_error | if the logger is running already (i.e. is_logging() is true). |
std::runtime_error | if it fails to setup any associated files in the filesystem. |
std::runtime_error | if it cannot start logging topic messages. |
void Stop | ( | ) |
Stops ongoing logging activity and bundles all logged data.
std::runtime_error | if the logger is not running already (i.e. is_logging() is false). |
void Sync | ( | const ignition::transport::Clock * | clock | ) |
Synchronizes data logging with the given clock
.
std::runtime_error | if clock is nullptr. |
std::runtime_error | if the logger is running already (i.e. is_logging() is true). |
std::runtime_error | if it fails to synchronize with the given clock . |