0.2.0
Loading...
Searching...
No Matches
ARMA.hpp
Go to the documentation of this file.
1// This file is part of INSTINCT, the INS Toolkit for Integrated
2// Navigation Concepts and Training by the Institute of Navigation of
3// the University of Stuttgart, Germany.
4//
5// This Source Code Form is subject to the terms of the Mozilla Public
6// License, v. 2.0. If a copy of the MPL was not distributed with this
7// file, You can obtain one at https://mozilla.org/MPL/2.0/.
8
13
14#pragma once
15
17
18#include "util/Eigen.hpp"
19
21
22#include <deque>
23
24namespace NAV::experimental
25{
27class ARMA : public Node
28{
29 public:
33 ~ARMA() override;
35 ARMA(const ARMA&) = delete;
37 ARMA(ARMA&&) = delete;
39 ARMA& operator=(const ARMA&) = delete;
41 ARMA& operator=(ARMA&&) = delete;
42
44 [[nodiscard]] static std::string typeStatic();
45
47 [[nodiscard]] std::string type() const override;
48
50 [[nodiscard]] static std::string category();
51
54 void guiConfig() override;
55
57 [[nodiscard]] json save() const override;
58
61 void restore(const json& j) override;
62
63 private:
64 constexpr static size_t INPUT_PORT_INDEX_IMU_OBS = 0;
65 constexpr static size_t OUTPUT_PORT_INDEX_IMU_OBS = 0;
66
68 bool initialize() override;
69
71 void deinitialize() override;
72
76 void receiveImuObs(InputPin::NodeDataQueue& queue, size_t pinIdx);
77
82 static void acf_function(Eigen::VectorXd& y, int p, Eigen::VectorXd& acf);
83
90 static void pacf_function(Eigen::VectorXd& y, Eigen::VectorXd& acf, int p, Eigen::VectorXd& pacf, Eigen::VectorXd& e_hat_initial);
91
101 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);
102
110 static void matrix_function(Eigen::VectorXd& y, Eigen::VectorXd& e_hat, int p, int q, int m, Eigen::MatrixXd& A);
111
113 std::deque<std::shared_ptr<const ImuObs>> _buffer;
114
116 int _k = 0;
117
118 bool INITIALIZE = false;
119 // ARMA order
120 int _p = 2;
121 int _q = 2;
122
123 int _deque_size = 1000;
124 int _num_obs = 6;
125
126 Eigen::MatrixXd _y;
127 Eigen::VectorXd _y_rbm;
128 Eigen::VectorXd _y_hat;
129 Eigen::VectorXd _emp_sig;
130 Eigen::VectorXd _x;
131 Eigen::VectorXd _y_hat_t;
132
133 int _p_mem = 0;
134 int _q_mem = 0;
135
136 int _m = 0;
137 double _y_mean = 0;
138};
139
140} // namespace NAV::experimental
Vector space operations.
nlohmann::json json
json namespace
Definition FlowManager.hpp:21
Parent Class for all IMU Observations.
Node Class.
Abstract parent class for all nodes.
Definition Node.hpp:86
Node performing an ARMA filtering of incoming data.
Definition ARMA.hpp:28
~ARMA() override
Destructor.
void guiConfig() override
ImGui config window which is shown on double click.
ARMA(const ARMA &)=delete
Copy constructor.
ARMA & operator=(ARMA &&)=delete
Move assignment operator.
static std::string typeStatic()
String representation of the Class Type.
std::string type() const override
String representation of the Class Type.
ARMA(ARMA &&)=delete
Move constructor.
ARMA & operator=(const ARMA &)=delete
Copy assignment operator.
static std::string category()
String representation of the Class Category.
void restore(const json &j) override
Restores the node from a json object.
ARMA()
Default constructor.
json save() const override
Saves the node into a json object.