48 const boost::optional<FactorIndices>& removeFactorIndices) {
57 if(removeFactorIndices){
59 std::cout <<
"ConcurrentIncrementalSmoother::update removeFactorIndices - not implemented yet" << std::endl;
70 constrainedKeys[key_value.key] = 1;
71 noRelinKeys.push_back(key_value.key);
87 values.
insert(key_value.key, smootherValues_.at(key_value.key));
90 for(
const auto key_value: separatorValues_) {
92 values.
insert(key_value.key, separatorValues_.at(key_value.key));
101 smootherValues_.clear();
120 if(separatorValues_.size() > 0) {
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);
250 separatorKeys.insert(key_value.key);
GaussianFactorGraph::Eliminate getEliminationFunction() const
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...
boost::shared_ptr< This > shared_ptr
void insert(Key j, const Value &val)
ISAM2 isam2_
iSAM2 inference engine
FactorIndices filterSummarizationSlots_
The slots in factor graph that correspond to the current filter summarization factors.
FastVector< FactorIndex > FactorIndices
Define collection types:
size_t nonlinearVariables
The number of variables that can be relinearized.
NonlinearFactorGraph smootherSummarization_
A temporary holding place for calculated smoother summarization.
An iSAM2-based Smoother that implements the Concurrent Filtering and Smoothing interface.
IsDerived< DERIVEDFACTOR > push_back(boost::shared_ptr< DERIVEDFACTOR > factor)
Add a factor directly using a shared_ptr.
NonlinearFactorGraph graph
NonlinearFactorGraph smootherFactors_
New factors to be added to the smoother during the next update.
bool equals(const Values &other, double tol=1e-9) const
void getSummarizedFactors(NonlinearFactorGraph &summarizedFactors, Values &separatorValues) override
FactorIndices newFactorsIndices
Result update(const NonlinearFactorGraph &newFactors=NonlinearFactorGraph(), const Values &newTheta=Values(), const boost::optional< FactorIndices > &removeFactorIndices=boost::none)
void print(const std::string &s="Concurrent Incremental Smoother:\n", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
Values calculateEstimate() const
bool equals(const NonlinearFactorGraph &other, double tol=1e-9) const
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
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
virtual bool equals(const ISAM2 &other, double tol=1e-9) const
double error
The final factor graph error.
boost::shared_ptr< This > shared_ptr
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
boost::shared_ptr< This > shared_ptr
NonlinearFactorGraph calculateMarginalFactors(const NonlinearFactorGraph &graph, const Values &theta, const KeySet &remainingKeys, const GaussianFactorGraph::Eliminate &eliminateFunction)
const ISAM2Params & params() const
const sharedFactor at(size_t i) const
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...
std::vector< T, typename internal::FastDefaultVectorAllocator< T >::type > FastVector
virtual ISAM2Result update(const NonlinearFactorGraph &newFactors=NonlinearFactorGraph(), const Values &newTheta=Values(), const FactorIndices &removeFactorIndices=FactorIndices(), const boost::optional< FastMap< Key, int > > &constrainedKeys=boost::none, const boost::optional< FastList< Key > > &noRelinKeys=boost::none, const boost::optional< FastList< Key > > &extraReelimKeys=boost::none, bool force_relinearize=false)
double error(const Values &values) const
const NonlinearFactorGraph & getFactorsUnsafe() const
bool equal(const T &obj1, const T &obj2, double tol)
const VariableIndex & getVariableIndex() const
void updateSmootherSummarization()
bool synchronizationUpdatesAvailable_
Flag indicating the currently stored synchronization updates have not been applied yet...
std::uint64_t Key
Integer nonlinear key type.
void print(const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
const Values & getLinearizationPoint() const
Access the current linearization point.