28 using namespace gtsam;
30 int main(
int argc,
char** argv) {
47 auto model = noiseModel::Diagonal::Sigmas(
Vector3(0.2, 0.2, 0.1));
50 graph.
print(
"\nFactor Graph:\n");
60 initialEstimate.
print(
"\nInitial Estimate:\n");
64 parameters.
verbosity = NonlinearOptimizerParams::ERROR;
65 parameters.
verbosityLM = LevenbergMarquardtParams::LAMBDA;
72 parameters.
iterativeParams = boost::make_shared<SubgraphSolverParameters>();
76 result.
print(
"Final Result:\n");
77 cout <<
"subgraph solver final error = " << graph.
error(result) << endl;
noiseModel::Diagonal::shared_ptr odometryNoise
Point2 prior(const Point2 &x)
Prior on a single pose.
noiseModel::Diagonal::shared_ptr model
void insert(Key j, const Value &val)
Subgraph Solver from IROS 2010.
Verbosity verbosity
The printing verbosity during optimization (default SILENT)
NonlinearFactorGraph graph
int main(int argc, char **argv)
void addPrior(Key key, const T &prior, const SharedNoiseModel &model=nullptr)
IsDerived< DERIVEDFACTOR > emplace_shared(Args &&...args)
Emplace a shared pointer to factor of given type.
A nonlinear optimizer that uses the Levenberg-Marquardt trust-region scheme.
IterativeOptimizationParameters::shared_ptr iterativeParams
The container for iterativeOptimization parameters. used in CG Solvers.
static ConjugateGradientParameters parameters
void print(const std::string &str="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
void print(const std::string &str="NonlinearFactorGraph: ", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
noiseModel::Diagonal::shared_ptr priorNoise
double error(const Values &values) const
VerbosityLM verbosityLM
The verbosity level for Levenberg-Marquardt (default: SILENT), see also NonlinearOptimizerParams::ver...
LinearSolverType linearSolverType
The type of linear solver to use in the nonlinear optimizer.