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->
key1()) <<
"," 109 << keyFormatter(this->
key2()) <<
"," << keyFormatter(this->
key3()) <<
",";
116 const This *
e =
dynamic_cast<const This*
>(&other);
123 boost::optional<Matrix&> H2, boost::optional<Matrix&> H3)
const {
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);
174 const Vector3 biascorrectedOmega = preintegratedMeasurements.
predict(bias);
182 return rot_i.
compose(correctedDeltaRij);
189 const boost::optional<Pose3>& body_P_sensor)
190 :
Base(
noiseModel::Gaussian::Covariance(pim.preintMeasCov_), rot_i, rot_j, bias),
192 boost::shared_ptr<PreintegratedMeasurements::Params>
p =
193 boost::make_shared<PreintegratedMeasurements::Params>(pim.
p());
194 p->body_P_sensor = body_P_sensor;
202 const boost::optional<Pose3>& body_P_sensor) {
203 boost::shared_ptr<PreintegratedMeasurements::Params>
p =
204 boost::make_shared<PreintegratedMeasurements::Params>(pim.
p());
205 p->omegaCoriolis = omegaCoriolis;
206 p->body_P_sensor = body_P_sensor;
209 return Predict(rot_i, bias, newPim);
void print(const Matrix &A, const string &s, ostream &stream)
double error(const Values &c) const override
bool equals(const NonlinearFactor &f, double tol=1e-9) const override
Pose2_ Expmap(const Vector3_ &xi)
void print(const std::string &s, const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
print
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
const PreintegratedAhrsMeasurements & preintegratedMeasurements() const
Access the preintegrated measurements.
Vector3 predict(const Vector3 &bias, OptionalJacobian< 3, 3 > H=boost::none) const
const SharedNoiseModel & noiseModel() const
access to the noise model
boost::function< Vector9(const NavState &, const bool &)> coriolis
static Rot3 predict(const Rot3 &rot_i, const Vector3 &bias, const PreintegratedMeasurements preintegratedMeasurements, const Vector3 &omegaCoriolis, const boost::optional< Pose3 > &body_P_sensor=boost::none)
Class compose(const Class &g) const
static Matrix3 LogmapDerivative(const Vector3 &x)
Derivative of Logmap.
static Matrix3 ExpmapDerivative(const Vector3 &x)
Derivative of Expmap.
boost::shared_ptr< This > shared_ptr
static const double deltaT
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
gtsam::NonlinearFactor::shared_ptr clone() const override
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Vector evaluateError(const Rot3 &rot_i, const Rot3 &rot_j, const Vector3 &bias, boost::optional< Matrix & > H1=boost::none, boost::optional< Matrix & > H2=boost::none, boost::optional< Matrix & > H3=boost::none) const override
vector of errors
static Rot3 Expmap(const Vector3 &v, OptionalJacobian< 3, 3 > H=boost::none)
bool equal_with_abs_tol(const Eigen::DenseBase< MATRIX > &A, const Eigen::DenseBase< MATRIX > &B, double tol=1e-9)
Matrix3 transpose() const
Matrix3 skewSymmetric(double wx, double wy, double wz)
static const Vector3 measuredOmega(w, 0, 0)
SharedNoiseModel noiseModel_
static Vector3 Logmap(const Rot3 &R, OptionalJacobian< 3, 3 > H=boost::none)
bool equals(const NonlinearFactor &, double tol=1e-9) const override
equals
Class between(const Class &g) const
static Rot3 Predict(const Rot3 &rot_i, const Vector3 &bias, const PreintegratedAhrsMeasurements preintegratedMeasurements)
Vector3 integrateCoriolis(const Rot3 &rot_i) const
Integrate coriolis correction in body frame rot_i.
boost::shared_ptr< Params > p_
Parameters.
Vector3 biasHat_
Angular rate bias values used during preintegration.
bool equals(const PreintegratedAhrsMeasurements &, double tol=1e-9) const
equals
std::uint64_t Key
Integer nonlinear key type.
PreintegratedAhrsMeasurements _PIM_
void print(const std::string &s="Preintegrated Measurements: ") const
print