0.4.1
Loading...
Searching...
No Matches
NAV::experimental::ARMA Class Reference

Node performing an ARMA filtering of incoming data. More...

Public Member Functions

 ARMA ()
 Default constructor.
 
 ARMA (ARMA &&)=delete
 Move constructor.
 
 ARMA (const ARMA &)=delete
 Copy constructor.
 
void guiConfig () override
 ImGui config window which is shown on double click.
 
ARMAoperator= (ARMA &&)=delete
 Move assignment operator.
 
ARMAoperator= (const ARMA &)=delete
 Copy assignment operator.
 
void restore (const json &j) override
 Restores the node from a json object.
 
json save () const override
 Saves the node into a json object.
 
std::string type () const override
 String representation of the Class Type.
 
 ~ARMA () override
 Destructor.
 
- Public Member Functions inherited from NAV::Node
virtual void afterCreateLink (OutputPin &startPin, InputPin &endPin)
 Called when a new link was established.
 
virtual void afterDeleteLink (OutputPin &startPin, InputPin &endPin)
 Called when a link was deleted.
 
bool doDeinitialize (bool wait=false)
 Asks the node worker to deinitialize the node.
 
bool doDisable (bool wait=false)
 Asks the node worker to disable the node.
 
bool doEnable ()
 Enable the node.
 
bool doInitialize (bool wait=false)
 Asks the node worker to initialize the node.
 
bool doReinitialize (bool wait=false)
 Asks the node worker to reinitialize the node.
 
virtual void flush ()
 Function called by the flow executer after finishing to flush out remaining data.
 
template<typename T>
std::optional< InputPin::IncomingLink::ValueWrapper< T > > getInputValue (size_t portIndex) const
 Get Input Value connected on the pin. Only const data types.
 
Mode getMode () const
 Get the current mode of the node.
 
const ImVec2 & getSize () const
 Get the size of the node.
 
State getState () const
 Get the current state of the node.
 
bool hasInputPinWithSameTime (const InsTime &insTime) const
 Checks wether there is an input pin with the same time.
 
InputPininputPinFromId (ax::NodeEditor::PinId pinId)
 Returns the pin with the given id.
 
size_t inputPinIndexFromId (ax::NodeEditor::PinId pinId) const
 Returns the index of the pin.
 
void invokeCallbacks (size_t portIndex, const std::shared_ptr< const NodeData > &data)
 Calls all registered callbacks on the specified output port.
 
bool isDisabled () const
 Checks if the node is disabled.
 
bool isInitialized () const
 Checks if the node is initialized.
 
bool isOnlyRealtime () const
 Checks if the node is only working in real time (sensors, network interfaces, ...)
 
bool isTransient () const
 Checks if the node is changing its state currently.
 
std::string nameId () const
 Node name and id.
 
 Node (const Node &)=delete
 Copy constructor.
 
 Node (Node &&)=delete
 Move constructor.
 
 Node (std::string name)
 Constructor.
 
void notifyOutputValueChanged (size_t pinIdx, const InsTime &insTime, const std::scoped_lock< std::mutex > &&guard)
 Notifies connected nodes about the change.
 
virtual bool onCreateLink (OutputPin &startPin, InputPin &endPin)
 Called when a new link is to be established.
 
virtual void onDeleteLink (OutputPin &startPin, InputPin &endPin)
 Called when a link is to be deleted.
 
Nodeoperator= (const Node &)=delete
 Copy assignment operator.
 
Nodeoperator= (Node &&)=delete
 Move assignment operator.
 
OutputPinoutputPinFromId (ax::NodeEditor::PinId pinId)
 Returns the pin with the given id.
 
size_t outputPinIndexFromId (ax::NodeEditor::PinId pinId) const
 Returns the index of the pin.
 
void releaseInputValue (size_t portIndex)
 Unblocks the connected node. Has to be called when the input value should be released and getInputValue was not called.
 
std::scoped_lock< std::mutex > requestOutputValueLock (size_t pinIdx)
 Blocks the thread till the output values was read by all connected nodes.
 
virtual bool resetNode ()
 Resets the node. It is guaranteed that the node is initialized when this is called.
 
virtual void restoreAtferLink (const json &j)
 Restores link related properties of the node from a json object.
 
