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
Eigen::Matrix< double, 15, 15 > sqrtI_save
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.
State initialization code.
Eigen::Vector3d b_w_lin_save
bool Evaluate(double const *const *parameters, double *residuals, double **jacobians) const override
Error residual and Jacobian calculation.
Factor for IMU continuous preintegration version 1.
Eigen::Vector3d grav_save
Eigen::Vector3d b_a_lin_save


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