26 using namespace gtsam;
28 int main(
int argc,
char** argv) {
38 auto model = noiseModel::Diagonal::Sigmas(
Vector3(0.2, 0.2, 0.1));
52 initial.insert(1,
Pose2(0.5, 0.0, 0.2));
53 initial.insert(2,
Pose2(2.3, 0.1, -0.2));
54 initial.insert(3,
Pose2(4.1, 0.1, M_PI_2));
56 initial.insert(5,
Pose2(2.1, 2.1, -M_PI_2));
63 graph.
saveGraph(
"Pose2SLAMExample.dot", result);
66 graph.
dot(cout, result);
virtual const Values & optimize()
IsDerived< DERIVEDFACTOR > emplace_shared(Args &&... args)
Emplace a shared pointer to factor of given type.
noiseModel::Diagonal::shared_ptr model
void dot(std::ostream &os, const Values &values, const KeyFormatter &keyFormatter=DefaultKeyFormatter, const GraphvizFormatting &writer=GraphvizFormatting()) const
Output to graphviz format, stream version, with Values/extra options.
int main(int argc, char **argv)
NonlinearFactorGraph graph
void addPrior(Key key, const T &prior, const SharedNoiseModel &model=nullptr)
A nonlinear optimizer that uses the Levenberg-Marquardt trust-region scheme.
void saveGraph(const std::string &filename, const Values &values, const KeyFormatter &keyFormatter=DefaultKeyFormatter, const GraphvizFormatting &writer=GraphvizFormatting()) const
output to file with graphviz format, with Values/extra options.