29 using namespace gtsam;
31 int main (
int argc,
char** argv) {
39 std::tie(graph, initial) =
load2D(graph_file, model);
40 initial->print(
"Initial estimate:\n");
45 graph ->
addPrior(0, priorMean, priorNoise);
49 result.
print(
"\nFinal result:\n");
Matrix marginalCovariance(Key variable) const
virtual const Values & optimize()
noiseModel::Diagonal::shared_ptr model
NonlinearFactorGraph graph
int main(int argc, char **argv)
void print(const std::string &str="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
GraphAndValues load2D(const std::string &filename, SharedNoiseModel model, size_t maxIndex, bool addNoise, bool smart, NoiseFormat noiseFormat, KernelFunctionType kernelFunctionType)
Pose2 priorMean(0.0, 0.0, 0.0)
A nonlinear optimizer that uses the Levenberg-Marquardt trust-region scheme.
noiseModel::Diagonal::shared_ptr SharedDiagonal
GTSAM_EXPORT std::string findExampleDataFile(const std::string &name)
std::shared_ptr< This > shared_ptr
A class for computing marginals in a NonlinearFactorGraph.
Eigen::Matrix< double, Eigen::Dynamic, 1 > Vector
utility functions for loading datasets
Marginals marginals(graph, result)
graph addPrior(1, Pose2(0, 0, 0), priorNoise)