Marginalization
factors::marginal — summarizing variables a sliding window has dropped.
MarginalPriorFactor
When a window marginalizes old states, the eliminated joint distribution is summarized as a Gaussian over the remaining variables. This factor carries that Gaussian in linear container form: the Jacobian is a constant matrix, fixed at the linearization point where the marginal was computed.
Blocks any number, any manifolds — the factor is manifold-agnostic. Residual , Jacobian .
Error
where
- is the concatenated
local tangent of the connected variables relative to the marginal’s
linearization point , computed by a caller-supplied
local_logclosure — this is what keeps the factor independent of which manifolds it connects; - is the square-root information of the marginal, ;
- encodes the information vector, so that the quadratic reproduced is .
Where it comes from
Marginalizing a set out of a joint information matrix leaves the Schur complement over the remaining set :
Factor and set .
The catch
The Jacobian is constant, which is the whole point of a container — but it is only exact at . As the estimate drifts away from the linearization point the prior becomes progressively wrong, and worse, it is wrong in a way that looks confident. Re-marginalize and rebuild the factor when the estimate moves far from .
The partial-pose priors that often accompany marginalization live in
factors::pose: they anchor a pose for loop-closure
initialization rather than summarize eliminated variables.