Hi there,
I'm trying to set up a sliding window Visual-Inertial Odometry pipeline using the IncrementalFixedLagSmoother in gtsam_unstable/nonlinear.
Here's a sketch of the factor graph for a better understanding:

When it comes to the marginalization of the first pose (x0), iSAM2 complains about (x0) not beeing a leave node:
Exception: "Requesting to marginalize variables that are not leaves, the ISAM2 object is now in an inconsistent state so should no longer be used."
Debugging the code and saving the BayesTree before and after reordering for marginalization, I found that all landmarks are leaves of (x0) after reordering the Bayes Tree for marginalization of (x0).
So, why are there still landmarks below (x0) after reordering (in IncrementalFixedLagSmoother::update() line 130)?
Do I have to provide the factor indices of the ProjectionFactors between (l0-l5) to (x0) to iSAM2::update()?
If so, is the reordering taking care of the margins of the removed ProjectionFactors, or is it just cutting them off?
Do you have some papers or other literature dealing with marginalization using iSAM2 ?
Thanks, and best regards,
Thomas