30 using namespace gtsam;
34 "gtsam_noiseModel_Constrained");
36 "gtsam_noiseModel_Diagonal");
38 "gtsam_noiseModel_Gaussian");
41 "gtsam_noiseModel_Isotropic");
48 auto p = P::Params::MakeSharedD(9.81);
50 p->accelerometerCovariance = 1
e-7 * I_3x3;
51 p->gyroscopeCovariance = 1
e-8 * I_3x3;
52 p->integrationCovariance = 1
e-9 * I_3x3;
54 const double deltaT = 0.005;
66 for (
int j = 0;
j < 200; ++
j)
67 pim.integrateMeasurement(measuredAcc, measuredOmega, deltaT);
73 auto pim = getPreintegratedMeasurements<PreintegratedImuMeasurements>();
75 EXPECT(equalsObj<PreintegratedImuMeasurements>(pim));
76 EXPECT(equalsXML<PreintegratedImuMeasurements>(pim));
77 EXPECT(equalsBinary<PreintegratedImuMeasurements>(pim));
81 EXPECT(equalsObj<ImuFactor>(factor));
82 EXPECT(equalsXML<ImuFactor>(factor));
83 EXPECT(equalsBinary<ImuFactor>(factor));
87 auto pim = getPreintegratedMeasurements<PreintegratedImuMeasurements>();
91 EXPECT(equalsObj<ImuFactor2>(factor));
92 EXPECT(equalsXML<ImuFactor2>(factor));
93 EXPECT(equalsBinary<ImuFactor2>(factor));
97 auto pim = getPreintegratedMeasurements<PreintegratedCombinedMeasurements>();
99 EXPECT(equalsObj<PreintegratedCombinedMeasurements>(pim));
100 EXPECT(equalsXML<PreintegratedCombinedMeasurements>(pim));
101 EXPECT(equalsBinary<PreintegratedCombinedMeasurements>(pim));
105 EXPECT(equalsObj<CombinedImuFactor>(factor));
106 EXPECT(equalsXML<CombinedImuFactor>(factor));
107 EXPECT(equalsBinary<CombinedImuFactor>(factor));
static int runAllTests(TestResult &result)
TEST(ImuFactor, serialization)
#define EXPECT(condition)
static const double deltaT
Array< double, 1, 3 > e(1./3., 0.5, 2.)
static const Vector3 measuredAcc
noiseModel::Diagonal::shared_ptr SharedDiagonal
static const Vector3 measuredOmega(w, 0, 0)
P getPreintegratedMeasurements()
BOOST_CLASS_EXPORT_GUID(gtsam::noiseModel::Constrained,"gtsam_noiseModel_Constrained")
noiseModel::Base::shared_ptr SharedNoiseModel