Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISAM2 recalculatelaBatch() BUG .When using Inc smoother, CPU usage increases #1573

Closed
x724172556 opened this issue Jul 11, 2023 · 3 comments
Closed

Comments

@x724172556
Copy link

No description provided.

@x724172556
Copy link
Author

open findunusedSlot option.In ISAM2.cpp,Fixed ISAM2.cpp(on line 664):
GaussianFactorGraph factorsToAdd;
std::vector<boost::shared_ptr> tf;
for (const auto& key_factors : marginalFactors) {
for (const auto& factor : key_factors.second) {
if (factor) {
factorsToAdd.push_back(factor);
if (marginalFactorsIndices)
marginalFactorsIndices->push_back(nonlinearFactors_.size());
#if 0
nonlinearFactors_.push_back(
boost::make_shared(factor));
#else

    tf.push_back( boost::make_shared<LinearContainerFactor>(factor));

#endif
if (params_.cacheLinearizedFactors) linearFactors_.push_back(factor);
for (Key factorKey : *factor) {
fixedVariables_.insert(factorKey);
}
}
}
}
#if 1
auto newFactorIndexs=nonlinearFactors_.add_factors(tf,params_.findUnusedFactorSlots );
// nonlinearFactors_.add_factors(
// factorsToAdd, params_.findUnusedFactorSlots);
variableIndex_.augment(factorsToAdd,newFactorIndexs); // Augment the variable index

#else
variableIndex_.augment(factorsToAdd); // Augment the variable index
#endif

@x724172556
Copy link
Author

GaussianFactorGraph factorsToAdd;
std::vector<boost::shared_ptr> tf;
for (const auto& key_factors : marginalFactors) {
for (const auto& factor : key_factors.second) {
if (factor) {
factorsToAdd.push_back(factor);
if (marginalFactorsIndices)
marginalFactorsIndices->push_back(nonlinearFactors_.size());
#if 0
nonlinearFactors_.push_back(
boost::make_shared(factor));
#else

    tf.push_back( boost::make_shared<LinearContainerFactor>(factor));
#endif
if (params_.cacheLinearizedFactors) linearFactors_.push_back(factor);
for (Key factorKey : *factor) {
fixedVariables_.insert(factorKey);
}
}
}
}
#if 1
auto newFactorIndexs=nonlinearFactors_.add_factors(tf,params_.findUnusedFactorSlots );
// nonlinearFactors_.add_factors(
// factorsToAdd, params_.findUnusedFactorSlots);
variableIndex_.augment(factorsToAdd,newFactorIndexs); // Augment the variable index

#else
variableIndex_.augment(factorsToAdd); // Augment the variable index
#endif

@varunagrawal
Copy link
Collaborator

Hi @x724172556. This issue is missing a lot of necessary information required to help us debug the problem. I am closing this issue as a result. Please re-open if this is still an issue and please provide us all necessary information to replicate the issue, as well as the expected behavior and current behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants