32 cout <<
"biasHat [" << biasHat_.transpose() <<
"]" << endl;
33 cout <<
" PreintMeasCov [ " << preintMeasCov_ <<
" ]" << endl;
37 bool PreintegratedAhrsMeasurements::equals(
39 return PreintegratedRotation::equals(other, tol) &&
44 void PreintegratedAhrsMeasurements::resetIntegration() {
45 PreintegratedRotation::resetIntegration();
46 preintMeasCov_.setZero();
50 void PreintegratedAhrsMeasurements::integrateMeasurement(
53 Matrix3 D_incrR_integratedOmega, Fr;
54 PreintegratedRotation::integrateMeasurement(measuredOmega,
55 biasHat_, deltaT, &D_incrR_integratedOmega, &Fr);
59 preintMeasCov_ = Fr * preintMeasCov_ * Fr.transpose() +
p().gyroscopeCovariance *
deltaT;
65 const Vector3 biasOmegaIncr = bias - biasHat_;
66 const Rot3 biascorrected = biascorrectedDeltaRij(biasOmegaIncr, H);
67 Matrix3 D_omega_biascorrected;
68 const Vector3 omega = Rot3::Logmap(biascorrected, H ? &D_omega_biascorrected : 0);
69 if (H) (*H) = D_omega_biascorrected * (*H);
73 Vector PreintegratedAhrsMeasurements::DeltaAngles(
74 const Vector& msr_gyro_t,
const double msr_dt,
80 Vector body_t_omega_body = msr_gyro_t;
84 R_t_to_t0 = R_t_to_t0 *
Rot3::Expmap(body_t_omega_body * msr_dt);
85 return Rot3::Logmap(R_t_to_t0);
91 AHRSFactor::AHRSFactor(
94 :
Base(noiseModel::Gaussian::Covariance(
95 preintegratedMeasurements.preintMeasCov_),
97 _PIM_(preintegratedMeasurements) {}
108 cout << s <<
"AHRSFactor(" << keyFormatter(this->key<1>()) <<
"," 109 << keyFormatter(this->key<2>()) <<
"," << keyFormatter(this->key<3>()) <<
",";
137 const Rot3 fRrot = correctedDeltaRij.
between(actualRij);
147 Matrix3 D_coriolis = -D_cDeltaRij_cOmega *
skewSymmetric(coriolis);
160 const Matrix3 JbiasOmega = D_cDeltaRij_cOmega * (*H3);
162 (*H3) << D_fR_fRrot * (-fRrot.
transpose() * JbiasOmega);
181 return rot_i.
compose(correctedDeltaRij);
189 :
Base(
noiseModel::Gaussian::Covariance(pim.preintMeasCov_), rot_i, rot_j,
192 auto p = std::make_shared<PreintegratedAhrsMeasurements::Params>(pim.
p());
202 auto p = std::make_shared<PreintegratedAhrsMeasurements::Params>(pim.
p());
203 p->omegaCoriolis = omegaCoriolis;
207 return Predict(rot_i, bias, newPim);
bool equals(const NonlinearFactor &f, double tol=1e-9) const override
static Rot3 Predict(const Rot3 &rot_i, const Vector3 &bias, const PreintegratedAhrsMeasurements &pim)
static Pose3 body_P_sensor(Rot3::RzRyRx(-M_PI_2, 0.0, -M_PI_2), Point3(0.25, -0.10, 1.0))
Pose2_ Expmap(const Vector3_ &xi)
EIGEN_STRONG_INLINE Packet4f print(const Packet4f &a)
void print(const std::string &s="Preintegrated Measurements: ") const
print
void print(const std::string &s, const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
print
Vector3 predict(const Vector3 &bias, OptionalJacobian< 3, 3 > H={}) const
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy y set format x g set format y g set format x2 g set format y2 g set format z g set angles radians set nogrid set key title set key left top Right noreverse box linetype linewidth samplen spacing width set nolabel set noarrow set nologscale set logscale x set set pointsize set encoding default set nopolar set noparametric set set set set surface set nocontour set clabel set mapping cartesian set nohidden3d set cntrparam order set cntrparam linear set cntrparam levels auto set cntrparam points set size set set xzeroaxis lt lw set x2zeroaxis lt lw set yzeroaxis lt lw set y2zeroaxis lt lw set tics in set ticslevel set tics set mxtics default set mytics default set mx2tics default set my2tics default set xtics border mirror norotate autofreq set ytics border mirror norotate autofreq set ztics border nomirror norotate autofreq set nox2tics set noy2tics set timestamp bottom norotate set rrange [*:*] noreverse nowriteback set trange [*:*] noreverse nowriteback set urange [*:*] noreverse nowriteback set vrange [*:*] noreverse nowriteback set xlabel matrix size set x2label set timefmt d m y n H
Rot3 is a 3D rotation represented as a rotation matrix if the preprocessor symbol GTSAM_USE_QUATERNIO...
static Rot3 Expmap(const Vector3 &v, OptionalJacobian< 3, 3 > H={})
const SharedNoiseModel & noiseModel() const
access to the noise model
Matrix * OptionalMatrixType
static Matrix3 LogmapDerivative(const Vector3 &x)
Derivative of Logmap.
static Vector3 Logmap(const Rot3 &R, OptionalJacobian< 3, 3 > H={})
static Matrix3 ExpmapDerivative(const Vector3 &x)
Derivative of Expmap.
static const double deltaT
bool equals(const PreintegratedAhrsMeasurements &, double tol=1e-9) const
equals
gtsam::NonlinearFactor::shared_ptr clone() const override
Vector::Scalar omega(const Vector &t, const Vector &s, RealScalar angle)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Class compose(const Class &g) const
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
bool equal_with_abs_tol(const Eigen::DenseBase< MATRIX > &A, const Eigen::DenseBase< MATRIX > &B, double tol=1e-9)
Vector3 integrateCoriolis(const Rot3 &rot_i) const
Integrate coriolis correction in body frame rot_i.
Matrix3 skewSymmetric(double wx, double wy, double wz)
static const Vector3 measuredOmega(w, 0, 0)
SharedNoiseModel noiseModel_
double error(const Values &c) const override
std::function< Vector9(const NavState &, const bool &)> coriolis
bool equals(const NonlinearFactor &, double tol=1e-9) const override
equals
Class between(const Class &g) const
std::shared_ptr< This > shared_ptr
std::shared_ptr< Params > p_
Parameters.
static Rot3 predict(const Rot3 &rot_i, const Vector3 &bias, const PreintegratedAhrsMeasurements &pim, const Vector3 &omegaCoriolis, const std::optional< Pose3 > &body_P_sensor={})
Vector3 biasHat_
Angular rate bias values used during preintegration.
Matrix3 transpose() const
Vector evaluateError(const Rot3 &rot_i, const Rot3 &rot_j, const Vector3 &bias, OptionalMatrixType H1, OptionalMatrixType H2, OptionalMatrixType H3) const override
vector of errors
std::uint64_t Key
Integer nonlinear key type.
PreintegratedAhrsMeasurements _PIM_