gusimplewhiteboard
wb_data_logger Struct Reference

WHITEBOARD_POSTER_STRING_CONVERSION. More...

#include <wb_data_logger.h>

Inheritance diagram for wb_data_logger:
Collaboration diagram for wb_data_logger:

Public Attributes

char machineName [40]
 Name of the machine being monitored, but could be anything. More...
 
uint32_t currentState
 The machine's currently executing state (use integer rather than the state's name) More...
 
uint32_t currentSection
 Section within the state (e.g. More...
 
uint8_t dataSet
 Enables selection of a data set to be logged (default = 0, joints and sensors) (NYI) More...
 
bool loggerRunning
 Starts/Stops logging. More...
 
bool shouldExit
 Switch to cause DataLogger to exit. More...
 
char comment [30]
 Comment to be attached to the logged data (NYI) More...
 

Detailed Description

WHITEBOARD_POSTER_STRING_CONVERSION.

General purpose data logger controller: Whilst the comments above refer to monitoring running machines, the DataLogger can be used to record the robot's sensors in any appropriate situation.

The current implementation of the DataLogger captures (see 'nao/utilities/datalogger/datalog.h'): currentState, currentSection, relative DCM Time (expressed as an uint32_t), Joint positions, Inertial sensors within the torso, and Pressure sensors on feet.

The DataLogger does not record sonar returns nor button presses. The DataLogger does not record joint temperatures, nor the current flowing through them.

Initialisation: DataLogger posts an initialisation DataLogger message to the WB on start-up, overwritting what's there.

DCM Time: The recorded DCM Time is relative to the initial DCM time of the log run. If absolute values are required, add the timestamp in the output file's name to the dcmTime sample value.

MAX_LOG_POINTS (See nao/utilities/datalogger/dataLogger.cc) The current implementation allows recording up to 100 seconds (at 10mS/sample) of data at a time.

CurrentSection: In states where there is a recurring internal section, the DataLogger will most likely record a value for this field that is assigned within the internal section, unless the onEntry or onExit section's execution time is long enough for the DataLogger to sample it. Thus, the CurrentSection can be used to record internal states within the internal section. Like decisions

Output File: The output file is written to /tmp using the following naming convention: (MachineName)-(DCM-TimeStampAtStartOfLogRun).csv Since the output file's name is set when commencing to write the data to disk, the output file is named after the machineName string contained in the most recent DataLogger WB message. The output file is a CSV file (delimited using semi-colons) where the 1st line represents the headers for each data column, and succeeding lines represent the data collected at each sample. Succeeding lines always begin with a sample number (starting with zero (0)) that increments by one for each sample. There are no trailing semi-colons at the end of each line.

The output file is written when: 1) "loggerRunning" is set back to false or 2) MAX_LOG_POINTS (see dataLogger.cc code) have been recorded, or 3) shouldExit is set to true and there is accumulated data.

Resources: The DataLogger reserves an array 10K * size_of(DataLogStruct) on start-up and re-uses that memory across runs. The DataLogger, when idle, polls selected Event Counters every 5mSec and sleeps in-between. The DataLogger, when running, in addition to the above, records one sample every 10mSec.

Observation of DataLogger resource usage while running TOP indicates that when the Datalogger is: idle/collecting data : 1% of CPU and 0.2% of memory are used, saving the data to file : about 20% of the CPU is used.

Running/Exiting: The DataLogger is controlled entirely through the DataLogger WB message. The DataLogger can be run in the background if desired using the '&' token. In order to terminate a DataLogger instance that's running in the background, the user should post 'shouldExit=true' to the DataLogger WB message. This will signal the DataLogger to stop recording further data, save existing data to the output file, and exit. Upon exiting, the DataLogger notifies users that it's terminated using the Linux 'wall' command.

Definition at line 155 of file wb_data_logger.h.

Member Data Documentation

◆ comment

◆ currentSection

uint32_t wb_data_logger::currentSection

Section within the state (e.g.

0 = onEntry, 1 = onExit, 2 = Internal). See comments below.

Definition at line 171 of file wb_data_logger.h.

Referenced by guWhiteboard::DataLogger::DataLogger(), guWhiteboard::DataLogger::currentSection(), guWhiteboard::DataLogger::operator=(), guWhiteboard::DataLogger::set_currentSection(), and wb_data_logger_from_network_serialised().

◆ currentState

uint32_t wb_data_logger::currentState

◆ dataSet

uint8_t wb_data_logger::dataSet

Enables selection of a data set to be logged (default = 0, joints and sensors) (NYI)

Definition at line 176 of file wb_data_logger.h.

Referenced by guWhiteboard::DataLogger::DataLogger(), guWhiteboard::DataLogger::dataSet(), guWhiteboard::DataLogger::operator=(), guWhiteboard::DataLogger::set_dataSet(), and wb_data_logger_from_network_serialised().

◆ loggerRunning

◆ machineName

char wb_data_logger::machineName[40]

Name of the machine being monitored, but could be anything.

This string is used to name the output file, and if its an empty string, the filename defaults to "NoName".

Definition at line 161 of file wb_data_logger.h.

Referenced by guWhiteboard::DataLogger::DataLogger(), guWhiteboard::DataLogger::from_string(), guWhiteboard::DataLogger::machineName(), guWhiteboard::DataLogger::operator=(), guWhiteboard::DataLogger::set_machineName(), and wb_data_logger_from_network_serialised().

◆ shouldExit

bool wb_data_logger::shouldExit

Switch to cause DataLogger to exit.

DataLogger resets this bit back to false while exiting.

Definition at line 186 of file wb_data_logger.h.

Referenced by guWhiteboard::DataLogger::DataLogger(), guWhiteboard::DataLogger::operator=(), guWhiteboard::DataLogger::set_shouldExit(), guWhiteboard::DataLogger::shouldExit(), and wb_data_logger_from_network_serialised().


The documentation for this struct was generated from the following file: