Loading...
Searching...
No Matches
gtsam::TranslationRecovery Class Reference

## Public Member Functions

| TranslationRecovery (const LevenbergMarquardtParams &lmParams)
| Construct a new Translation Recovery object.
| TranslationRecovery ()=default
| Default constructor.
NonlinearFactorGraph | buildGraph (const std::vector< BinaryMeasurement< Unit3 > > &relativeTranslations) const
| Build the factor graph to do the optimization.
void | addPrior (const std::vector< BinaryMeasurement< Unit3 > > &relativeTranslations, const double scale, const std::vector< BinaryMeasurement< Point3 > > &betweenTranslations, NonlinearFactorGraph *graph, const SharedNoiseModel &priorNoiseModel=noiseModel::Isotropic::Sigma(3, 0.01)) const
| Add 3 factors to the graph:
Values | initializeRandomly (const std::vector< BinaryMeasurement< Unit3 > > &relativeTranslations, const std::vector< BinaryMeasurement< Point3 > > &betweenTranslations, std::mt19937 *rng, const Values &initialValues=Values()) const
| Create random initial translations.
Values | initializeRandomly (const std::vector< BinaryMeasurement< Unit3 > > &relativeTranslations, const std::vector< BinaryMeasurement< Point3 > > &betweenTranslations, const Values &initialValues=Values()) const
| Version of initializeRandomly with a fixed seed.
Values | run (const TranslationEdges &relativeTranslations, const double scale=1.0, const std::vector< BinaryMeasurement< Point3 > > &betweenTranslations={}, const Values &initialValues=Values()) const
| Build and optimize factor graph.

## Static Public Member Functions

static TranslationEdges | SimulateMeasurements (const Values &poses, const std::vector< KeyPair > &edges)
| Simulate translation direction measurements.

## Public Types

using | KeyPair = std::pair<Key, Key>
using | TranslationEdges = std::vector<BinaryMeasurement<Unit3>>

## Constructor & Destructor Documentation

## TranslationRecovery()

gtsam::TranslationRecovery::TranslationRecovery | ( | const LevenbergMarquardtParams & | lmParams | ) |

inline

Construct a new Translation Recovery object.

Parameters

  lmParams | parameters for optimization.

## Member Function Documentation

## addPrior()

void TranslationRecovery::addPrior | ( | const std::vector< BinaryMeasurement< Unit3 > > & | relativeTranslations,
|  | const double | scale,
|  | const std::vector< BinaryMeasurement< Point3 > > & | betweenTranslations,
|  | NonlinearFactorGraph * | graph,
|  | const SharedNoiseModel & | priorNoiseModel = noiseModel::Isotropic::Sigma(3, 0.01) ) const

Add 3 factors to the graph:

- A prior on the first point to lie at (0, 0, 0)
- If betweenTranslations is non-empty, between factors provided by it.
- If betweenTranslations is empty, a prior on scale of the first relativeTranslations edge.

Parameters

  relativeTranslations | unit translation directions between translations to be estimated
  scale | scale for first relative translation which fixes gauge.
  graph | factor graph to which prior is added.
  betweenTranslations | relative translations (with scale) between 2 points in world coordinate frame known a priori.
  priorNoiseModel | the noise model to use with the prior.

## buildGraph()

NonlinearFactorGraph TranslationRecovery::buildGraph | ( | const std::vector< BinaryMeasurement< Unit3 > > & | relativeTranslations | ) | const

Build the factor graph to do the optimization.

Parameters

  relativeTranslations | unit translation directions between translations to be estimated

Returns
  NonlinearFactorGraph

## initializeRandomly() [1/2]

Values TranslationRecovery::initializeRandomly | ( | const std::vector< BinaryMeasurement< Unit3 > > & | relativeTranslations,
|  | const std::vector< BinaryMeasurement< Point3 > > & | betweenTranslations,
|  | const Values & | initialValues = Values() ) const

Version of initializeRandomly with a fixed seed.

Parameters

  relativeTranslations | unit translation directions between translations to be estimated
  betweenTranslations | relative translations (with scale) between 2 points in world coordinate frame known a priori.
  initialValues | (optional) initial values from a prior

Returns
  Values

## initializeRandomly() [2/2]

Values TranslationRecovery::initializeRandomly | ( | const std::vector< BinaryMeasurement< Unit3 > > & | relativeTranslations,
|  | const std::vector< BinaryMeasurement< Point3 > > & | betweenTranslations,
|  | std::mt19937 * | rng,
|  | const Values & | initialValues = Values() ) const

Create random initial translations.

Parameters

  relativeTranslations | unit translation directions between translations to be estimated
  betweenTranslations | relative translations (with scale) between 2 points in world coordinate frame known a priori.
  rng | random number generator
  intialValues | (optional) initial values from a prior

Returns
  Values

## run()

Values TranslationRecovery::run | ( | const TranslationEdges & | relativeTranslations,
|  | const double | scale = 1.0,
|  | const std::vector< BinaryMeasurement< Point3 > > & | betweenTranslations = {},
|  | const Values & | initialValues = Values() ) const

Build and optimize factor graph.

Parameters

  relativeTranslations | the relative translations, in world coordinate frames, vector of BinaryMeasurements of Unit3, where each key of a measurement is a point in 3D. If a relative translation magnitude is zero, it is treated as a hard same-point constraint (the result of all nodes connected by a zero-magnitude edge will be the same).
  scale | scale for first relative translation which fixes gauge. The scale is only used if betweenTranslations is empty.
  betweenTranslations | relative translations (with scale) between 2 points in world coordinate frame known a priori. Unlike relativeTranslations, zero-magnitude betweenTranslations are not treated as hard constraints.
  initialValues | intial values for optimization. Initializes randomly if not provided.

Returns
  Values

## SimulateMeasurements()

TranslationRecovery::TranslationEdges TranslationRecovery::SimulateMeasurements | ( | const Values & | poses,
|  | const std::vector< KeyPair > & | edges )

static

Simulate translation direction measurements.

Parameters

  poses | SE(3) ground truth poses stored as Values
  edges | pairs (a,b) for which a measurement w_aZb will be generated.

Returns
  TranslationEdges vector of binary measurements where the keys are the cameras and the measurement is the simulated Unit3 translation direction between the cameras.

The documentation for this class was generated from the following files:

- /build/gtsam-Xg031d/gtsam-4.2.0+dfsg/gtsam/sfm/TranslationRecovery.h
- /build/gtsam-Xg031d/gtsam-4.2.0+dfsg/gtsam/sfm/TranslationRecovery.cpp