Factor_ImuCPIv1.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_INIT_CERES_IMUCPIV1_H
23 #define OV_INIT_CERES_IMUCPIV1_H
24 
25 #include <ceres/ceres.h>
26 
27 namespace ov_init {
28 
32 class Factor_ImuCPIv1 : public ceres::CostFunction {
33 public:
34  // Preintegrated measurements and time interval
35  Eigen::Vector3d alpha;
36  Eigen::Vector3d beta;
37  Eigen::Vector4d q_breve;
38  double dt;
39 
40  // Preintegration linearization points
41  Eigen::Vector3d b_w_lin_save;
42  Eigen::Vector3d b_a_lin_save;
43 
44  // Prinetegrated bias jacobians
45  Eigen::Matrix3d J_q; // J_q - orientation wrt bias w
46  Eigen::Matrix3d J_a; // J_a - position wrt bias w
47  Eigen::Matrix3d J_b; // J_b - velocity wrt bias w
48  Eigen::Matrix3d H_a; // H_a - position wrt bias a
49  Eigen::Matrix3d H_b; // H_b - velocity wrt bias a
50 
51  // Sqrt of the preintegration information
52  Eigen::Matrix<double, 15, 15> sqrtI_save;
53 
54  // Gravity
55  Eigen::Vector3d grav_save;
56 
60  Factor_ImuCPIv1(double deltatime, Eigen::Vector3d &grav, Eigen::Vector3d &alpha, Eigen::Vector3d &beta, Eigen::Vector4d &q_KtoK1,
61  Eigen::Vector3d &ba_lin, Eigen::Vector3d &bg_lin, Eigen::Matrix3d &J_q, Eigen::Matrix3d &J_beta, Eigen::Matrix3d &J_alpha,
62  Eigen::Matrix3d &H_beta, Eigen::Matrix3d &H_alpha, Eigen::Matrix<double, 15, 15> &covariance);
63 
64  virtual ~Factor_ImuCPIv1() {}
65 
73  bool Evaluate(double const *const *parameters, double *residuals, double **jacobians) const override;
74 };
75 
76 } // namespace ov_init
77 
78 #endif // OV_INIT_CERES_IMUCPIV1_H
ov_init::Factor_ImuCPIv1::~Factor_ImuCPIv1
virtual ~Factor_ImuCPIv1()
Definition: Factor_ImuCPIv1.h:64
ov_init::Factor_ImuCPIv1::b_a_lin_save
Eigen::Vector3d b_a_lin_save
Definition: Factor_ImuCPIv1.h:42
ov_init::Factor_ImuCPIv1::J_q
Eigen::Matrix3d J_q
Definition: Factor_ImuCPIv1.h:45
ov_init::Factor_ImuCPIv1::Evaluate
bool Evaluate(double const *const *parameters, double *residuals, double **jacobians) const override
Error residual and Jacobian calculation.
Definition: Factor_ImuCPIv1.cpp:77
ov_init::Factor_ImuCPIv1::J_a
Eigen::Matrix3d J_a
Definition: Factor_ImuCPIv1.h:46
ov_init::Factor_ImuCPIv1::dt
double dt
Definition: Factor_ImuCPIv1.h:38
ov_init::Factor_ImuCPIv1::grav_save
Eigen::Vector3d grav_save
Definition: Factor_ImuCPIv1.h:55
ov_init::Factor_ImuCPIv1::H_a
Eigen::Matrix3d H_a
Definition: Factor_ImuCPIv1.h:48
ov_init::Factor_ImuCPIv1
Factor for IMU continuous preintegration version 1.
Definition: Factor_ImuCPIv1.h:32
ov_init::Factor_ImuCPIv1::J_b
Eigen::Matrix3d J_b
Definition: Factor_ImuCPIv1.h:47
ov_init
State initialization code.
Definition: Factor_GenericPrior.h:27
ov_init::Factor_ImuCPIv1::H_b
Eigen::Matrix3d H_b
Definition: Factor_ImuCPIv1.h:49
ov_init::Factor_ImuCPIv1::beta
Eigen::Vector3d beta
Definition: Factor_ImuCPIv1.h:36
ov_init::Factor_ImuCPIv1::alpha
Eigen::Vector3d alpha
Definition: Factor_ImuCPIv1.h:35
ov_init::Factor_ImuCPIv1::sqrtI_save
Eigen::Matrix< double, 15, 15 > sqrtI_save
Definition: Factor_ImuCPIv1.h:52
ov_init::Factor_ImuCPIv1::b_w_lin_save
Eigen::Vector3d b_w_lin_save
Definition: Factor_ImuCPIv1.h:41
ov_init::Factor_ImuCPIv1::Factor_ImuCPIv1
Factor_ImuCPIv1(double deltatime, Eigen::Vector3d &grav, Eigen::Vector3d &alpha, Eigen::Vector3d &beta, Eigen::Vector4d &q_KtoK1, Eigen::Vector3d &ba_lin, Eigen::Vector3d &bg_lin, Eigen::Matrix3d &J_q, Eigen::Matrix3d &J_beta, Eigen::Matrix3d &J_alpha, Eigen::Matrix3d &H_beta, Eigen::Matrix3d &H_alpha, Eigen::Matrix< double, 15, 15 > &covariance)
Default constructor.
Definition: Factor_ImuCPIv1.cpp:28
ov_init::Factor_ImuCPIv1::q_breve
Eigen::Vector4d q_breve
Definition: Factor_ImuCPIv1.h:37


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