33 using namespace gtsam;
46 Values linearizationPoints;
64 linearizationPoints.
insert(
x0, x_initial);
65 linearFactorGraph->push_back(
factor1.linearize(linearizationPoints, *
ordering));
95 linearizationPoints.
insert(
x1, x_initial);
96 linearFactorGraph->push_back(
factor2.linearize(linearizationPoints, *
ordering));
111 GaussianSequentialSolver solver0(*linearFactorGraph);
117 x1_predict.print(
"X1 Predict");
120 linearizationPoints.
update(
x1, x1_predict);
141 assert(cg0->nrFrontals() == 1);
142 assert(cg0->nrParents() == 0);
143 linearFactorGraph->add(0, cg0->R(), cg0->d() - cg0->R()*
result[
ordering->at(
x1)], noiseModel::Diagonal::Sigmas(cg0->get_sigmas(),
true));
183 GaussianSequentialSolver solver1(*linearFactorGraph);
184 linearBayesNet = solver1.eliminate();
189 x1_update.print(
"X1 Update");
192 linearizationPoints.
update(
x1, x1_update);
207 assert(cg1->nrFrontals() == 1);
208 assert(cg1->nrParents() == 0);
222 Q = noiseModel::Diagonal::Sigmas((
Vec(2) <, 0.1, 0.1));
226 linearizationPoints.
insert(
x2, x1_update);
230 GaussianSequentialSolver solver2(*linearFactorGraph);
231 linearBayesNet = solver2.eliminate();
236 x2_predict.print(
"X2 Predict");
239 linearizationPoints.
update(
x2, x2_predict);
249 assert(cg2->nrFrontals() == 1);
250 assert(cg2->nrParents() == 0);
274 GaussianSequentialSolver solver3(*linearFactorGraph);
275 linearBayesNet = solver3.eliminate();
280 x2_update.print(
"X2 Update");
283 linearizationPoints.
update(
x2, x2_update);
296 assert(cg3->nrFrontals() == 1);
297 assert(cg3->nrParents() == 0);
311 Q = noiseModel::Diagonal::Sigmas((
Vec(2) << 0.1, 0.1));
315 linearizationPoints.
insert(
x3, x2_update);
316 linearFactorGraph->push_back(factor10.
linearize(linearizationPoints, *
ordering));
319 GaussianSequentialSolver solver4(*linearFactorGraph);
320 linearBayesNet = solver4.eliminate();
325 x3_predict.print(
"X3 Predict");
328 linearizationPoints.
update(
x3, x3_predict);
338 assert(cg4->nrFrontals() == 1);
339 assert(cg4->nrParents() == 0);
353 linearFactorGraph->push_back(factor12.
linearize(linearizationPoints, *
ordering));
363 GaussianSequentialSolver solver5(*linearFactorGraph);
364 linearBayesNet = solver5.eliminate();
369 x3_update.print(
"X3 Update");
372 linearizationPoints.
update(
x3, x3_update);