gtsam
Loading...
Searching...
No Matches
HybridSmoother.h
Go to the documentation of this file.
1/* ----------------------------------------------------------------------------
2
3 * GTSAM Copyright 2010, Georgia Tech Research Corporation,
4 * Atlanta, Georgia 30332-0415
5 * All Rights Reserved
6 * Authors: Frank Dellaert, et al. (see THANKS for the full author list)
7
8 * See LICENSE for the license information
9
10 * -------------------------------------------------------------------------- */
11
18
23
24#include <optional>
25
26namespace gtsam {
27
28class GTSAM_EXPORT HybridSmoother {
29 private:
31 Values linearizationPoint_;
32
33 HybridBayesNet hybridBayesNet_;
35 std::optional<double> marginalThreshold_;
36 DiscreteValues fixedValues_;
37
38 public:
46 HybridSmoother(const std::optional<double> marginalThreshold = {})
47 : marginalThreshold_(marginalThreshold) {}
48
50 const DiscreteValues& fixedValues() const { return fixedValues_; }
51
55 void reInitialize(HybridBayesNet&& hybridBayesNet);
56
61 void reInitialize(HybridBayesNet& hybridBayesNet);
62
82 void update(const HybridNonlinearFactorGraph& graph, const Values& initial,
83 std::optional<size_t> maxNrLeaves = {},
84 const std::optional<Ordering> givenOrdering = {});
85
98 Ordering getOrdering(const HybridGaussianFactorGraph& factors,
99 const KeySet& newFactorKeys);
100
110 std::pair<HybridGaussianFactorGraph, HybridBayesNet> addConditionals(
111 const HybridGaussianFactorGraph& graph,
112 const HybridBayesNet& hybridBayesNet) const;
113
121 HybridGaussianConditional::shared_ptr gaussianMixture(size_t index) const;
122
124 const HybridBayesNet& hybridBayesNet() const;
125
127 HybridValues optimize() const;
128
135 void relinearize(const std::optional<Ordering> givenOrdering = {});
136
138 Values linearizationPoint() const;
139
141 HybridNonlinearFactorGraph allFactors() const;
142
150 double error(const HybridValues& x) const;
151
160 double error(const VectorValues& x) const;
161
162 private:
164 Ordering maybeComputeOrdering(const HybridGaussianFactorGraph& updatedGraph,
165 const std::optional<Ordering> givenOrdering);
166
177 HybridGaussianFactorGraph removeFixedValues(
178 const HybridGaussianFactorGraph& graph,
179 const HybridGaussianFactorGraph& newFactors);
180};
181
182} // namespace gtsam
Linearized Hybrid factor graph that uses type erasure.
A Bayes net of Gaussian Conditionals indexed by discrete keys.
Nonlinear hybrid factor graph that uses type erasure.
Global functions in a separate testing namespace.
Definition chartTesting.h:28
Point3 optimize(const NonlinearFactorGraph &graph, const Values &values, Key landmarkKey)
Optimize for triangulation.
Definition triangulation.cpp:178
A map from keys to values.
Definition DiscreteValues.h:34
A hybrid Bayes net is a collection of HybridConditionals, which can have discrete conditionals,...
Definition HybridBayesNet.h:37
Definition HybridNonlinearFactorGraph.h:34
const DiscreteValues & fixedValues() const
Return fixed values:
Definition HybridSmoother.h:50
HybridSmoother(const std::optional< double > marginalThreshold={})
Constructor.
Definition HybridSmoother.h:46
A non-templated config holding any types of Manifold-group elements.
Definition Values.h:65