48 const std::optional<FactorIndices>& removeFactorIndices) {
57 if(removeFactorIndices){
59 std::cout <<
"ConcurrentIncrementalSmoother::update removeFactorIndices - not implemented yet" << std::endl;
70 constrainedKeys[
key] = 1;
71 noRelinKeys.push_back(
key);
142 gttic(get_summarized_factors);
150 gttoc(get_summarized_factors);
190 std::set<ISAM2Clique::shared_ptr> separatorCliques;
193 separatorCliques.insert( clique );
199 for(
Key key: clique->conditional()->frontals()) {
200 cliqueKeys.push_back(
key);
203 std::sort(cliqueKeys.begin(), cliqueKeys.end());
206 std::set<size_t> cliqueFactorSlots;
207 for(
Key key: cliqueKeys) {
211 std::set<Key> factorKeys(factor->begin(), factor->end());
212 if(std::includes(cliqueKeys.begin(), cliqueKeys.end(), factorKeys.begin(), factorKeys.end())) {
213 cliqueFactorSlots.insert(slot);
221 cliqueFactorSlots.erase(slot);
226 for(
size_t slot: cliqueFactorSlots) {
231 std::set<ISAM2Clique::shared_ptr> childCliques;
234 childCliques.insert(clique->children.begin(), clique->children.end());
238 childCliques.erase(clique);
const gtsam::Symbol key('X', 0)
size_t linearVariables
The number of variables that must keep a constant linearization point.
Values smootherValues_
New variables to be added to the smoother during the next update.
size_t iterations
The number of optimizer iterations performed.
Wrap Jacobian and Hessian linear factors to allow simple injection into a nonlinear graph...
const ValueType at(Key j) const
ISAM2 isam2_
iSAM2 inference engine
FactorIndices filterSummarizationSlots_
The slots in factor graph that correspond to the current filter summarization factors.
IsDerived< DERIVEDFACTOR > push_back(std::shared_ptr< DERIVEDFACTOR > factor)
Add a factor directly using a shared_ptr.
std::vector< T, typename internal::FastDefaultVectorAllocator< T >::type > FastVector
size_t nonlinearVariables
The number of variables that can be relinearized.
NonlinearFactorGraph smootherSummarization_
A temporary holding place for calculated smoother summarization.
void print(const std::string &s="Concurrent Incremental Smoother:\, const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
virtual ISAM2Result update(const NonlinearFactorGraph &newFactors=NonlinearFactorGraph(), const Values &newTheta=Values(), const FactorIndices &removeFactorIndices=FactorIndices(), const std::optional< FastMap< Key, int > > &constrainedKeys={}, const std::optional< FastList< Key > > &noRelinKeys={}, const std::optional< FastList< Key > > &extraReelimKeys={}, bool force_relinearize=false)
An iSAM2-based Smoother that implements the Concurrent Filtering and Smoothing interface.
virtual bool equals(const ISAM2 &other, double tol=1e-9) const
NonlinearFactorGraph graph
NonlinearFactorGraph smootherFactors_
New factors to be added to the smoother during the next update.
void getSummarizedFactors(NonlinearFactorGraph &summarizedFactors, Values &separatorValues) override
const Values & getLinearizationPoint() const
Access the current linearization point.
FactorIndices newFactorsIndices
FastVector< FactorIndex > FactorIndices
Define collection types:
std::shared_ptr< This > shared_ptr
const NonlinearFactorGraph & getFactorsUnsafe() const
bool equals(const ConcurrentSmoother &rhs, double tol=1e-9) const override
void synchronize(const NonlinearFactorGraph &smootherFactors, const Values &smootherValues, const NonlinearFactorGraph &summarizedFactors, const Values &separatorValues) override
GaussianFactorGraph::Eliminate getEliminationFunction() const
double error
The final factor graph error.
std::shared_ptr< This > shared_ptr
NonlinearFactorGraph calculateMarginalFactors(const NonlinearFactorGraph &graph, const Values &theta, const KeySet &remainingKeys, const GaussianFactorGraph::Eliminate &eliminateFunction)
Result update(const NonlinearFactorGraph &newFactors=NonlinearFactorGraph(), const Values &newTheta=Values(), const std::optional< FactorIndices > &removeFactorIndices={})
void print(const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
bool equals(const Values &other, double tol=1e-9) const
bool equals(const NonlinearFactorGraph &other, double tol=1e-9) const
double error(const Values &values) const
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
NonlinearFactorGraph filterSummarizationFactors_
New filter summarization factors to replace the existing filter summarization during the next update...
Values separatorValues_
The linearization points of the separator variables. These should not be changed during optimization...
virtual void resize(size_t size)
const sharedFactor at(size_t i) const
std::shared_ptr< This > shared_ptr
const VariableIndex & getVariableIndex() const
void insert(Key j, const Value &val)
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
bool equal(const T &obj1, const T &obj2, double tol)
void updateSmootherSummarization()
bool synchronizationUpdatesAvailable_
Flag indicating the currently stored synchronization updates have not been applied yet...
std::uint64_t Key
Integer nonlinear key type.
Values calculateEstimate() const
const ISAM2Params & params() const