Added check to prevent trying to add disconnected factors in iSAM1
parent
41b0b90376
commit
15fb7234e6
|
|
@ -36,8 +36,14 @@ namespace gtsam {
|
||||||
const FG& newFactors, Cliques& orphans, typename FG::Eliminate function) {
|
const FG& newFactors, Cliques& orphans, typename FG::Eliminate function) {
|
||||||
|
|
||||||
// Remove the contaminated part of the Bayes tree
|
// Remove the contaminated part of the Bayes tree
|
||||||
|
// Throw exception if disconnected
|
||||||
BayesNet<CONDITIONAL> bn;
|
BayesNet<CONDITIONAL> bn;
|
||||||
|
if (!this->empty()) {
|
||||||
this->removeTop(newFactors.keys(), bn, orphans);
|
this->removeTop(newFactors.keys(), bn, orphans);
|
||||||
|
if (bn.empty())
|
||||||
|
throw std::runtime_error(
|
||||||
|
"ISAM::update_internal(): no variables in common between existing Bayes tree and incoming factors!");
|
||||||
|
}
|
||||||
FG factors(bn);
|
FG factors(bn);
|
||||||
|
|
||||||
// add the factors themselves
|
// add the factors themselves
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue