|
gtsam
|
Class which implements Discrete-Continuous Smoothing And Mapping, as detailed in Doherty22ral (https://arxiv.org/abs/2204.11936).
Performs hybrid optimization by alternatively optimizing for continous and discrete variables.
Public Member Functions | |
| DCSAM (const ISAM2Params &isam_params) | |
| void | update (const HybridNonlinearFactorGraph &graph, const HybridValues &initialGuess=HybridValues()) |
| For this solver, runs an iteration of alternating minimization between discrete and continuous variables, adding any user-supplied factors (with initial guess) first. | |
| void | update (const HybridNonlinearFactorGraph &graph, const DiscreteValues &initialGuessDiscrete) |
| Inline convenience function to allow "skipping" the initial guess for continuous variables while adding an initial guess for discrete variables. | |
| void | update () |
| Simply used to call update without any new factors. | |
| HybridValues | calculateEstimate () const |
| This is the primary function used to extract an estimate from the solver. | |
| const VectorValues & | getDelta () const |
| Access the current delta, computed during the last call to update. | |
| double | error (const VectorValues &x) const |
| Compute the linear error using the underlying solver. | |
| const DiscreteFactorGraph & | getDiscreteFactorGraph () const |
| Used to obtain the marginals from the solver. | |
| const NonlinearFactorGraph & | getNonlinearFactorGraph () const |
Protected Member Functions | |
| void | updateDiscrete (const DiscreteFactorGraph &dfg=DiscreteFactorGraph(), const DiscreteValues &discreteVals=DiscreteValues()) |
| Add factors in dfg to member discrete factor graph dfg_, then optimize for most probable explanation and update the current discrete estimate. | |
| void | updateContinuous (const NonlinearFactorGraph &newFactors, const Values &initialGuess) |
| Given the latest discrete values (currDiscrete_), a set of new factors (newFactors), and an initial guess for any new keys (initialGuess), this method. | |
| DiscreteValues | solveDiscrete () const |
| Solve for discrete variables given continuous variables. | |
| HybridValues gtsam::DCSAM::calculateEstimate | ( | ) | const |
This is the primary function used to extract an estimate from the solver.
Internally, calls isam_.calculateEstimate() and dfg_.optimize() to obtain an estimate for the continuous (resp. discrete) variables and packages them into a HybridValues.
|
inline |
Used to obtain the marginals from the solver.
NOTE: not obviously correct (see DCSAM.cpp implementation) at the moment. Should perhaps retrieve the marginals for the factor graph obtained as isam_.getFactorsUnsafe() and dfg_ rather than taking as a parameter? I think this was originally intended to mimic the gtsam Marginals class.
| graph | |
| continuousEst | |
| dfg |
|
protected |
Solve for discrete variables given continuous variables.
Internally, this method computes DiscreteBoundaryFactors from the hybrid factors using the current continuous estimate currContinuous_, and then calls dfg_.optimize() to get the most probable estimate.
| void gtsam::DCSAM::update | ( | ) |
Simply used to call update without any new factors.
Runs an iteration of optimization.
| void gtsam::DCSAM::update | ( | const HybridNonlinearFactorGraph & | graph, |
| const HybridValues & | initialGuess = HybridValues() ) |
For this solver, runs an iteration of alternating minimization between discrete and continuous variables, adding any user-supplied factors (with initial guess) first.
| graph | - a HybridNonlinearFactorGraph containing all factors to add. |
| initialGuessContinuous | - an initial guess for any new continuous keys that appear in the updated factors (or if one wants to force override previously obtained continuous values). |
| initialGuessDiscrete | - Initial guess for discrete variables. |
|
protected |
Given the latest discrete values (currDiscrete_), a set of new factors (newFactors), and an initial guess for any new keys (initialGuess), this method.
See implementation for more detail.
|
protected |
Add factors in dfg to member discrete factor graph dfg_, then optimize for most probable explanation and update the current discrete estimate.
| dfg | - A discrete factor graph containing the factors to add |
| discreteValues | - An assignment to the continuous variables (or subset thereof). |