update factorKeys with parents

release/4.3a0
Varun Agrawal 2025-01-24 18:16:04 -05:00
parent 22fc8238ce
commit 3ebeff149f
1 changed files with 8 additions and 0 deletions

View File

@ -116,6 +116,14 @@ HybridSmoother::addConditionals(const HybridGaussianFactorGraph &originalGraph,
factorKeys.end()) {
newConditionals.push_back(conditional);
// Add the conditional parents to factorKeys
// so we add those conditionals too.
// NOTE: This assumes we have a structure where
// variables depend on those in the future.
for (auto &&parentKey : conditional->parents()) {
factorKeys.insert(parentKey);
}
// Remove the conditional from the updated Bayes net
auto it = find(updatedHybridBayesNet.begin(),
updatedHybridBayesNet.end(), conditional);