void wakeWorker ()
 Wakes the worker thread.
 
virtual ~Node ()
 Destructor.
 

Static Public Member Functions

static std::string category ()
 String representation of the Class Category.
 
static std::string typeStatic ()
 String representation of the Class Type.
 
- Static Public Member Functions inherited from NAV::Node
static std::string toString (State state)
 Converts the state into a printable text.
 

Private Member Functions

void deinitialize () override
 Deinitialize the node.
 
bool initialize () override
 Initialize the node.
 
void receiveImuObs (InputPin::NodeDataQueue &queue, size_t pinIdx)
 Receive Sensor Data.
 

Static Private Member Functions

static void acf_function (Eigen::VectorXd &y, int p, Eigen::VectorXd &acf)
 calculate autocorrelation function (ACF)
 
static void hannan_rissanen (Eigen::VectorXd &y, int p, int q, int m, int deque_size, Eigen::VectorXd &x, Eigen::VectorXd &emp_sig, Eigen::VectorXd &y_hat)
 Calculate ARMA parameters through Hannan-Rissanen.
 
static void matrix_function (Eigen::VectorXd &y, Eigen::VectorXd &e_hat, int p, int q, int m, Eigen::MatrixXd &A)
 fill A matrix for least squares
 
static void pacf_function (Eigen::VectorXd &y, Eigen::VectorXd &acf, int p, Eigen::VectorXd &pacf, Eigen::VectorXd &e_hat_initial)
 calculate partial autocorrelation function (PACF) via Durbin-Levinson
 

Private Attributes

std::deque< std::shared_ptr< const ImuObs > > _buffer
 Buffer used to store Imu observations.
 
int _deque_size
 modelling size
 
Eigen::VectorXd _emp_sig
 empirical significance (p-Value) of parameters
 
int _k
 loop iterator
 
int _m
 value of superior order (p or q)
 
int _num_obs
 number of observations (3-axis accelerometer / 3-axis gyro)
 
int _p
 AR order.
 
int _p_mem
 p memory to reset for each observation
 
int _q
 MA order.
 
int _q_mem
 q memory to reset for each observation
 
Eigen::VectorXd _x
 ARMA slope parameters.
 
Eigen::MatrixXd _y
 measurement data
 
Eigen::VectorXd _y_hat
 ARMA estimates for y_rbm.
 
Eigen::VectorXd _y_hat_t
 output container
 
double _y_mean
 y-mean
 
Eigen::VectorXd _y_rbm
 y (reduced by mean)
 
bool INITIALIZE
 parameter initialization indicator
 

Static Private Attributes

static constexpr size_t INPUT_PORT_INDEX_IMU_OBS
 Flow (ImuObs)
 
static constexpr size_t OUTPUT_PORT_INDEX_IMU_OBS
 Flow (ImuObs)
 

Additional Inherited Members

- Public Types inherited from NAV::Node
enum class  Mode : uint8_t {
  REAL_TIME ,
  POST_PROCESSING
}
 Different Modes the Node can work in. More...
 
enum class  State : uint8_t {
  Disabled ,
  Deinitialized ,
  DoInitialize ,
  Initializing ,
  Initialized ,
  DoDeinitialize ,
  Deinitializing ,
  DoShutdown ,
  Shutdown
}
 Possible states of the node. More...
 
- Data Fields inherited from NAV::Node
bool callbacksEnabled
 Enables the callbacks.
 
ax::NodeEditor::NodeId id
 Unique Id of the Node.
 
std::vector< InputPininputPins
 List of input pins.
 
Kind kind
 Kind of the Node.
 
std::string name
 Name of the Node.
 
std::vector< OutputPinoutputPins
 List of output pins.
 
std::multimap< InsTime, std::pair< OutputPin *, size_t > > pollEvents
 Map with callback events (sorted by time)
 
- Protected Attributes inherited from NAV::Node
ImVec2 _guiConfigDefaultWindowSize
 
bool _hasConfig
 Flag if the config window should be shown.
 
bool _lockConfigDuringRun
 Lock the config when executing post-processing.
 
bool _onlyRealTime
 Whether the node can run in post-processing or only real-time.
 

Detailed Description

Node performing an ARMA filtering of incoming data.

Definition at line 27 of file ARMA.hpp.

