UpdaterHelper.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_UPDATER_HELPER_H
23 #define OV_MSCKF_UPDATER_HELPER_H
24 
25 #include <Eigen/Eigen>
26 #include <memory>
27 #include <unordered_map>
28 
30 
31 namespace ov_type {
32 class Type;
33 } // namespace ov_type
34 
35 namespace ov_msckf {
36 
37 class State;
38 
50 public:
55 
57  size_t featid;
58 
60  std::unordered_map<size_t, std::vector<Eigen::VectorXf>> uvs;
61 
62  // UV normalized coordinates that this feature has been seen from (mapped by camera ID)
63  std::unordered_map<size_t, std::vector<Eigen::VectorXf>> uvs_norm;
64 
66  std::unordered_map<size_t, std::vector<double>> timestamps;
67 
70 
72  int anchor_cam_id = -1;
73 
76 
78  Eigen::Vector3d p_FinA;
79 
81  Eigen::Vector3d p_FinA_fej;
82 
84  Eigen::Vector3d p_FinG;
85 
87  Eigen::Vector3d p_FinG_fej;
88  };
89 
99  static void get_feature_jacobian_representation(std::shared_ptr<State> state, UpdaterHelperFeature &feature, Eigen::MatrixXd &H_f,
100  std::vector<Eigen::MatrixXd> &H_x, std::vector<std::shared_ptr<ov_type::Type>> &x_order);
101 
112  static void get_feature_jacobian_full(std::shared_ptr<State> state, UpdaterHelperFeature &feature, Eigen::MatrixXd &H_f,
113  Eigen::MatrixXd &H_x, Eigen::VectorXd &res, std::vector<std::shared_ptr<ov_type::Type>> &x_order);
114 
126  static void nullspace_project_inplace(Eigen::MatrixXd &H_f, Eigen::MatrixXd &H_x, Eigen::VectorXd &res);
127 
137  static void measurement_compress_inplace(Eigen::MatrixXd &H_x, Eigen::VectorXd &res);
138 };
139 
140 } // namespace ov_msckf
141 
142 #endif // OV_MSCKF_UPDATER_HELPER_H
ov_msckf::UpdaterHelper::UpdaterHelperFeature::anchor_cam_id
int anchor_cam_id
What camera ID our pose is anchored in!! By default the first measurement is the anchor.
Definition: UpdaterHelper.h:72
ov_msckf::UpdaterHelper::get_feature_jacobian_full
static void get_feature_jacobian_full(std::shared_ptr< State > state, UpdaterHelperFeature &feature, Eigen::MatrixXd &H_f, Eigen::MatrixXd &H_x, Eigen::VectorXd &res, std::vector< std::shared_ptr< ov_type::Type >> &x_order)
Will construct the "stacked" Jacobians for a single feature from all its measurements.
Definition: UpdaterHelper.cpp:192
ov_msckf::UpdaterHelper::UpdaterHelperFeature::p_FinA
Eigen::Vector3d p_FinA
Triangulated position of this feature, in the anchor frame.
Definition: UpdaterHelper.h:78
LandmarkRepresentation.h
ov_msckf::UpdaterHelper::get_feature_jacobian_representation
static void get_feature_jacobian_representation(std::shared_ptr< State > state, UpdaterHelperFeature &feature, Eigen::MatrixXd &H_f, std::vector< Eigen::MatrixXd > &H_x, std::vector< std::shared_ptr< ov_type::Type >> &x_order)
This gets the feature and state Jacobian in respect to the feature representation.
Definition: UpdaterHelper.cpp:32
ov_msckf::UpdaterHelper::UpdaterHelperFeature::uvs
std::unordered_map< size_t, std::vector< Eigen::VectorXf > > uvs
UV coordinates that this feature has been seen from (mapped by camera ID)
Definition: UpdaterHelper.h:60
ov_msckf::UpdaterHelper::UpdaterHelperFeature::featid
size_t featid
Unique ID of this feature.
Definition: UpdaterHelper.h:57
ov_msckf
Extended Kalman Filter estimator.
Definition: VioManager.h:46
ov_msckf::UpdaterHelper::UpdaterHelperFeature
Feature object that our UpdaterHelper leverages, has all measurements and means.
Definition: UpdaterHelper.h:54
ov_msckf::UpdaterHelper::UpdaterHelperFeature::uvs_norm
std::unordered_map< size_t, std::vector< Eigen::VectorXf > > uvs_norm
Definition: UpdaterHelper.h:63
ov_type::LandmarkRepresentation::Representation
Representation
ov_msckf::UpdaterHelper::UpdaterHelperFeature::feat_representation
ov_type::LandmarkRepresentation::Representation feat_representation
What representation our feature is in.
Definition: UpdaterHelper.h:69
ov_msckf::UpdaterHelper::measurement_compress_inplace
static void measurement_compress_inplace(Eigen::MatrixXd &H_x, Eigen::VectorXd &res)
This will perform measurement compression.
Definition: UpdaterHelper.cpp:456
ov_msckf::UpdaterHelper::UpdaterHelperFeature::p_FinG
Eigen::Vector3d p_FinG
Triangulated position of this feature, in the global frame.
Definition: UpdaterHelper.h:84
ov_msckf::UpdaterHelper::UpdaterHelperFeature::p_FinA_fej
Eigen::Vector3d p_FinA_fej
Triangulated position of this feature, in the anchor frame first estimate.
Definition: UpdaterHelper.h:81
ov_msckf::UpdaterHelper
Class that has helper functions for our updaters.
Definition: UpdaterHelper.h:49
ov_type
ov_msckf::UpdaterHelper::UpdaterHelperFeature::anchor_clone_timestamp
double anchor_clone_timestamp
Timestamp of anchor clone.
Definition: UpdaterHelper.h:75
ov_msckf::UpdaterHelper::UpdaterHelperFeature::p_FinG_fej
Eigen::Vector3d p_FinG_fej
Triangulated position of this feature, in the global frame first estimate.
Definition: UpdaterHelper.h:87
ov_msckf::UpdaterHelper::nullspace_project_inplace
static void nullspace_project_inplace(Eigen::MatrixXd &H_f, Eigen::MatrixXd &H_x, Eigen::VectorXd &res)
This will project the left nullspace of H_f onto the linear system.
Definition: UpdaterHelper.cpp:426
ov_msckf::UpdaterHelper::UpdaterHelperFeature::timestamps
std::unordered_map< size_t, std::vector< double > > timestamps
Timestamps of each UV measurement (mapped by camera ID)
Definition: UpdaterHelper.h:66


ov_msckf
Author(s): Patrick Geneva , Kevin Eckenhoff , Guoquan Huang
autogenerated on Mon Dec 16 2024 03:06:54