39 using namespace gtsam;
169 paramsChol.
linearSolverType = LevenbergMarquardtParams::MULTIFRONTAL_CHOLESKY;
200 LevenbergMarquardtParams::SetLegacyDefaults(&
params);
216 fg.
push_back(NonlinearFactorGraph::sharedFactor());
251 fg.
addPrior(0,
Pose2(0, 0, 0), noiseModel::Isotropic::Sigma(3, 1));
253 noiseModel::Isotropic::Sigma(3, 1));
255 noiseModel::Isotropic::Sigma(3, 1));
296 params.diagonalDamping =
true;
303 for (
auto& [
key,
value] : sqrtHessianDiagonal) {
354 fg.
addPrior(0,
Pose2(0,0,0), noiseModel::Isotropic::Sigma(3,1));
356 noiseModel::Robust::Create(noiseModel::mEstimator::Huber::Create(2.0),
357 noiseModel::Isotropic::Sigma(3,1)));
359 noiseModel::Robust::Create(noiseModel::mEstimator::Huber::Create(3.0),
360 noiseModel::Isotropic::Sigma(3,1)));
364 init.insert(1,
Pose2(0.961187, 0.99965, 1.1781));
385 fg.
addPrior(0,
Point2(0,0), noiseModel::Isotropic::Sigma(2,0.01));
387 noiseModel::Robust::Create(noiseModel::mEstimator::Huber::Create(1.0),
388 noiseModel::Isotropic::Sigma(2,1)));
390 noiseModel::Robust::Create(noiseModel::mEstimator::Huber::Create(1.0),
391 noiseModel::Isotropic::Sigma(2,1)));
393 noiseModel::Robust::Create(noiseModel::mEstimator::Huber::Create(1.0),
394 noiseModel::Isotropic::Sigma(2,1)));
419 fg.
addPrior(0,
Pose2(0,0, 0), noiseModel::Isotropic::Sigma(3,0.1));
421 noiseModel::Robust::Create(noiseModel::mEstimator::Huber::Create(0.2),
422 noiseModel::Isotropic::Sigma(3,1)));
424 noiseModel::Robust::Create(noiseModel::mEstimator::Huber::Create(0.2),
425 noiseModel::Isotropic::Sigma(3,1)));
427 noiseModel::Robust::Create(noiseModel::mEstimator::Huber::Create(0.2),
428 noiseModel::Isotropic::Sigma(3,1)));
430 noiseModel::Robust::Create(noiseModel::mEstimator::Huber::Create(0.2),
431 noiseModel::Isotropic::Sigma(3,1)));
461 auto huber = noiseModel::Robust::Create(noiseModel::mEstimator::Huber::Create(20),
462 noiseModel::Isotropic::Sigma(1, 1));
464 vector<double> pts{-10,-3,-1,1,3,10,1000};
469 init.insert(0, 100.0);
517 LevenbergMarquardtParams::LegacyDefaults())
520 initial_(initialValues) {}
545 noiseModel::Isotropic::Sigma(3, 1));
564 static const string filename(
"testNonlinearOptimizer.log");
590 size_t lastIterCalled = 0;
594 lastIterCalled = iteration;
595 EXPECT(newError<oldError);
615 size_t lastIterCalled = 0;
616 cgParams.
iterationHook = [&](
size_t iteration,
double oldError,
double newError)
619 lastIterCalled = iteration;
620 EXPECT(newError<oldError);
641 return (
a -
b).array().abs().maxCoeff() <
tol;
652 fg.
addPrior(0,
MyType(0, 0, 0), noiseModel::Isotropic::Sigma(3, 1));