Constructor & Destructor Documentation

◆ ARMA() [1/3]

NAV::experimental::ARMA::ARMA ( )

Default constructor.

Definition at line 20 of file ARMA.cpp.

◆ ~ARMA()

NAV::experimental::ARMA::~ARMA ( )
override

Destructor.

Definition at line 32 of file ARMA.cpp.

◆ ARMA() [2/3]

NAV::experimental::ARMA::ARMA ( const ARMA & )
delete

Copy constructor.

◆ ARMA() [3/3]

NAV::experimental::ARMA::ARMA ( ARMA && )
delete

Move constructor.

Member Function Documentation

◆ acf_function()

void NAV::experimental::ARMA::acf_function ( Eigen::VectorXd & y,
int p,
Eigen::VectorXd & acf )
staticprivate

calculate autocorrelation function (ACF)

Parameters
[in]yvector of data
[in]porder of AR process
[out]acfvector of acf values

Definition at line 145 of file ARMA.cpp.

◆ category()

std::string NAV::experimental::ARMA::category ( )
staticnodiscard

String representation of the Class Category.

Definition at line 47 of file ARMA.cpp.

◆ deinitialize()

void NAV::experimental::ARMA::deinitialize ( )
overrideprivatevirtual

Deinitialize the node.

Reimplemented from NAV::Node.

Definition at line 140 of file ARMA.cpp.

◆ guiConfig()

void NAV::experimental::ARMA::guiConfig ( )
overridevirtual

ImGui config window which is shown on double click.

Attention
Don't forget to set _hasConfig to true in the constructor of the node

Reimplemented from NAV::Node.

Definition at line 52 of file ARMA.cpp.

◆ hannan_rissanen()

void NAV::experimental::ARMA::hannan_rissanen ( Eigen::VectorXd & y,
int p,
int q,
int m,
int deque_size,
Eigen::VectorXd & x,
Eigen::VectorXd & emp_sig,
Eigen::VectorXd & y_hat )
staticprivate

Calculate ARMA parameters through Hannan-Rissanen.

Parameters
[in]yvector of data
[in]porder of AR process
[in]qorder of MA process
[in]mvalue of superior order (p or q)
[in]deque_sizeSize of the deque
[out]xARMA slope parameters
[out]emp_sigEmpirical significance (p-Value) of parameters
[out]y_hatOutput measurement data

Definition at line 265 of file ARMA.cpp.

◆ initialize()

bool NAV::experimental::ARMA::initialize ( )
overrideprivatevirtual

Initialize the node.

Reimplemented from NAV::Node.

Definition at line 118 of file ARMA.cpp.

◆ matrix_function()

void NAV::experimental::ARMA::matrix_function ( Eigen::VectorXd & y,
Eigen::VectorXd & e_hat,
int p,
int q,
int m,
Eigen::MatrixXd & A )
staticprivate

fill A matrix for least squares

Parameters
[in]yvector of data
[in]e_hatresiduals
[in]porder of AR process
[in]qorder of MA process
[in]mvalue of superior order (p or q)
[out]AReturns the matrix filled with least squares

Definition at line 250 of file ARMA.cpp.

◆ operator=() [1/2]

ARMA & NAV::experimental::ARMA::operator= ( ARMA && )
delete

Move assignment operator.

◆ operator=() [2/2]

ARMA & NAV::experimental::ARMA::operator= ( const ARMA & )
delete

Copy assignment operator.

◆ pacf_function()

void NAV::experimental::ARMA::pacf_function ( Eigen::VectorXd & y,
Eigen::VectorXd & acf,
int p,
Eigen::VectorXd & pacf,
Eigen::VectorXd & e_hat_initial )
staticprivate

calculate partial autocorrelation function (PACF) via Durbin-Levinson

Parameters
[in]yvector of data
[in]acfvector of acf
[in]porder of AR process
[out]pacfvector of pacf values
[out]e_hat_initialvector of initial ê for Hannan-Rissanen

Definition at line 174 of file ARMA.cpp.

◆ receiveImuObs()

void NAV::experimental::ARMA::receiveImuObs ( InputPin::NodeDataQueue & queue,
size_t pinIdx )
private

Receive Sensor Data.

Parameters
[in]queueQueue with all the received data messages
[in]pinIdxIndex of the pin the data is received on

