35 using namespace gtsam;
48 Values linearizationPoints;
66 linearizationPoints.
insert(
x0, x_initial);
67 linearFactorGraph->push_back(
factor1.linearize(linearizationPoints, *
ordering));
97 linearizationPoints.
insert(
x1, x_initial);
98 linearFactorGraph->push_back(
factor2.linearize(linearizationPoints, *
ordering));
113 GaussianSequentialSolver solver0(*linearFactorGraph);
119 x1_predict.print(
"X1 Predict");
122 linearizationPoints.
update(
x1, x1_predict);
143 assert(cg0->nrFrontals() == 1);
144 assert(cg0->nrParents() == 0);
145 linearFactorGraph->add(0, cg0->R(), cg0->d() - cg0->R()*
result[
ordering->at(
x1)], noiseModel::Diagonal::Sigmas(cg0->get_sigmas(),
true));
185 GaussianSequentialSolver solver1(*linearFactorGraph);
186 linearBayesNet = solver1.eliminate();
191 x1_update.print(
"X1 Update");
194 linearizationPoints.
update(
x1, x1_update);
209 assert(cg1->nrFrontals() == 1);
210 assert(cg1->nrParents() == 0);
224 Q = noiseModel::Diagonal::Sigmas((
Vec(2) <, 0.1, 0.1));
228 linearizationPoints.
insert(
x2, x1_update);
232 GaussianSequentialSolver solver2(*linearFactorGraph);
233 linearBayesNet = solver2.eliminate();
238 x2_predict.print(
"X2 Predict");
241 linearizationPoints.
update(
x2, x2_predict);
251 assert(cg2->nrFrontals() == 1);
252 assert(cg2->nrParents() == 0);
276 GaussianSequentialSolver solver3(*linearFactorGraph);
277 linearBayesNet = solver3.eliminate();
282 x2_update.print(
"X2 Update");
285 linearizationPoints.
update(
x2, x2_update);
298 assert(cg3->nrFrontals() == 1);
299 assert(cg3->nrParents() == 0);
313 Q = noiseModel::Diagonal::Sigmas((
Vec(2) << 0.1, 0.1));
317 linearizationPoints.
insert(
x3, x2_update);
318 linearFactorGraph->push_back(factor10.
linearize(linearizationPoints, *
ordering));
321 GaussianSequentialSolver solver4(*linearFactorGraph);
322 linearBayesNet = solver4.eliminate();
327 x3_predict.print(
"X3 Predict");
330 linearizationPoints.
update(
x3, x3_predict);
340 assert(cg4->nrFrontals() == 1);
341 assert(cg4->nrParents() == 0);
355 linearFactorGraph->push_back(factor12.
linearize(linearizationPoints, *
ordering));
365 GaussianSequentialSolver solver5(*linearFactorGraph);
366 linearBayesNet = solver5.eliminate();
371 x3_update.print(
"X3 Update");
374 linearizationPoints.
update(
x3, x3_update);