28 using namespace gtsam;
30 int main(
const int argc,
const char *argv[]) {
40 boost::tie(graph, initial) =
readG2o(g2oFile);
47 std::cout <<
"Computing LAGO estimate" << std::endl;
49 std::cout <<
"done!" << std::endl;
52 estimateLago.
print(
"estimateLago");
55 std::cout <<
"Writing results to file: " << outputFile << std::endl;
58 boost::tie(graphNoKernel, initial2) =
readG2o(g2oFile);
59 writeG2o(*graphNoKernel, estimateLago, outputFile);
60 std::cout <<
"done! " << std::endl;
void writeG2o(const NonlinearFactorGraph &graph, const Values &estimate, const string &filename)
This function writes a g2o file from NonlinearFactorGraph and a Values structure. ...
NonlinearFactorGraph graph
string findExampleDataFile(const string &name)
Initialize Pose2 in a factor graph using LAGO (Linear Approximation for Graph Optimization). see papers:
boost::shared_ptr< This > shared_ptr
Array< double, 1, 3 > e(1./3., 0.5, 2.)
void print(const std::string &str="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
int main(const int argc, const char *argv[])
GraphAndValues readG2o(const string &g2oFile, const bool is3D, KernelFunctionType kernelFunctionType)
This function parses a g2o file and stores the measurements into a NonlinearFactorGraph and the initi...
Values initialize(const NonlinearFactorGraph &graph, bool useOdometricPath)
utility functions for loading datasets