56 using namespace gtsam;
58 int main(
int argc,
char** argv) {
75 graph.
print(
"\nFactor Graph:\n");
83 initial.
print(
"\nInitial Estimate:\n");
87 result.
print(
"Final Result:\n");
Matrix marginalCovariance(Key variable) const
virtual const Values & optimize()
IsDerived< DERIVEDFACTOR > emplace_shared(Args &&... args)
Emplace a shared pointer to factor of given type.
A non-templated config holding any types of Manifold-group elements.
Factor Graph consisting of non-linear factors.
int main(int argc, char **argv)
NonlinearFactorGraph graph
void addPrior(Key key, const T &prior, const SharedNoiseModel &model=nullptr)
void print(const std::string &str="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
Pose2 priorMean(0.0, 0.0, 0.0)
A nonlinear optimizer that uses the Levenberg-Marquardt trust-region scheme.
void print(const std::string &str="NonlinearFactorGraph: ", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
void insert(Key j, const Value &val)
A class for computing marginals in a NonlinearFactorGraph.
Pose2 odometry(2.0, 0.0, 0.0)
Marginals marginals(graph, result)