Open wxliu1 opened 6 days ago
The tools are all there, but we don't currently have them bundled together into a single function or set of functions to call for this. The process would with the current API would be something like:
sym::Factor
s touching the variables you want to marginalizesym::Linearizer
to linearize those factors (you could do this manually also, but using the Linearizer
is probably easier)sym::SchurComplementSolver
doesn't quite expose what you'd need to do this, so for now you'd do this just with e.g. linear algebra ops from Eigensym::Factor
with the resulting linearization after elimination, and use that in the next optimizationThe tools are all there, but we don't currently have them bundled together into a single function or set of functions to call for this. The process would with the current API would be something like:
- Collect the
sym::Factor
s touching the variables you want to marginalize- Use a
sym::Linearizer
to linearize those factors (you could do this manually also, but using theLinearizer
is probably easier)- Eliminate the marginalized variables in the resulting linearization. The
sym::SchurComplementSolver
doesn't quite expose what you'd need to do this, so for now you'd do this just with e.g. linear algebra ops from Eigen- Create a new
sym::Factor
with the resulting linearization after elimination, and use that in the next optimization
Symforce doesn't have an official implementation of marginalization, is it because that the manipulation of matrix which is no longer sparse after being marginalized, can't get noticeable accelerated with symforce?
How to use symforce to generate marginalization prior factors? In ther words, how to use symforce to add marginalization factors to the optimizer?