Hello I am trying to do a marginalization "by hand" on a chain-like graph structure in Python. Yet, I am getting stuck because I think some functions needed might not have the right bindings from cpp to py.
Graph is: prior>>X0>>factor>>X1>>factor>>X2 and I want to marginalize X0 for example
My approach is like:
# Build the graph
# Optimize it with LM
# Marginalizing X(0)
Sigma = marginals.jointMarginalCovariance(X(0))
# Build a new graph without X(0)
# Constrain X(1) with a new JacobianFactor (wrapped in a LinearContainer Factor) with covariance = sigma << Here I fail because the JacobianFactor is exposed only with gtsam.gtsam.noiseModel.Diagonal as an input for the noise model so I cannot feed it the Sigma
Is this the right approach overall ? Am I missing something or is there another way?
Thank you very much, I am just willing to get control and understand marginalization better.
Regards,
Radu Cioacă