General signal target to store incoming signals for post-processing. More...
#include <common_signal_target.h>
Classes | |
struct | SignalGroup |
Tree node containing a group of signals and a set of child tree nodes. More... | |
Public Types | |
using | Ptr = std::shared_ptr< CommonSignalTarget > |
Virtual destructor. More... | |
![]() | |
using | Ptr = std::shared_ptr< SignalTargetInterface > |
Public Member Functions | |
void | clear () |
Erase stored signals. More... | |
SignalGroup * | getGroup (const std::string &full_group_name) |
SignalInterface::Ptr | getSignal (const std::string &full_signal_name) |
const SignalGroup & | getSignals () const |
Retrieve read-only-access to the underlying signal-tree. More... | |
SignalGroup & | getSignalsRef () |
bool | isEmpty () |
void | registerMeasurement (const std::string &, int, const std::vector< std::string > &={}, bool zero_order_hold=false) override |
Register a measurement type at current target. More... | |
void | registerTimeSeries (const std::string &, int, bool zero_order_hold=false) override |
Register a time series type at current target. More... | |
void | removeSignal (const std::string &name) |
void | sendIndexedValues (IndexedValuesSignal::Ptr indexed_values) override |
Send signal containing values indexed by a single integer. More... | |
void | sendIndexedValuesSet (IndexedValuesSetSignal::Ptr indexed_values_set) override |
Send signal containing a set of values indexed by integers (int to double[] map) More... | |
void | sendMatrix (MatrixSignal::Ptr matrix) override |
Send a matrix to the target. More... | |
void | sendMeasurement (Measurement::ConstPtr measurement) override |
Send a measurement to the target. More... | |
void | sendTimeSeries (TimeSeriesSignal::Ptr time_series) override |
Send a time series to the target. More... | |
void | setTopLevelGroupName (const std::string &name) |
virtual | ~CommonSignalTarget () |
![]() | |
virtual void | sendIndexedValues (const std::string &unique_name, int index, const std::vector< double > &values) |
Send signal containing values indexed by a single integer. More... | |
virtual void | sendIndexedValues (const std::string &unique_name, int index, const Eigen::Ref< const Eigen::VectorXd > &values) |
Send signal containing values indexed by a single integer. More... | |
virtual void | sendMatrix (const std::string &unique_name, const Eigen::Ref< const Eigen::MatrixXd > &matrix, const std::string &label="") |
Send a matrix to the target. More... | |
virtual void | sendMeasurement (const std::string &unique_name, double time, const std::vector< double > &values, const std::vector< std::string > &value_labels={}) |
Send a measurement to the target. More... | |
virtual void | sendMeasurement (const std::string &unique_name, double time, const Eigen::Ref< const Eigen::VectorXd > &values, const std::vector< std::string > &value_labels={}) |
Send a measurement to the target. More... | |
virtual void | sendTimeSeries (const std::string &unique_name, TimeSeries::Ptr time_series) |
Send a time series to the target. More... | |
virtual | ~SignalTargetInterface () |
Virtual destructor. More... | |
Protected Member Functions | |
SignalGroup * | expandGroups (const std::string full_signal_name, std::string *signal_name_out=nullptr, SignalInterface::Ptr *signal=nullptr) |
Parse full signal name, create tree-sub-groups if not found and return related signal group. More... | |
Private Attributes | |
SignalGroup | _signals |
Root element of the signal tree. More... | |
General signal target to store incoming signals for post-processing.
Signals are stored into an internal tree structure according to their namespaces/groups (refer to SignalInterface for a description of signal namespaces). These signals are then available for any post-processing purposes or file export.
Definition at line 53 of file common_signal_target.h.
using corbo::CommonSignalTarget::Ptr = std::shared_ptr<CommonSignalTarget> |
Virtual destructor.
Definition at line 67 of file common_signal_target.h.
|
inlinevirtual |
Definition at line 68 of file common_signal_target.h.
void corbo::CommonSignalTarget::clear | ( | ) |
Erase stored signals.
Definition at line 320 of file common_signal_target.cpp.
|
protected |
Parse full signal name, create tree-sub-groups if not found and return related signal group.
This methods parses the provded signal name and expands the tree according to the signal namespaces/groups. The signal is not added to its corresponding group in the tree yet, but a pointer to its lowest containing group is returned.
[in] | full_signal_name | Signal name containing all namespaces (separated by '/'). |
[out] | signal_name_out | Signal name without preceding namespaces/groups [optional] |
[out] | signal | Retrieve a previous signal with the same identifier if any, otherwise return null [optional]. |
Definition at line 265 of file common_signal_target.cpp.
CommonSignalTarget::SignalGroup * corbo::CommonSignalTarget::getGroup | ( | const std::string & | full_group_name | ) |
Definition at line 199 of file common_signal_target.cpp.
SignalInterface::Ptr corbo::CommonSignalTarget::getSignal | ( | const std::string & | full_signal_name | ) |
Definition at line 232 of file common_signal_target.cpp.
|
inline |
Retrieve read-only-access to the underlying signal-tree.
Definition at line 109 of file common_signal_target.h.
|
inline |
Definition at line 111 of file common_signal_target.h.
|
inline |
Definition at line 103 of file common_signal_target.h.
|
inlineoverridevirtual |
Register a measurement type at current target.
A measurement is meant to represent a vector of floating point numbers at a specified point in time. Hence, targets might store measurements of the same type (unique_name) into a TimeSeries object in order to record the whole sequence for batch-processing or visualization.
[in] | unique_name | Identifier for the current streams of measurements (same type, but different time-stamps allowed). |
[in] | value_dimension | Dimension of the measurement vector (number of floating point values). |
[in] | value_labels | Labels for individual components of the measurement vector, e.g. for data export or plotting (axes labels). |
[in] | zero_order_hold | Specify whether the signal is intended to be holded (zero order hold) between two consecutive values. |
Implements corbo::SignalTargetInterface.
Definition at line 71 of file common_signal_target.h.
|
inlineoverridevirtual |
Register a time series type at current target.
A TimeSeries is meant to represent a sequence of value vectors or measurements.
The channel associated with unique_name
might be used to send a single TimeSeriesSignal or a stream of TimeSeriesSignal objects. Hence, targets might store signals of the same type (unique_name) into a collection of TimeSeries objects in order to record the whole sequence for batch-processing or visualization.
[in] | unique_name | Identifier for the current streams of measurements (same type, but different time-stamps allowed). |
[in] | value_dimension | Dimension of the measurement vector (number of floating point values). |
[in] | zero_order_hold | Specify whether the signal is intended to be holded (zero order hold) between two consecutive values. |
Implements corbo::SignalTargetInterface.
Definition at line 77 of file common_signal_target.h.
void corbo::CommonSignalTarget::removeSignal | ( | const std::string & | name | ) |
Definition at line 176 of file common_signal_target.cpp.
|
overridevirtual |
Send signal containing values indexed by a single integer.
[in] | indexed_values | IndexedValuesSignal object with valid header to be sent. |
Implements corbo::SignalTargetInterface.
Definition at line 92 of file common_signal_target.cpp.
|
overridevirtual |
Send signal containing a set of values indexed by integers (int to double[] map)
[in] | indexed_values_set | IndexedValuesSetSignal object with valid header to be sent. |
Implements corbo::SignalTargetInterface.
Definition at line 123 of file common_signal_target.cpp.
|
overridevirtual |
Send a matrix to the target.
[in] | time_series | TimeSeriesSignal object with valid header to be sent. |
Implements corbo::SignalTargetInterface.
Definition at line 145 of file common_signal_target.cpp.
|
overridevirtual |
Send a measurement to the target.
Refer to registerMeasurement() for a detailed description.
[in] | measurement | Measurement object with valid header to be sent. |
Implements corbo::SignalTargetInterface.
Definition at line 34 of file common_signal_target.cpp.
|
overridevirtual |
Send a time series to the target.
Refer to registerTimeSeries() for a detailed description.
[in] | time_series | TimeSeriesSignal object with valid header to be sent. |
Implements corbo::SignalTargetInterface.
Definition at line 65 of file common_signal_target.cpp.
|
inline |
Definition at line 94 of file common_signal_target.h.
|
private |
Root element of the signal tree.
Definition at line 135 of file common_signal_target.h.