26 using namespace gtsam;
29 static const double kDt = 1
e-2;
40 auto p = PreintegrationParams::MakeSharedU(10);
43 p->integrationCovariance = 0.0000001 * I_3x3;
47 #define EXPECT_NEAR(a, b, c) EXPECT(assert_equal(Vector(a), Vector(b), c)); 59 const double T = 2 *
kDt;
67 expected <<
p->accelerometerCovariance /
kDt, Z_3x3,
68 Z_3x3,
p->gyroscopeCovariance /
kDt;
94 EXPECT_NEAR(estimatedCov.diagonal(), pim.preintMeasCov().diagonal(), 0.1);
100 gttic(ForwardWithBias);
103 const double T = 0.1;
114 const double v = 2,
w = 6 *
kDegree;
118 const double T = 0.1;
124 EXPECT_NEAR(estimatedCov.diagonal(), pim.preintMeasCov().diagonal(), 0.1);
133 const double v = 2,
w = 6 *
kDegree;
137 const double T = 0.1;
143 EXPECT_NEAR(estimatedCov.diagonal(), pim.preintMeasCov().diagonal(), 0.1);
157 const double a = 0.2;
174 EXPECT_NEAR(estimatedCov.diagonal(), pim.preintMeasCov().diagonal(), 0.1);
180 gttic(AcceleratingWithBias);
191 gttic(AcceleratingAndRotating);
193 const double a = 0.2;
204 EXPECT_NEAR(estimatedCov.diagonal(), pim.preintMeasCov().diagonal(), 0.1);
219 const double a = 0.2;
228 gttic(Accelerating2);
236 EXPECT_NEAR(estimatedCov.diagonal(), pim.preintMeasCov().diagonal(), 0.1);
242 gttic(AcceleratingWithBias2);
253 gttic(AcceleratingAndRotating2);
255 const double a = 0.2;
266 EXPECT_NEAR(estimatedCov.diagonal(), pim.preintMeasCov().diagonal(), 0.1);
282 const double a = 0.2;
291 gttic(Accelerating3);
299 EXPECT_NEAR(estimatedCov.diagonal(), pim.preintMeasCov().diagonal(), 0.1);
305 gttic(AcceleratingWithBias3);
316 gttic(AcceleratingAndRotating3);
318 const double a = 0.2;
329 EXPECT_NEAR(estimatedCov.diagonal(), pim.preintMeasCov().diagonal(), 0.1);
346 const double a = 0.2;
355 gttic(Accelerating4);
363 EXPECT_NEAR(estimatedCov.diagonal(), pim.preintMeasCov().diagonal(), 0.1);
369 gttic(AcceleratingWithBias4);
380 gttic(AcceleratingAndRotating4);
382 const double a = 0.2;
393 EXPECT_NEAR(estimatedCov.diagonal(), pim.preintMeasCov().diagonal(), 0.1);
Matrix6 estimateNoiseCovariance(size_t N=1000) const
Estimate covariance of sampled noise for sanity-check.
static const double kDegree
static const Eigen::MatrixBase< Vector3 >::ConstantReturnType Z_3x1
static int runAllTests(TestResult &result)
Matrix9 estimateCovariance(double T, size_t N=1000, const Bias &estimatedBias=Bias()) const
Compute a Monte Carlo estimate of the predict covariance using N samples.
PreintegratedImuMeasurements integrate(double T, const Bias &estimatedBias=Bias(), bool corrupted=false) const
Integrate measurements for T seconds into a PIM.
static const Vector3 kRotBias(0.1, 0, 0.3)
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
static std::shared_ptr< PreintegrationParams > defaultParams()
Matrix< SCALARA, Dynamic, Dynamic, opt_A > A
Rot3 is a 3D rotation represented as a rotation matrix if the preprocessor symbol GTSAM_USE_QUATERNIO...
const AcceleratingScenario scenario(nRb, P0, V0, A)
static const double kAccelSigma
NavState predict(const PreintegratedImuMeasurements &pim, const Bias &estimatedBias=Bias()) const
Predict predict given a PIM.
#define EXPECT_NEAR(a, b, c)
Pose3 pose(double t) const override
pose at time t
#define EXPECT(condition)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
const Point3 P0(10, 20, 0)
TEST(ScenarioRunner, Spin)
const Rot3 nRb(Point3(0, 1, 0), Point3(1, 0, 0), Point3(0, 0, -1))
static const Vector3 kAccBias(0.2, 0, 0)
Pose3 pose(double t) const override
pose at time t
Simple class to test navigation scenarios.
static const imuBias::ConstantBias kNonZeroBias(kAccBias, kRotBias)
const Vector3 V0(50, 0, 0)
Accelerating from an arbitrary initial state, with optional rotation.
static const double kGyroSigma