Definition at line 314 of file ARMA.cpp.

◆ restore()

void NAV::experimental::ARMA::restore ( const json & j)
overridevirtual

Restores the node from a json object.

Parameters
[in]jJson object with the node state

Reimplemented from NAV::Node.

Definition at line 100 of file ARMA.cpp.

◆ save()

json NAV::experimental::ARMA::save ( ) const
nodiscardoverridevirtual

Saves the node into a json object.

Reimplemented from NAV::Node.

Definition at line 87 of file ARMA.cpp.

◆ type()

std::string NAV::experimental::ARMA::type ( ) const
nodiscardoverridevirtual

String representation of the Class Type.

Implements NAV::Node.

Definition at line 42 of file ARMA.cpp.

◆ typeStatic()

std::string NAV::experimental::ARMA::typeStatic ( )
staticnodiscard

String representation of the Class Type.

Definition at line 37 of file ARMA.cpp.

Field Documentation

◆ _buffer

std::deque<std::shared_ptr<const ImuObs> > NAV::experimental::ARMA::_buffer
private

Buffer used to store Imu observations.

Definition at line 113 of file ARMA.hpp.

◆ _deque_size

int NAV::experimental::ARMA::_deque_size
private

modelling size

Definition at line 123 of file ARMA.hpp.

◆ _emp_sig

Eigen::VectorXd NAV::experimental::ARMA::_emp_sig
private

empirical significance (p-Value) of parameters

Definition at line 129 of file ARMA.hpp.

◆ _k

int NAV::experimental::ARMA::_k
private

loop iterator

Definition at line 116 of file ARMA.hpp.

◆ _m

int NAV::experimental::ARMA::_m
private

value of superior order (p or q)

Definition at line 136 of file ARMA.hpp.

◆ _num_obs

int NAV::experimental::ARMA::_num_obs
private

number of observations (3-axis accelerometer / 3-axis gyro)

Definition at line 124 of file ARMA.hpp.

◆ _p

int NAV::experimental::ARMA::_p
private

AR order.

Definition at line 120 of file ARMA.hpp.

◆ _p_mem

int NAV::experimental::ARMA::_p_mem
private

p memory to reset for each observation

Definition at line 133 of file ARMA.hpp.

◆ _q

int NAV::experimental::ARMA::_q
private

MA order.

Definition at line 121 of file ARMA.hpp.

◆ _q_mem

int NAV::experimental::ARMA::_q_mem
private

q memory to reset for each observation

Definition at line 134 of file ARMA.hpp.

◆ _x

Eigen::VectorXd NAV::experimental::ARMA::_x
private

ARMA slope parameters.

Definition at line 130 of file ARMA.hpp.

◆ _y

Eigen::MatrixXd NAV::experimental::ARMA::_y
private

measurement data

Definition at line 126 of file ARMA.hpp.

◆ _y_hat

Eigen::VectorXd NAV::experimental::ARMA::_y_hat
private

ARMA estimates for y_rbm.

Definition at line 128 of file ARMA.hpp.

◆ _y_hat_t

Eigen::VectorXd NAV::experimental::ARMA::_y_hat_t
private

output container

Definition at line 131 of file ARMA.hpp.

◆ _y_mean

double NAV::experimental::ARMA::_y_mean
private

y-mean

Definition at line 137 of file ARMA.hpp.

◆ _y_rbm

Eigen::VectorXd NAV::experimental::ARMA::_y_rbm
private

y (reduced by mean)

Definition at line 127 of file ARMA.hpp.

◆ INITIALIZE

bool NAV::experimental::ARMA::INITIALIZE
private

parameter initialization indicator

Definition at line 118 of file ARMA.hpp.

◆ INPUT_PORT_INDEX_IMU_OBS

size_t NAV::experimental::ARMA::INPUT_PORT_INDEX_IMU_OBS
staticconstexprprivate

Flow (ImuObs)

Definition at line 64 of file ARMA.hpp.

◆ OUTPUT_PORT_INDEX_IMU_OBS

size_t NAV::experimental::ARMA::OUTPUT_PORT_INDEX_IMU_OBS
staticconstexprprivate

Flow (ImuObs)

Definition at line 65 of file ARMA.hpp.


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