GTSAM  4.0.2
C++ library for smoothing and mapping (SAM)
Classes | Public Types | Public Member Functions | Protected Attributes | List of all members
gtsam::ConcurrentBatchSmoother Class Reference

#include <ConcurrentBatchSmoother.h>

Inheritance diagram for gtsam::ConcurrentBatchSmoother:
Inheritance graph
[legend]
Collaboration diagram for gtsam::ConcurrentBatchSmoother:
Collaboration graph
[legend]

Classes

struct  Result
 

Public Types

typedef std::shared_ptr< ConcurrentBatchSmoothershared_ptr
 
typedef ConcurrentSmoother Base
 typedef for base class
 

Public Member Functions

 ConcurrentBatchSmoother (const LevenbergMarquardtParams &parameters=LevenbergMarquardtParams())
 
 ~ConcurrentBatchSmoother () override
 
void print (const std::string &s="Concurrent Batch Smoother:\, const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
 
bool equals (const ConcurrentSmoother &rhs, double tol=1e-9) const override
 
const NonlinearFactorGraphgetFactors () const
 
const ValuesgetLinearizationPoint () const
 
const OrderinggetOrdering () const
 
const VectorValuesgetDelta () const
 
Values calculateEstimate () const
 
template<class VALUE >
VALUE calculateEstimate (Key key) const
 
virtual Result update (const NonlinearFactorGraph &newFactors=NonlinearFactorGraph(), const Values &newTheta=Values(), const std::optional< std::vector< size_t > > &removeFactorIndices={})
 
void presync () override
 
void getSummarizedFactors (NonlinearFactorGraph &summarizedFactors, Values &separatorValues) override
 
void synchronize (const NonlinearFactorGraph &smootherFactors, const Values &smootherValues, const NonlinearFactorGraph &summarizedFactors, const Values &separatorValues) override
 
void postsync () override
 

Protected Attributes

LevenbergMarquardtParams parameters_
 LM parameters.
 
NonlinearFactorGraph factors_
 The set of all factors currently in the smoother.
 
Values theta_
 Current linearization point of all variables in the smoother.
 
Ordering ordering_
 The current ordering used to calculate the linear deltas.
 
VectorValues delta_
 The current set of linear deltas from the linearization point.
 
VariableIndex variableIndex_
 The current variable index, which allows efficient factor lookup by variable.
 
std::queue< size_t > availableSlots_
 The set of available factor graph slots caused by deleting factors.
 
Values separatorValues_
 The linearization points of the separator variables. These should not be updated during optimization.
 
std::vector< size_t > filterSummarizationSlots_
 The slots in factor graph that correspond to the current filter summarization factors.
 
NonlinearFactorGraph smootherSummarization_
 A temporary holding place for calculated smoother summarization.
 

Detailed Description

A Levenberg-Marquardt Batch Smoother that implements the Concurrent Filtering and Smoother interface.

Constructor & Destructor Documentation

◆ ConcurrentBatchSmoother()

gtsam::ConcurrentBatchSmoother::ConcurrentBatchSmoother ( const LevenbergMarquardtParams parameters = LevenbergMarquardtParams())
inline

Default constructor

◆ ~ConcurrentBatchSmoother()

gtsam::ConcurrentBatchSmoother::~ConcurrentBatchSmoother ( )
inlineoverride

Default destructor

Member Function Documentation

◆ calculateEstimate() [1/2]

Values gtsam::ConcurrentBatchSmoother::calculateEstimate ( ) const
inline

Compute the current best estimate of all variables and return a full Values structure. If only a single variable is needed, it may be faster to call calculateEstimate(const KEY&).

◆ calculateEstimate() [2/2]

template<class VALUE >
VALUE gtsam::ConcurrentBatchSmoother::calculateEstimate ( Key  key) const
inline

Compute the current best estimate of a single variable. This is generally faster than calling the no-argument version of calculateEstimate if only specific variables are needed.

Parameters
key
Returns

◆ equals()

bool gtsam::ConcurrentBatchSmoother::equals ( const ConcurrentSmoother rhs,
double  tol = 1e-9 
) const
overridevirtual

Check if two Concurrent Smoothers are equal

Implements gtsam::ConcurrentSmoother.

◆ getDelta()

const VectorValues& gtsam::ConcurrentBatchSmoother::getDelta ( ) const
inline

Access the current set of deltas to the linearization point

◆ getFactors()

const NonlinearFactorGraph& gtsam::ConcurrentBatchSmoother::getFactors ( ) const
inline

Access the current set of factors

◆ getLinearizationPoint()

const Values& gtsam::ConcurrentBatchSmoother::getLinearizationPoint ( ) const
inline

Access the current linearization point

◆ getOrdering()

const Ordering& gtsam::ConcurrentBatchSmoother::getOrdering ( ) const
inline

Access the current ordering

◆ getSummarizedFactors()

void gtsam::ConcurrentBatchSmoother::getSummarizedFactors ( NonlinearFactorGraph summarizedFactors,
Values separatorValues 
)
overridevirtual

Populate the provided containers with factors that constitute the smoother branch summarization needed by the filter.

Parameters
summarizedFactorsThe summarized factors for the filter branch

Implements gtsam::ConcurrentSmoother.

◆ postsync()

void gtsam::ConcurrentBatchSmoother::postsync ( )
overridevirtual

Perform any required operations after the synchronization process finishes. Called by 'synchronize'

Reimplemented from gtsam::ConcurrentSmoother.

◆ presync()

void gtsam::ConcurrentBatchSmoother::presync ( )
overridevirtual

Perform any required operations before the synchronization process starts. Called by 'synchronize'

Reimplemented from gtsam::ConcurrentSmoother.

◆ print()

void gtsam::ConcurrentBatchSmoother::print ( )
overridevirtual

Implement a GTSAM standard 'print' function

Implements gtsam::ConcurrentSmoother.

◆ synchronize()

void gtsam::ConcurrentBatchSmoother::synchronize ( const NonlinearFactorGraph smootherFactors,
const Values smootherValues,
const NonlinearFactorGraph summarizedFactors,
const Values separatorValues 
)
overridevirtual

Apply the new smoother factors sent by the filter, and the updated version of the filter branch summarized factors.

Parameters
smootherFactorsA set of new factors added to the smoother from the filter
smootherValuesLinearization points for any new variables
summarizedFactorsAn updated version of the filter branch summarized factors
rootValuesThe linearization point of the root variables

Implements gtsam::ConcurrentSmoother.

◆ update()

virtual Result gtsam::ConcurrentBatchSmoother::update ( const NonlinearFactorGraph newFactors = NonlinearFactorGraph(),
const Values newTheta = Values(),
const std::optional< std::vector< size_t > > &  removeFactorIndices = {} 
)
virtual

Add new factors and variables to the smoother.

Add new measurements, and optionally new variables, to the smoother. This runs a full step of the ISAM2 algorithm, relinearizing and updating the solution as needed, according to the wildfire and relinearize thresholds.

Parameters
newFactorsThe new factors to be added to the smoother
newThetaInitialization points for new variables to be added to the smoother You must include here all new variables occuring in newFactors (which were not already in the smoother). There must not be any variables here that do not occur in newFactors, and additionally, variables that were already in the system must not be included here.

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