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");
noiseModel::Diagonal::shared_ptr odometryNoise
virtual const Values & optimize()
A non-templated config holding any types of Manifold-group elements.
Factor Graph consisting of non-linear factors.
void insert(Key j, const Value &val)
int main(int argc, char **argv)
NonlinearFactorGraph graph
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.
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="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
void print(const std::string &str="NonlinearFactorGraph: ", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
Matrix marginalCovariance(Key variable) const
A class for computing marginals in a NonlinearFactorGraph.
noiseModel::Diagonal::shared_ptr priorNoise
Pose2 odometry(2.0, 0.0, 0.0)
Marginals marginals(graph, result)