method to get the nonlinear factors

release/4.3a0
Varun Agrawal 2024-10-30 16:32:06 -04:00
parent 7f07509388
commit be9fb064f5
1 changed files with 11 additions and 1 deletions

View File

@ -214,13 +214,23 @@ struct Switching {
return chain;
}
HybridGaussianFactorGraph linearizedFactorGraph() {
/// Get the full linear factor graph.
HybridGaussianFactorGraph linearizedFactorGraph() const {
HybridGaussianFactorGraph graph;
graph.push_back(linearUnaryFactors);
graph.push_back(linearBinaryFactors);
graph.push_back(modeChain);
return graph;
}
/// Get all the nonlinear factors.
HybridNonlinearFactorGraph nonlinearFactorGraph() const {
HybridNonlinearFactorGraph graph;
graph.push_back(unaryFactors);
graph.push_back(binaryFactors);
graph.push_back(modeChain);
return graph;
}
};
} // namespace gtsam