Go to the documentation of this file.
25 using namespace gtsam;
27 int main(
const int argc,
const char *argv[]) {
42 Key firstKey = 8646911284551352320;
44 std::cout <<
"Using reference key: " << firstKey << std::endl;
46 std::cout <<
"adding key " << std::endl;
48 std::cout <<
"subtracting key " << std::endl;
52 std::cout <<
"Please provide output file to write " << std::endl;
54 const string inputFileRewritten = argv[2];
55 std::cout <<
"Rewriting input to file: " << inputFileRewritten << std::endl;
58 for (
const auto k :
initial->keys()) {
68 for(
const std::shared_ptr<NonlinearFactor>& factor: *
graph) {
69 std::shared_ptr<BetweenFactor<Pose3> > pose3Between =
70 std::dynamic_pointer_cast<BetweenFactor<Pose3> >(factor);
74 key1 = pose3Between->
key<1>() + firstKey;
75 key2 = pose3Between->
key<2>() + firstKey;
77 key1 = pose3Between->
key<1>() - firstKey;
78 key2 = pose3Between->
key<2>() - firstKey;
82 simpleGraph.
add(simpleFactor);
85 writeG2o(simpleGraph, simpleInitial, inputFileRewritten);
const Symbol key1('v', 1)
std::shared_ptr< This > shared_ptr
GraphAndValues readG2o(const std::string &g2oFile, const bool is3D, KernelFunctionType kernelFunctionType)
This function parses a g2o file and stores the measurements into a NonlinearFactorGraph and the initi...
int main(const int argc, const char *argv[])
const Symbol key2('v', 2)
utility functions for loading datasets
graph add(PriorFactor< Pose2 >(1, priorMean, priorNoise))
const gtsam::Symbol key('X', 0)
void insert(Key j, const Value &val)
GTSAM_EXPORT std::string findExampleDataFile(const std::string &name)
IsDerived< DERIVEDFACTOR > add(std::shared_ptr< DERIVEDFACTOR > factor)
add is a synonym for push_back.
NonlinearFactorGraph graph
std::uint64_t Key
Integer nonlinear key type.
std::shared_ptr< This > shared_ptr
void writeG2o(const NonlinearFactorGraph &graph, const Values &estimate, const std::string &filename)
This function writes a g2o file from NonlinearFactorGraph and a Values structure.
gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:03:36