StateHelper.h
Go to the documentation of this file.
1 /*
2  * OpenVINS: An Open Platform for Visual-Inertial Research
3  * Copyright (C) 2018-2023 Patrick Geneva
4  * Copyright (C) 2018-2023 Guoquan Huang
5  * Copyright (C) 2018-2023 OpenVINS Contributors
6  * Copyright (C) 2018-2019 Kevin Eckenhoff
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <https://www.gnu.org/licenses/>.
20  */
21 
22 #ifndef OV_MSCKF_STATE_HELPER_H
23 #define OV_MSCKF_STATE_HELPER_H
24 
25 #include <Eigen/Eigen>
26 #include <memory>
27 
28 namespace ov_type {
29 class Type;
30 } // namespace ov_type
31 
32 namespace ov_msckf {
33 
34 class State;
35 
45 class StateHelper {
46 
47 public:
76  static void EKFPropagation(std::shared_ptr<State> state, const std::vector<std::shared_ptr<ov_type::Type>> &order_NEW,
77  const std::vector<std::shared_ptr<ov_type::Type>> &order_OLD, const Eigen::MatrixXd &Phi,
78  const Eigen::MatrixXd &Q);
79 
88  static void EKFUpdate(std::shared_ptr<State> state, const std::vector<std::shared_ptr<ov_type::Type>> &H_order, const Eigen::MatrixXd &H,
89  const Eigen::VectorXd &res, const Eigen::MatrixXd &R);
90 
98  static void set_initial_covariance(std::shared_ptr<State> state, const Eigen::MatrixXd &covariance,
99  const std::vector<std::shared_ptr<ov_type::Type>> &order);
100 
112  static Eigen::MatrixXd get_marginal_covariance(std::shared_ptr<State> state,
113  const std::vector<std::shared_ptr<ov_type::Type>> &small_variables);
114 
125  static Eigen::MatrixXd get_full_covariance(std::shared_ptr<State> state);
126 
139  static void marginalize(std::shared_ptr<State> state, std::shared_ptr<ov_type::Type> marg);
140 
146  static std::shared_ptr<ov_type::Type> clone(std::shared_ptr<State> state, std::shared_ptr<ov_type::Type> variable_to_clone);
147 
165  static bool initialize(std::shared_ptr<State> state, std::shared_ptr<ov_type::Type> new_variable,
166  const std::vector<std::shared_ptr<ov_type::Type>> &H_order, Eigen::MatrixXd &H_R, Eigen::MatrixXd &H_L,
167  Eigen::MatrixXd &R, Eigen::VectorXd &res, double chi_2_mult);
168 
183  static void initialize_invertible(std::shared_ptr<State> state, std::shared_ptr<ov_type::Type> new_variable,
184  const std::vector<std::shared_ptr<ov_type::Type>> &H_order, const Eigen::MatrixXd &H_R,
185  const Eigen::MatrixXd &H_L, const Eigen::MatrixXd &R, const Eigen::VectorXd &res);
186 
213  static void augment_clone(std::shared_ptr<State> state, Eigen::Matrix<double, 3, 1> last_w);
214 
224  static void marginalize_old_clone(std::shared_ptr<State> state);
225 
230  static void marginalize_slam(std::shared_ptr<State> state);
231 
232 private:
238 };
239 
240 } // namespace ov_msckf
241 
242 #endif // OV_MSCKF_STATE_HELPER_H
Extended Kalman Filter estimator.
Definition: VioManager.h:46
Helper which manipulates the State and its covariance.
Definition: StateHelper.h:45
ROSCONSOLE_DECL void initialize()


ov_msckf
Author(s): Patrick Geneva , Kevin Eckenhoff , Guoquan Huang
autogenerated on Wed Jun 21 2023 03:05:43