32 using namespace gtsam;
49 auto p = P::Params::MakeSharedD(9.81);
51 p->accelerometerCovariance = 1
e-7 * I_3x3;
52 p->gyroscopeCovariance = 1
e-8 * I_3x3;
53 p->integrationCovariance = 1
e-9 * I_3x3;
55 const double deltaT = 0.005;
67 for (
int j = 0;
j < 200; ++
j)
68 pim.integrateMeasurement(measuredAcc, measuredOmega, deltaT);
75 auto pim = getPreintegratedMeasurements<PreintegratedImuMeasurements>();
77 EXPECT(equalsObj<PreintegratedImuMeasurements>(pim));
78 EXPECT(equalsXML<PreintegratedImuMeasurements>(pim));
79 EXPECT(equalsBinary<PreintegratedImuMeasurements>(pim));
83 EXPECT(equalsObj<ImuFactor>(factor));
84 EXPECT(equalsXML<ImuFactor>(factor));
85 EXPECT(equalsBinary<ImuFactor>(factor));
90 auto pim = getPreintegratedMeasurements<PreintegratedImuMeasurements>();
94 EXPECT(equalsObj<ImuFactor2>(factor));
95 EXPECT(equalsXML<ImuFactor2>(factor));
96 EXPECT(equalsBinary<ImuFactor2>(factor));
101 auto pim = getPreintegratedMeasurements<PreintegratedCombinedMeasurements>();
103 EXPECT(equalsObj<PreintegratedCombinedMeasurements>(pim));
104 EXPECT(equalsXML<PreintegratedCombinedMeasurements>(pim));
105 EXPECT(equalsBinary<PreintegratedCombinedMeasurements>(pim));
109 EXPECT(equalsObj<CombinedImuFactor>(factor));
110 EXPECT(equalsXML<CombinedImuFactor>(factor));
111 EXPECT(equalsBinary<CombinedImuFactor>(factor));
116 Unit3 nDown(0, 0, -1);
120 EXPECT(serializationTestHelpers::equalsObj(factor));
121 EXPECT(serializationTestHelpers::equalsXML(factor));
122 EXPECT(serializationTestHelpers::equalsBinary(factor));
127 Unit3 nDown(0, 0, -1);
131 EXPECT(serializationTestHelpers::equalsObj(factor));
132 EXPECT(serializationTestHelpers::equalsXML(factor));
133 EXPECT(serializationTestHelpers::equalsBinary(factor));
static int runAllTests(TestResult &result)
noiseModel::Diagonal::shared_ptr model
P getPreintegratedMeasurements()
Represents a 3D point on a unit sphere.
#define EXPECT(condition)
static const double deltaT
Array< double, 1, 3 > e(1./3., 0.5, 2.)
static const Vector3 measuredAcc
Header file for Attitude factor.
noiseModel::Diagonal::shared_ptr SharedDiagonal
static const Vector3 measuredOmega(w, 0, 0)
TEST(ImuFactor, serialization)
static noiseModel::Diagonal::shared_ptr Diagonal(const Matrix &covariance)
BOOST_CLASS_EXPORT_GUID(DecisionTreeFactor, "gtsam_DecisionTreeFactor")
noiseModel::Base::shared_ptr SharedNoiseModel