MemoryToDebugObserver Class Reference

Transfers data from memory servers to the DebugObserver. More...

#include <RobotAPI/libraries/armem/client/util/MemoryToDebugObserver.h>

Classes

struct  Properties
 Configuration. More...
 
struct  Services
 Required services. More...
 

Public Member Functions

 MemoryToDebugObserver (const Properties &properties, const Services &services)
 Constructor.
 
void pollOnce ()
 Query values from the memory and send them to the debug observer.
 
std::map< std::string, std::set< std::string > > pollOnce (const std::vector< MemoryValueID > &values)
 Query the given values from the memory and send them to the debug observer.
 

Static Public Member Functions

static std::vector< std::pair< std::string, double > > decomposeNDArray (const aron::data::NDArray &array, int maxSize=16)
 Decompose a numeric NDArray (vector, matrix, pose) into scalar datafields.
 
static std::string makeChannelName (const armem::MemoryID &memoryID)
 
static std::string makeDatafieldName (const aron::Path &path)
 

Detailed Description

Transfers data from memory servers to the DebugObserver.

Transfers data from the memory system to the Debug Observer, allowing to visualize them in the Live Plotter.

Definition at line 63 of file MemoryToDebugObserver.h.

Constructor & Destructor Documentation

◆ MemoryToDebugObserver()

MemoryToDebugObserver ( const Properties & properties,
const Services & services )

Constructor.

Definition at line 48 of file MemoryToDebugObserver.cpp.

Member Function Documentation

◆ decomposeNDArray()

std::vector< std::pair< std::string, double > > decomposeNDArray ( const aron::data::NDArray & array,
int maxSize = 16 )
static

Decompose a numeric NDArray (vector, matrix, pose) into scalar datafields.

Returns a list of (datafield name suffix, value) pairs to append to the base datafield name. Vectors use x/y/z/w (or indices), matrices use row/column indices, and 4x4 homogeneous transforms are converted to x, y, z and roll, pitch, yaw. Returns an empty list if the array is not a plottable numeric vector/matrix (e.g. an image).

Definition at line 252 of file MemoryToDebugObserver.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ makeChannelName()

std::string makeChannelName ( const armem::MemoryID & memoryID)
static

Definition at line 236 of file MemoryToDebugObserver.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ makeDatafieldName()

std::string makeDatafieldName ( const aron::Path & path)
static

Definition at line 242 of file MemoryToDebugObserver.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pollOnce() [1/2]

void pollOnce ( )

Query values from the memory and send them to the debug observer.

Definition at line 139 of file MemoryToDebugObserver.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pollOnce() [2/2]

std::map< std::string, std::set< std::string > > pollOnce ( const std::vector< MemoryValueID > & values)

Query the given values from the memory and send them to the debug observer.

Allows polling a dynamically changing set of values without reconstructing this object (and thereby keeping the cache of memory readers).

Returns
The datafields that were sent, grouped by channel name. Lets callers detect which datafields are no longer being sent (e.g. because a value was removed) and remove them.

Definition at line 145 of file MemoryToDebugObserver.cpp.

+ Here is the call graph for this function:

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