39 using namespace std::placeholders;
41 using namespace gtsam;
56 const Vector3& biasHat,
const list<Vector3>& measuredOmegas,
57 const list<double>& deltaTs) {
60 list<Vector3>::const_iterator itOmega = measuredOmegas.begin();
61 list<double>::const_iterator itDeltaT = deltaTs.begin();
62 for (; itOmega != measuredOmegas.end(); ++itOmega, ++itDeltaT) {
63 result.integrateMeasurement(*itOmega, *itDeltaT);
80 Rot3 expectedDeltaR1 = Rot3::Roll(0.5 *
M_PI / 100.0);
94 Rot3 expectedDeltaR2 = Rot3::Roll(2.0 * 0.5 *
M_PI / 100.0);
106 Matrix3 gyroscopeCovariance = I_3x3 * 0.4;
107 Vector3 omegaCoriolis(0.1, 0.5, 0.9);
111 double deltaTij = 0.02;
112 Matrix3 delRdelBiasOmega = I_3x3 * 0.5;
113 Matrix3 preintMeasCov = I_3x3 * 0.2;
115 std::make_shared<PreintegratedRotationParams>(
params),
bias, deltaTij,
116 deltaRij, delRdelBiasOmega, preintMeasCov);
146 Vector3 errorExpected(0, 0, 0);
174 Vector3 errorExpected(0, 0, 0);
195 auto f = [&](
const Vector3& biasOmega) {
200 Matrix expectedH = numericalDerivative11<Rot3, Vector3>(
f, biasOmega);
205 Matrix3 actualH = -Jr *
deltaT;
217 auto f = [thetaHat](
const Vector3 deltaTheta) {
224 Matrix expectedH = numericalDerivative11<Vector3, Vector3>(
f, deltaTheta);
228 double norm =
x.norm();
229 const Matrix3 actualH =
231 (1 / (norm * norm) - (1 +
cos(norm)) / (2 * norm *
sin(norm))) *
X *
X;
253 Matrix3 delRdelBiasOmega =
256 const Matrix expectedRot =
260 const Matrix3 hatRot =
262 const Matrix3 actualRot =
263 hatRot *
Rot3::Expmap(delRdelBiasOmega * deltaBiasOmega).matrix();
277 list<Vector3> measuredOmegas;
278 list<double> deltaTs;
279 measuredOmegas.push_back(
Vector3(
M_PI / 100.0, 0.0, 0.0));
280 deltaTs.push_back(0.01);
281 measuredOmegas.push_back(
Vector3(
M_PI / 100.0, 0.0, 0.0));
282 deltaTs.push_back(0.01);
283 for (
int i = 1;
i < 100;
i++) {
284 measuredOmegas.push_back(
286 deltaTs.push_back(0.01);
298 Matrix expectedDelRdelBias = numericalDerivative11<Rot3, Vector3>(
f,
bias);
299 Matrix expectedDelRdelBiasOmega = expectedDelRdelBias.rightCols(3);
315 omegaCoriolis << 0, 0.1, 0.1;
319 auto p = std::make_shared<PreintegratedAhrsMeasurements::Params>();
348 for (
int i = 0;
i < 1000; ++
i) {
352 Matrix expectedMeasCov(3, 3);
360 Rot3 expectedRot = Rot3::Ypr(20 *
M_PI, 0, 0);
365 Matrix expectedH = numericalDerivative11<Vector3, Vector3>(
376 Rot3 Ri(Rot3::RzRyRx(0, 0, 0));
377 Rot3 Rj(Rot3::RzRyRx(0,
M_PI / 4, 0));
393 for (
size_t i = 0;
i < 5; ++
i) {
405 Rot3 expectedRot(Rot3::RzRyRx(0,
M_PI / 4, 0));
413 int numRotations = 10;
414 const Vector3 noiseBetweenBiasSigma(3.0
e-6, 3.0
e-6, 3.0
e-6);
415 SharedDiagonal biasNoiseModel = Diagonal::Sigmas(noiseBetweenBiasSigma);
418 const double omega = 0.1;
420 const Vector3 realBias(1, 2, 3);
423 auto p = std::make_shared<PreintegratedAhrsMeasurements::Params>();
425 p->gyroscopeCovariance = 1
e-8 * I_3x3;
429 const Vector3 priorNoisePoseSigmas(0.001, 0.001, 0.001);
430 const Vector3 priorNoiseBiasSigmas(0.5
e-1, 0.5
e-1, 0.5
e-1);
431 SharedDiagonal priorNoisePose = Diagonal::Sigmas(priorNoisePoseSigmas);
432 SharedDiagonal priorNoiseBias = Diagonal::Sigmas(priorNoiseBiasSigmas);
449 const Vector3 zeroBias(0, 0, 0);
450 for (
int i = 1;
i < numRotations;
i++) {
452 for (
int j = 0;
j < 200; ++
j)
474 for (
int i = 0;
i < numRotations;
i++) {