Typedefs | Functions | Variables
SolverComparer.cpp File Reference

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>
Include dependency graph for SolverComparer.cpp:

Go to the source code of this file.

Typedefs

typedef BearingRangeFactor< Pose, Point2BR
 
typedef NoiseModelFactorN< PoseNM1
 
typedef NoiseModelFactorN< Pose, PoseNM2
 
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
 

Detailed Description

Incremental and batch solving, timing, and accuracy comparisons.

Author
Richard Roberts
Date
August, 2013

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 Documentation

◆ BR

Definition at line 72 of file SolverComparer.cpp.

◆ NM1

Definition at line 70 of file SolverComparer.cpp.

◆ NM2

Definition at line 71 of file SolverComparer.cpp.

◆ Pose

typedef Pose2 Pose

Definition at line 68 of file SolverComparer.cpp.

Function Documentation

◆ chi2_red()

double chi2_red ( const gtsam::NonlinearFactorGraph graph,
const gtsam::Values config 
)

Definition at line 74 of file SolverComparer.cpp.

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 115 of file SolverComparer.cpp.

◆ runBatch()

void runBatch ( )

Definition at line 467 of file SolverComparer.cpp.

◆ runCompare()

void runCompare ( )

Definition at line 512 of file SolverComparer.cpp.

◆ runIncremental()

void runIncremental ( )

Definition at line 243 of file SolverComparer.cpp.

◆ runPerturb()

void runPerturb ( )

Definition at line 552 of file SolverComparer.cpp.

◆ runStats()

void runStats ( )

Definition at line 583 of file SolverComparer.cpp.

Variable Documentation

◆ batch

bool batch

Definition at line 97 of file SolverComparer.cpp.

◆ compare

bool compare

Definition at line 98 of file SolverComparer.cpp.

◆ compareFile1

string compareFile1

Definition at line 102 of file SolverComparer.cpp.

◆ compareFile2

string compareFile2

Definition at line 102 of file SolverComparer.cpp.

◆ datasetMeasurements

NonlinearFactorGraph datasetMeasurements

Definition at line 105 of file SolverComparer.cpp.

◆ datasetName

string datasetName

Definition at line 90 of file SolverComparer.cpp.

◆ dogleg

bool dogleg

Definition at line 96 of file SolverComparer.cpp.

◆ firstStep

int firstStep

Definition at line 91 of file SolverComparer.cpp.

◆ incremental

bool incremental

Definition at line 95 of file SolverComparer.cpp.

◆ initial

Values initial

Definition at line 104 of file SolverComparer.cpp.

◆ inputFile

string inputFile

Definition at line 89 of file SolverComparer.cpp.

◆ lastStep

int lastStep

Definition at line 92 of file SolverComparer.cpp.

◆ nThreads

int nThreads

Definition at line 93 of file SolverComparer.cpp.

◆ outputFile

string outputFile

Definition at line 88 of file SolverComparer.cpp.

◆ perturb

bool perturb

Definition at line 99 of file SolverComparer.cpp.

◆ perturbationNoise

double perturbationNoise

Definition at line 101 of file SolverComparer.cpp.

◆ relinSkip

int relinSkip

Definition at line 94 of file SolverComparer.cpp.

◆ stats

bool stats

Definition at line 100 of file SolverComparer.cpp.



gtsam
Author(s):
autogenerated on Fri Nov 1 2024 03:43:23