CpiV2.cpp
Go to the documentation of this file.
1 
2 /*
3  * MIT License
4  * Copyright (c) 2018 Kevin Eckenhoff
5  * Copyright (c) 2018 Patrick Geneva
6  * Copyright (c) 2018 Guoquan Huang
7  *
8  * Permission is hereby granted, free of charge, to any person obtaining a copy
9  * of this software and associated documentation files (the "Software"), to deal
10  * in the Software without restriction, including without limitation the rights
11  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12  * copies of the Software, and to permit persons to whom the Software is
13  * furnished to do so, subject to the following conditions:
14  *
15  * The above copyright notice and this permission notice shall be included in all
16  * copies or substantial portions of the Software.
17  *
18  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24  * SOFTWARE.
25  */
26 
27 #include "CpiV2.h"
28 
29 #include "utils/quat_ops.h"
30 
31 using namespace ov_core;
32 
33 void CpiV2::feed_IMU(double t_0, double t_1, Eigen::Matrix<double, 3, 1> w_m_0, Eigen::Matrix<double, 3, 1> a_m_0,
34  Eigen::Matrix<double, 3, 1> w_m_1, Eigen::Matrix<double, 3, 1> a_m_1) {
35 
36  // Get time difference
37  double delta_t = t_1 - t_0;
38  DT += delta_t;
39 
40  // If no time has passed do nothing
41  if (delta_t == 0) {
42  return;
43  }
44 
45  // Get estimated imu readings
46  Eigen::Matrix<double, 3, 1> w_hat = w_m_0 - b_w_lin;
47  Eigen::Matrix<double, 3, 1> a_hat = a_m_0 - b_a_lin - R_k2tau * quat_2_Rot(q_k_lin) * grav;
48 
49  // If averaging, average
50  // Note: we will average the LOCAL acceleration after getting the relative rotation
51  if (imu_avg) {
52  w_hat += w_m_1 - b_w_lin;
53  w_hat = 0.5 * w_hat;
54  }
55 
56  // Get angle change w*dt
57  Eigen::Matrix<double, 3, 1> w_hatdt = w_hat * delta_t;
58 
59  // Get entries of w_hat
60  double w_1 = w_hat(0, 0);
61  double w_2 = w_hat(1, 0);
62  double w_3 = w_hat(2, 0);
63 
64  // Get magnitude of w and wdt
65  double mag_w = w_hat.norm();
66  double w_dt = mag_w * delta_t;
67 
68  // Threshold to determine if equations will be unstable
69  bool small_w = (mag_w < 0.008726646);
70 
71  // Get some of the variables used in the preintegration equations
72  double dt_2 = pow(delta_t, 2);
73  double cos_wt = cos(w_dt);
74  double sin_wt = sin(w_dt);
75 
76  Eigen::Matrix<double, 3, 3> w_x = skew_x(w_hat);
77  Eigen::Matrix<double, 3, 3> w_tx = skew_x(w_hatdt);
78  Eigen::Matrix<double, 3, 3> w_x_2 = w_x * w_x;
79 
80  //==========================================================================
81  // MEASUREMENT MEANS
82  //==========================================================================
83 
84  // Get relative rotation
85  Eigen::Matrix<double, 3, 3> R_tau2tau1 = small_w ? eye3 - delta_t * w_x + (pow(delta_t, 2) / 2) * w_x_2
86  : eye3 - (sin_wt / mag_w) * w_x + ((1.0 - cos_wt) / (pow(mag_w, 2.0))) * w_x_2;
87 
88  // Updated roation and its transpose
89  Eigen::Matrix<double, 3, 3> R_k2tau1 = R_tau2tau1 * R_k2tau;
90  Eigen::Matrix<double, 3, 3> R_tau12k = R_k2tau1.transpose();
91 
92  // If averaging, average the LOCAL acceleration
93  if (imu_avg) {
94  a_hat += a_m_1 - b_a_lin - R_k2tau1 * quat_2_Rot(q_k_lin) * grav;
95  a_hat = 0.5 * a_hat;
96  }
97  Eigen::Matrix<double, 3, 3> a_x = skew_x(a_hat);
98 
99  // Intermediate variables for evaluating the measurement/bias Jacobian update
100  double f_1;
101  double f_2;
102  double f_3;
103  double f_4;
104 
105  if (small_w) {
106  f_1 = -(pow(delta_t, 3) / 3);
107  f_2 = (pow(delta_t, 4) / 8);
108  f_3 = -(pow(delta_t, 2) / 2);
109  f_4 = (pow(delta_t, 3) / 6);
110  } else {
111  f_1 = (w_dt * cos_wt - sin_wt) / (pow(mag_w, 3));
112  f_2 = (pow(w_dt, 2) - 2 * cos_wt - 2 * w_dt * sin_wt + 2) / (2 * pow(mag_w, 4));
113  f_3 = -(1 - cos_wt) / pow(mag_w, 2);
114  f_4 = (w_dt - sin_wt) / pow(mag_w, 3);
115  }
116 
117  // Compute the main part of our analytical means
118  Eigen::Matrix<double, 3, 3> alpha_arg = ((dt_2 / 2.0) * eye3 + f_1 * w_x + f_2 * w_x_2);
119  Eigen::Matrix<double, 3, 3> Beta_arg = (delta_t * eye3 + f_3 * w_x + f_4 * w_x_2);
120 
121  // Matrices that will multiply the a_hat in the update expressions
122  Eigen::Matrix<double, 3, 3> H_al = R_tau12k * alpha_arg;
123  Eigen::Matrix<double, 3, 3> H_be = R_tau12k * Beta_arg;
124 
125  // Update the measurements
126  alpha_tau += beta_tau * delta_t + H_al * a_hat;
127  beta_tau += H_be * a_hat;
128 
129  //==========================================================================
130  // BIAS JACOBIANS (ANALYTICAL)
131  //==========================================================================
132 
133  // Get right Jacobian
134  Eigen::Matrix<double, 3, 3> J_r_tau1 =
135  small_w ? eye3 - .5 * w_tx + (1.0 / 6.0) * w_tx * w_tx
136  : eye3 - ((1 - cos_wt) / (pow((w_dt), 2.0))) * w_tx + ((w_dt - sin_wt) / (pow(w_dt, 3.0))) * w_tx * w_tx;
137 
138  // Update orientation in respect to gyro bias Jacobians
139  Eigen::Matrix<double, 3, 3> J_save = J_q;
140  J_q = R_tau2tau1 * J_q + J_r_tau1 * delta_t;
141 
142  // Update alpha and beta in respect to accel bias Jacobian
143  H_a -= H_al;
144  H_a += delta_t * H_b;
145  H_b -= H_be;
146 
147  // Update alpha and beta in respect to q_GtoLIN Jacobian
148  Eigen::Matrix<double, 3, 1> g_k = quat_2_Rot(q_k_lin) * grav;
149  O_a += delta_t * O_b;
150  O_a += -H_al * R_k2tau * skew_x(g_k);
151  O_b += -H_be * R_k2tau * skew_x(g_k);
152 
153  // Derivatives of R_tau12k wrt bias_w entries
154  Eigen::MatrixXd d_R_bw_1 = -R_tau12k * skew_x(J_q * e_1);
155  Eigen::MatrixXd d_R_bw_2 = -R_tau12k * skew_x(J_q * e_2);
156  Eigen::MatrixXd d_R_bw_3 = -R_tau12k * skew_x(J_q * e_3);
157 
158  // Now compute the gyro bias Jacobian terms
159  double df_1_dbw_1;
160  double df_1_dbw_2;
161  double df_1_dbw_3;
162 
163  double df_2_dbw_1;
164  double df_2_dbw_2;
165  double df_2_dbw_3;
166 
167  double df_3_dbw_1;
168  double df_3_dbw_2;
169  double df_3_dbw_3;
170 
171  double df_4_dbw_1;
172  double df_4_dbw_2;
173  double df_4_dbw_3;
174 
175  if (small_w) {
176  double df_1_dw_mag = -(pow(delta_t, 5) / 15);
177  df_1_dbw_1 = w_1 * df_1_dw_mag;
178  df_1_dbw_2 = w_2 * df_1_dw_mag;
179  df_1_dbw_3 = w_3 * df_1_dw_mag;
180 
181  double df_2_dw_mag = (pow(delta_t, 6) / 72);
182  df_2_dbw_1 = w_1 * df_2_dw_mag;
183  df_2_dbw_2 = w_2 * df_2_dw_mag;
184  df_2_dbw_3 = w_3 * df_2_dw_mag;
185 
186  double df_3_dw_mag = -(pow(delta_t, 4) / 12);
187  df_3_dbw_1 = w_1 * df_3_dw_mag;
188  df_3_dbw_2 = w_2 * df_3_dw_mag;
189  df_3_dbw_3 = w_3 * df_3_dw_mag;
190 
191  double df_4_dw_mag = (pow(delta_t, 5) / 60);
192  df_4_dbw_1 = w_1 * df_4_dw_mag;
193  df_4_dbw_2 = w_2 * df_4_dw_mag;
194  df_4_dbw_3 = w_3 * df_4_dw_mag;
195  } else {
196  double df_1_dw_mag = (pow(w_dt, 2) * sin_wt - 3 * sin_wt + 3 * w_dt * cos_wt) / pow(mag_w, 5);
197  df_1_dbw_1 = w_1 * df_1_dw_mag;
198  df_1_dbw_2 = w_2 * df_1_dw_mag;
199  df_1_dbw_3 = w_3 * df_1_dw_mag;
200 
201  double df_2_dw_mag = (pow(w_dt, 2) - 4 * cos_wt - 4 * w_dt * sin_wt + pow(w_dt, 2) * cos_wt + 4) / (pow(mag_w, 6));
202  df_2_dbw_1 = w_1 * df_2_dw_mag;
203  df_2_dbw_2 = w_2 * df_2_dw_mag;
204  df_2_dbw_3 = w_3 * df_2_dw_mag;
205 
206  double df_3_dw_mag = (2 * (cos_wt - 1) + w_dt * sin_wt) / (pow(mag_w, 4));
207  df_3_dbw_1 = w_1 * df_3_dw_mag;
208  df_3_dbw_2 = w_2 * df_3_dw_mag;
209  df_3_dbw_3 = w_3 * df_3_dw_mag;
210 
211  double df_4_dw_mag = (2 * w_dt + w_dt * cos_wt - 3 * sin_wt) / (pow(mag_w, 5));
212  df_4_dbw_1 = w_1 * df_4_dw_mag;
213  df_4_dbw_2 = w_2 * df_4_dw_mag;
214  df_4_dbw_3 = w_3 * df_4_dw_mag;
215  }
216 
217  // Gravity rotated into the "tau'th" frame (i.e. start of the measurement interval)
218  Eigen::Matrix<double, 3, 1> g_tau = R_k2tau * quat_2_Rot(q_k_lin) * grav;
219 
220  // Update gyro bias Jacobians
221  J_a += J_b * delta_t;
222  J_a.block(0, 0, 3, 1) +=
223  (d_R_bw_1 * alpha_arg + R_tau12k * (df_1_dbw_1 * w_x - f_1 * e_1x + df_2_dbw_1 * w_x_2 - f_2 * (e_1x * w_x + w_x * e_1x))) * a_hat -
224  H_al * skew_x((J_save * e_1)) * g_tau;
225  J_a.block(0, 1, 3, 1) +=
226  (d_R_bw_2 * alpha_arg + R_tau12k * (df_1_dbw_2 * w_x - f_1 * e_2x + df_2_dbw_2 * w_x_2 - f_2 * (e_2x * w_x + w_x * e_2x))) * a_hat -
227  H_al * skew_x((J_save * e_2)) * g_tau;
228  J_a.block(0, 2, 3, 1) +=
229  (d_R_bw_3 * alpha_arg + R_tau12k * (df_1_dbw_3 * w_x - f_1 * e_3x + df_2_dbw_3 * w_x_2 - f_2 * (e_3x * w_x + w_x * e_3x))) * a_hat -
230  H_al * skew_x((J_save * e_3)) * g_tau;
231  J_b.block(0, 0, 3, 1) +=
232  (d_R_bw_1 * Beta_arg + R_tau12k * (df_3_dbw_1 * w_x - f_3 * e_1x + df_4_dbw_1 * w_x_2 - f_4 * (e_1x * w_x + w_x * e_1x))) * a_hat -
233  -H_be * skew_x((J_save * e_1)) * g_tau;
234  J_b.block(0, 1, 3, 1) +=
235  (d_R_bw_2 * Beta_arg + R_tau12k * (df_3_dbw_2 * w_x - f_3 * e_2x + df_4_dbw_2 * w_x_2 - f_4 * (e_2x * w_x + w_x * e_2x))) * a_hat -
236  H_be * skew_x((J_save * e_2)) * g_tau;
237  J_b.block(0, 2, 3, 1) +=
238  (d_R_bw_3 * Beta_arg + R_tau12k * (df_3_dbw_3 * w_x - f_3 * e_3x + df_4_dbw_3 * w_x_2 - f_4 * (e_3x * w_x + w_x * e_3x))) * a_hat -
239  H_be * skew_x((J_save * e_3)) * g_tau;
240 
241  //==========================================================================
242  // MEASUREMENT COVARIANCE
243  //==========================================================================
244 
245  // Going to need orientation at intermediate time i.e. at .5*dt;
246  Eigen::Matrix<double, 3, 3> R_G_to_k = quat_2_Rot(q_k_lin);
247  double dt_mid = delta_t / 2.0;
248  double w_dt_mid = mag_w * dt_mid;
249  Eigen::Matrix<double, 3, 3> R_mid;
250 
251  // The middle of this interval (i.e., rotation from k to mid)
252  R_mid = small_w ? eye3 - dt_mid * w_x + (pow(dt_mid, 2) / 2) * w_x_2
253  : eye3 - (sin(w_dt_mid) / mag_w) * w_x + ((1.0 - cos(w_dt_mid)) / (pow(mag_w, 2.0))) * w_x_2;
254  R_mid = R_mid * R_k2tau;
255 
256  // Compute covariance (in this implementation, we use RK4)
257  // k1-------------------------------------------------------------------------------------------------
258 
259  // Build state Jacobian
260  Eigen::Matrix<double, 21, 21> F_k1 = Eigen::Matrix<double, 21, 21>::Zero();
261  F_k1.block(0, 0, 3, 3) = -w_x;
262  F_k1.block(0, 3, 3, 3) = -eye3;
263  F_k1.block(6, 0, 3, 3) = -R_k2tau.transpose() * a_x;
264  F_k1.block(6, 9, 3, 3) = -R_k2tau.transpose();
265  F_k1.block(6, 15, 3, 3) = -R_k2tau.transpose() * skew_x(R_k2tau * R_G_to_k * grav);
266  F_k1.block(6, 18, 3, 3) = -R_k2tau.transpose() * R_k2tau * skew_x(R_G_to_k * grav);
267  F_k1.block(12, 6, 3, 3) = eye3;
268 
269  // Build noise Jacobian
270  Eigen::Matrix<double, 21, 12> G_k1 = Eigen::Matrix<double, 21, 12>::Zero();
271  G_k1.block(0, 0, 3, 3) = -eye3;
272  G_k1.block(3, 3, 3, 3) = eye3;
273  G_k1.block(6, 6, 3, 3) = -R_k2tau.transpose();
274  G_k1.block(9, 9, 3, 3) = eye3;
275 
276  // Get state transition and covariance derivative
277  Eigen::Matrix<double, 21, 21> Phi_dot_k1 = F_k1;
278  Eigen::Matrix<double, 21, 21> P_dot_k1 = F_k1 * P_big + P_big * F_k1.transpose() + G_k1 * Q_c * G_k1.transpose();
279 
280  // k2-------------------------------------------------------------------------------------------------
281 
282  // Build state Jacobian
283  Eigen::Matrix<double, 21, 21> F_k2 = Eigen::Matrix<double, 21, 21>::Zero();
284  F_k2.block(0, 0, 3, 3) = -w_x;
285  F_k2.block(0, 3, 3, 3) = -eye3;
286  F_k2.block(6, 0, 3, 3) = -R_mid.transpose() * a_x;
287  F_k2.block(6, 9, 3, 3) = -R_mid.transpose();
288  F_k2.block(6, 15, 3, 3) = -R_mid.transpose() * skew_x(R_k2tau * R_G_to_k * grav);
289  F_k2.block(6, 18, 3, 3) = -R_mid.transpose() * R_k2tau * skew_x(R_G_to_k * grav);
290  F_k2.block(12, 6, 3, 3) = eye3;
291 
292  // Build noise Jacobian
293  Eigen::Matrix<double, 21, 12> G_k2 = Eigen::Matrix<double, 21, 12>::Zero();
294  G_k2.block(0, 0, 3, 3) = -eye3;
295  G_k2.block(3, 3, 3, 3) = eye3;
296  G_k2.block(6, 6, 3, 3) = -R_mid.transpose();
297  G_k2.block(9, 9, 3, 3) = eye3;
298 
299  // Get state transition and covariance derivative
300  Eigen::Matrix<double, 21, 21> Phi_k2 = Eigen::Matrix<double, 21, 21>::Identity() + Phi_dot_k1 * dt_mid;
301  Eigen::Matrix<double, 21, 21> P_k2 = P_big + P_dot_k1 * dt_mid;
302  Eigen::Matrix<double, 21, 21> Phi_dot_k2 = F_k2 * Phi_k2;
303  Eigen::Matrix<double, 21, 21> P_dot_k2 = F_k2 * P_k2 + P_k2 * F_k2.transpose() + G_k2 * Q_c * G_k2.transpose();
304 
305  // k3-------------------------------------------------------------------------------------------------
306 
307  // Our state and noise Jacobians are the same as k2
308  // Since k2 and k3 correspond to the same estimates for the midpoint
309  Eigen::Matrix<double, 21, 21> F_k3 = F_k2;
310  Eigen::Matrix<double, 21, 12> G_k3 = G_k2;
311 
312  // Get state transition and covariance derivative
313  Eigen::Matrix<double, 21, 21> Phi_k3 = Eigen::Matrix<double, 21, 21>::Identity() + Phi_dot_k2 * dt_mid;
314  Eigen::Matrix<double, 21, 21> P_k3 = P_big + P_dot_k2 * dt_mid;
315  Eigen::Matrix<double, 21, 21> Phi_dot_k3 = F_k3 * Phi_k3;
316  Eigen::Matrix<double, 21, 21> P_dot_k3 = F_k3 * P_k3 + P_k3 * F_k3.transpose() + G_k3 * Q_c * G_k3.transpose();
317 
318  // k4-------------------------------------------------------------------------------------------------
319 
320  // Build state Jacobian
321  Eigen::Matrix<double, 21, 21> F_k4 = Eigen::Matrix<double, 21, 21>::Zero();
322  F_k4.block(0, 0, 3, 3) = -w_x;
323  F_k4.block(0, 3, 3, 3) = -eye3;
324  F_k4.block(6, 0, 3, 3) = -R_k2tau1.transpose() * a_x;
325  F_k4.block(6, 9, 3, 3) = -R_k2tau1.transpose();
326  F_k4.block(6, 15, 3, 3) = -R_k2tau1.transpose() * skew_x(R_k2tau * R_G_to_k * grav);
327  F_k4.block(6, 18, 3, 3) = -R_k2tau1.transpose() * R_k2tau * skew_x(R_G_to_k * grav);
328  F_k4.block(12, 6, 3, 3) = eye3;
329 
330  // Build noise Jacobian
331  Eigen::Matrix<double, 21, 12> G_k4 = Eigen::Matrix<double, 21, 12>::Zero();
332  G_k4.block(0, 0, 3, 3) = -eye3;
333  G_k4.block(3, 3, 3, 3) = eye3;
334  G_k4.block(6, 6, 3, 3) = -R_k2tau1.transpose();
335  G_k4.block(9, 9, 3, 3) = eye3;
336 
337  // Get state transition and covariance derivative
338  Eigen::Matrix<double, 21, 21> Phi_k4 = Eigen::Matrix<double, 21, 21>::Identity() + Phi_dot_k3 * delta_t;
339  Eigen::Matrix<double, 21, 21> P_k4 = P_big + P_dot_k3 * delta_t;
340  Eigen::Matrix<double, 21, 21> Phi_dot_k4 = F_k4 * Phi_k4;
341  Eigen::Matrix<double, 21, 21> P_dot_k4 = F_k4 * P_k4 + P_k4 * F_k4.transpose() + G_k4 * Q_c * G_k4.transpose();
342 
343  // done-------------------------------------------------------------------------------------------------
344 
345  // Collect covariance solution
346  // Ensure it is positive definite
347  P_big += (delta_t / 6.0) * (P_dot_k1 + 2.0 * P_dot_k2 + 2.0 * P_dot_k3 + P_dot_k4);
348  P_big = 0.5 * (P_big + P_big.transpose());
349 
350  // Calculate the state transition from time k to tau
351  Eigen::Matrix<double, 21, 21> Phi =
352  Eigen::Matrix<double, 21, 21>::Identity() + (delta_t / 6.0) * (Phi_dot_k1 + 2.0 * Phi_dot_k2 + 2.0 * Phi_dot_k3 + Phi_dot_k4);
353 
354  //==========================================================================
355  // CLONE TO NEW SAMPLE TIME AND MARGINALIZE OLD SAMPLE TIME
356  //==========================================================================
357 
358  // Matrix that performs the clone and mariginalization
359  Eigen::Matrix<double, 21, 21> B_k = Eigen::Matrix<double, 21, 21>::Identity();
360  B_k.block(15, 15, 3, 3).setZero();
361  B_k.block(15, 0, 3, 3) = Eigen::Matrix<double, 3, 3>::Identity();
362 
363  // Change our measurement covariance and state transition
364  P_big = B_k * P_big * B_k.transpose();
365  P_big = 0.5 * (P_big + P_big.transpose());
366  Discrete_J_b = B_k * Phi * Discrete_J_b;
367 
368  // Our measurement covariance is the top 15x15 of our large covariance
369  P_meas = P_big.block(0, 0, 15, 15);
370 
371  // If we are using the state transition Jacobian, then we should overwrite the analytical versions
372  // Note: we flip the sign for J_q to match the Model 1 derivation
374  J_q = -Discrete_J_b.block(0, 3, 3, 3);
375  J_a = Discrete_J_b.block(12, 3, 3, 3);
376  J_b = Discrete_J_b.block(6, 3, 3, 3);
377  H_a = Discrete_J_b.block(12, 9, 3, 3);
378  H_b = Discrete_J_b.block(6, 9, 3, 3);
379  O_a = Discrete_J_b.block(12, 18, 3, 3);
380  O_b = Discrete_J_b.block(6, 18, 3, 3);
381  }
382 
383  // Update rotation mean
384  // Note we had to wait to do this, since we use the old orientation in our covariance calculation
385  R_k2tau = R_k2tau1;
387 }
ov_core::CpiBase::H_a
Eigen::Matrix< double, 3, 3 > H_a
alpha Jacobian wrt b_a
Definition: CpiBase.h:129
ov_core::skew_x
Eigen::Matrix< double, 3, 3 > skew_x(const Eigen::Matrix< double, 3, 1 > &w)
Skew-symmetric matrix from a given 3x1 vector.
Definition: quat_ops.h:135
ov_core::CpiV2::state_transition_jacobians
bool state_transition_jacobians
If we want to use analytical jacobians or not. In the paper we just numerically integrated the jacobi...
Definition: CpiV2.h:65
ov_core::CpiBase::b_a_lin
Eigen::Matrix< double, 3, 1 > b_a_lin
b_a linearization point (accelerometer)
Definition: CpiBase.h:134
ov_core::CpiBase::Q_c
Eigen::Matrix< double, 12, 12 > Q_c
Our continous-time measurement noise matrix (computed from contructor noise values)
Definition: CpiBase.h:141
ov_core::CpiBase::alpha_tau
Eigen::Matrix< double, 3, 1 > alpha_tau
alpha measurement mean
Definition: CpiBase.h:120
ov_core::CpiBase::R_k2tau
Eigen::Matrix< double, 3, 3 > R_k2tau
orientation measurement mean
Definition: CpiBase.h:123
ov_core::CpiBase::e_2
Eigen::Matrix< double, 3, 1 > e_2
Definition: CpiBase.h:155
ov_core::CpiBase::DT
double DT
measurement integration time
Definition: CpiBase.h:119
CpiV2.h
ov_core::CpiBase::J_q
Eigen::Matrix< double, 3, 3 > J_q
orientation Jacobian wrt b_w
Definition: CpiBase.h:126
ov_core::CpiBase::J_a
Eigen::Matrix< double, 3, 3 > J_a
alpha Jacobian wrt b_w
Definition: CpiBase.h:127
ov_core::CpiBase::q_k2tau
Eigen::Matrix< double, 4, 1 > q_k2tau
orientation measurement mean
Definition: CpiBase.h:122
ov_core::CpiBase::e_2x
Eigen::Matrix< double, 3, 3 > e_2x
Definition: CpiBase.h:160
ov_core::CpiBase::grav
Eigen::Matrix< double, 3, 1 > grav
Global gravity.
Definition: CpiBase.h:138
ov_core::CpiBase::e_3x
Eigen::Matrix< double, 3, 3 > e_3x
Definition: CpiBase.h:161
ov_core::CpiV2::O_a
Eigen::Matrix< double, 3, 3 > O_a
Definition: CpiV2.h:68
ov_core::CpiBase::beta_tau
Eigen::Matrix< double, 3, 1 > beta_tau
beta measurement mean
Definition: CpiBase.h:121
ov_core::CpiV2::P_big
Eigen::Matrix< double, 21, 21 > P_big
Definition: CpiV2.h:53
ov_core::CpiBase::q_k_lin
Eigen::Matrix< double, 4, 1 > q_k_lin
q_k linearization point (only model 2 uses)
Definition: CpiBase.h:135
ov_core::CpiBase::e_1
Eigen::Matrix< double, 3, 1 > e_1
Definition: CpiBase.h:154
ov_core::rot_2_quat
Eigen::Matrix< double, 4, 1 > rot_2_quat(const Eigen::Matrix< double, 3, 3 > &rot)
Returns a JPL quaternion from a rotation matrix.
Definition: quat_ops.h:88
ov_core::quat_2_Rot
Eigen::Matrix< double, 3, 3 > quat_2_Rot(const Eigen::Matrix< double, 4, 1 > &q)
Converts JPL quaterion to SO(3) rotation matrix.
Definition: quat_ops.h:152
ov_core::CpiV2::feed_IMU
void feed_IMU(double t_0, double t_1, Eigen::Matrix< double, 3, 1 > w_m_0, Eigen::Matrix< double, 3, 1 > a_m_0, Eigen::Matrix< double, 3, 1 > w_m_1=Eigen::Matrix< double, 3, 1 >::Zero(), Eigen::Matrix< double, 3, 1 > a_m_1=Eigen::Matrix< double, 3, 1 >::Zero())
Our precompound function for Model 2.
Definition: CpiV2.cpp:33
ov_core::CpiBase::e_3
Eigen::Matrix< double, 3, 1 > e_3
Definition: CpiBase.h:156
ov_core::CpiBase::eye3
Eigen::Matrix< double, 3, 3 > eye3
Definition: CpiBase.h:151
ov_core::CpiBase::P_meas
Eigen::Matrix< double, 15, 15 > P_meas
Our final measurement covariance.
Definition: CpiBase.h:144
ov_core::CpiBase::imu_avg
bool imu_avg
Definition: CpiBase.h:116
quat_ops.h
ov_core::CpiBase::b_w_lin
Eigen::Matrix< double, 3, 1 > b_w_lin
b_w linearization point (gyroscope)
Definition: CpiBase.h:133
ov_core
Core algorithms for OpenVINS.
Definition: CamBase.h:30
ov_core::CpiBase::e_1x
Eigen::Matrix< double, 3, 3 > e_1x
Definition: CpiBase.h:159
ov_core::CpiBase::H_b
Eigen::Matrix< double, 3, 3 > H_b
beta Jacobian wrt b_a
Definition: CpiBase.h:130
ov_core::CpiBase::J_b
Eigen::Matrix< double, 3, 3 > J_b
beta Jacobian wrt b_w
Definition: CpiBase.h:128
ov_core::CpiV2::O_b
Eigen::Matrix< double, 3, 3 > O_b
Definition: CpiV2.h:69
ov_core::CpiV2::Discrete_J_b
Eigen::Matrix< double, 21, 21 > Discrete_J_b
Definition: CpiV2.h:56


ov_core
Author(s): Patrick Geneva , Kevin Eckenhoff , Guoquan Huang
autogenerated on Mon Jan 22 2024 03:08:17