Skip to content

Commit

Permalink
get keys from NonlinearFactors as well
Browse files Browse the repository at this point in the history
  • Loading branch information
varunagrawal committed Sep 28, 2024
1 parent 6d57055 commit b2c73af
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gtsam/hybrid/HybridFactorGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/

#include <gtsam/hybrid/HybridFactorGraph.h>
#include <gtsam/nonlinear/NonlinearFactor.h>

namespace gtsam {

Expand Down Expand Up @@ -58,6 +59,8 @@ const KeySet HybridFactorGraph::continuousKeySet() const {
}
} else if (auto p = std::dynamic_pointer_cast<GaussianFactor>(factor)) {
keys.insert(p->keys().begin(), p->keys().end());
} else if (auto p = std::dynamic_pointer_cast<NonlinearFactor>(factor)) {
keys.insert(p->keys().begin(), p->keys().end());
}
}
return keys;
Expand Down

0 comments on commit b2c73af

Please sign in to comment.