Go to the documentation of this file.
27 using namespace gtsam;
30 int main(
const int argc,
const char *argv[]) {
31 string kernelType =
"none";
32 int maxIterations = 100;
40 maxIterations = atoi(argv[3]);
50 if (kernelType.compare(
"none") == 0) {
53 if (kernelType.compare(
"huber") == 0) {
54 std::cout <<
"Using robust kernel: huber " << std::endl;
58 if (kernelType.compare(
"tukey") == 0) {
59 std::cout <<
"Using robust kernel: tukey " << std::endl;
66 noiseModel::Diagonal::Variances(
Vector3(1
e-6, 1
e-6, 1
e-8));
68 std::cout <<
"Adding prior on pose 0 " << std::endl;
71 params.setVerbosity(
"TERMINATION");
73 params.maxIterations = maxIterations;
74 std::cout <<
"User required to perform maximum " <<
params.maxIterations
75 <<
" iterations " << std::endl;
78 std::cout <<
"Optimizing the factor graph" << std::endl;
81 std::cout <<
"Optimization complete" << std::endl;
90 std::cout <<
"Writing results to file: " <<
outputFile << std::endl;
95 std::cout <<
"done! " << std::endl;
virtual const Values & optimize()
Array< double, 1, 3 > e(1./3., 0.5, 2.)
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[])
static const SmartProjectionParams params
double error(const Values &values) const
utility functions for loading datasets
void addPrior(Key key, const T &prior, const SharedNoiseModel &model=nullptr)
@ KernelFunctionTypeHUBER
void print(const std::string &str="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
@ KernelFunctionTypeTUKEY
GTSAM_EXPORT std::string findExampleDataFile(const std::string &name)
NonlinearFactorGraph graph
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 Fri Nov 1 2024 03:34:24