25 using namespace gtsam;
37 graph.
addPrior(1, priorMean, priorNoise);
48 SharedDiagonal constraintUncertainty = noiseModel::Diagonal::Sigmas(
51 constraintUncertainty);
56 initialEstimate.insert(1, x1);
58 initialEstimate.insert(2, x2);
60 initialEstimate.insert(3, x3);
62 initialEstimate.insert(4, x4);
64 initialEstimate.insert(5, x5);
66 return {
graph, initialEstimate};
76 param.
verbosity = NonlinearOptimizerParams::SILENT;
IsDerived< DERIVEDFACTOR > emplace_shared(Args &&... args)
Emplace a shared pointer to factor of given type.
static int runAllTests(TestResult &result)
A non-templated config holding any types of Manifold-group elements.
Factor Graph consisting of non-linear factors.
const Values & optimize() override
Verbosity verbosity
The printing verbosity during optimization (default SILENT)
Pose3 x2(Rot3::Ypr(0.0, 0.0, 0.0), l2)
NonlinearFactorGraph graph
#define EXPECT_DOUBLES_EQUAL(expected, actual, threshold)
void addPrior(Key key, const T &prior, const SharedNoiseModel &model=nullptr)
TEST(NonlinearConjugateGradientOptimizer, Optimize)
Pose2 priorMean(0.0, 0.0, 0.0)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
double error(const Values &values) const
Pose3 x3(Rot3::Ypr(M_PI/4.0, 0.0, 0.0), l2)
noiseModel::Diagonal::shared_ptr SharedDiagonal
Simple non-linear optimizer that solves using non-preconditioned CG.
std::tuple< NonlinearFactorGraph, Values > generateProblem()
size_t maxIterations
The maximum iterations to stop iterating (default 100)