Incremental and batch solving, timing, and accuracy comparisons. More...
#include <gtsam/slam/BetweenFactor.h>
#include <gtsam/sam/BearingRangeFactor.h>
#include <gtsam/slam/dataset.h>
#include <gtsam/geometry/Pose2.h>
#include <gtsam/nonlinear/ISAM2.h>
#include <gtsam/nonlinear/GaussNewtonOptimizer.h>
#include <gtsam/nonlinear/Marginals.h>
#include <gtsam/linear/GaussianJunctionTree.h>
#include <gtsam/linear/GaussianEliminationTree.h>
#include <gtsam/inference/Symbol.h>
#include <gtsam/base/timing.h>
#include <gtsam/base/treeTraversal-inst.h>
#include <gtsam/config.h>
#include <boost/archive/binary_iarchive.hpp>
#include <boost/archive/binary_oarchive.hpp>
#include <boost/program_options.hpp>
#include <boost/range/algorithm/set_algorithm.hpp>
#include <fstream>
#include <iostream>
#include <random>
Go to the source code of this file.
Typedefs | |
typedef BearingRangeFactor< Pose, Point2 > | BR |
typedef NoiseModelFactorN< Pose > | NM1 |
typedef NoiseModelFactorN< Pose, Pose > | NM2 |
typedef Pose2 | Pose |
Functions | |
double | chi2_red (const gtsam::NonlinearFactorGraph &graph, const gtsam::Values &config) |
int | main (int argc, char *argv[]) |
void | runBatch () |
void | runCompare () |
void | runIncremental () |
void | runPerturb () |
void | runStats () |
Variables | |
bool | batch |
bool | compare |
string | compareFile1 |
string | compareFile2 |
NonlinearFactorGraph | datasetMeasurements |
string | datasetName |
bool | dogleg |
int | firstStep |
bool | incremental |
Values | initial |
string | inputFile |
int | lastStep |
int | nThreads |
string | outputFile |
bool | perturb |
double | perturbationNoise |
int | relinSkip |
bool | stats |
Incremental and batch solving, timing, and accuracy comparisons.
Here is an example. Below, to run in batch mode, we first generate an initialization in incremental mode.
Solve in incremental and write to file w_inc: ./SolverComparer –incremental -d w10000 -o w_inc
You can then perturb that initialization to get batch something to optimize. Read in w_inc, perturb it with noise of stddev 0.6, and write to w_pert: ./SolverComparer –perturb 0.6 -i w_inc -o w_pert
Then optimize with batch, read in w_pert, solve in batch, and write to w_batch: ./SolverComparer –batch -d w10000 -i w_pert -o w_batch
And finally compare solutions in w_inc and w_batch to check that batch converged to the global minimum ./SolverComparer –compare w_inc w_batch
Definition in file SolverComparer.cpp.
typedef BearingRangeFactor<Pose,Point2> BR |
Definition at line 72 of file SolverComparer.cpp.
typedef NoiseModelFactorN<Pose> NM1 |
Definition at line 70 of file SolverComparer.cpp.
typedef NoiseModelFactorN<Pose,Pose> NM2 |
Definition at line 71 of file SolverComparer.cpp.
Definition at line 68 of file SolverComparer.cpp.
double chi2_red | ( | const gtsam::NonlinearFactorGraph & | graph, |
const gtsam::Values & | config | ||
) |
Definition at line 74 of file SolverComparer.cpp.
Definition at line 115 of file SolverComparer.cpp.
void runBatch | ( | ) |
Definition at line 467 of file SolverComparer.cpp.
void runCompare | ( | ) |
Definition at line 512 of file SolverComparer.cpp.
void runIncremental | ( | ) |
Definition at line 243 of file SolverComparer.cpp.
void runPerturb | ( | ) |
Definition at line 552 of file SolverComparer.cpp.
void runStats | ( | ) |
Definition at line 583 of file SolverComparer.cpp.
bool batch |
Definition at line 97 of file SolverComparer.cpp.
bool compare |
Definition at line 98 of file SolverComparer.cpp.
string compareFile1 |
Definition at line 102 of file SolverComparer.cpp.
string compareFile2 |
Definition at line 102 of file SolverComparer.cpp.
NonlinearFactorGraph datasetMeasurements |
Definition at line 105 of file SolverComparer.cpp.
string datasetName |
Definition at line 90 of file SolverComparer.cpp.
bool dogleg |
Definition at line 96 of file SolverComparer.cpp.
int firstStep |
Definition at line 91 of file SolverComparer.cpp.
bool incremental |
Definition at line 95 of file SolverComparer.cpp.
Values initial |
Definition at line 104 of file SolverComparer.cpp.
string inputFile |
Definition at line 89 of file SolverComparer.cpp.
int lastStep |
Definition at line 92 of file SolverComparer.cpp.
int nThreads |
Definition at line 93 of file SolverComparer.cpp.
string outputFile |
Definition at line 88 of file SolverComparer.cpp.
bool perturb |
Definition at line 99 of file SolverComparer.cpp.
double perturbationNoise |
Definition at line 101 of file SolverComparer.cpp.
int relinSkip |
Definition at line 94 of file SolverComparer.cpp.
bool stats |
Definition at line 100 of file SolverComparer.cpp.