jan m
unread,Feb 5, 2024, 5:06:22 AMFeb 5Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to gtsam users
Hello,
I use GTSAM for iteratively solving a LM problem in a sliding window fashion.
In this setting I need to marginalize out the oldest pose which is about to drop out of the sliding window and use it to build a new prior. I am faced with a problem of how to do it in GTSAM. Namely, according to the theory I shall build a Gauss-Newton system involving the states to be marginalized out and the states connected to the states to be marginalized out. Then, using the Schur Complement operation I can obtain the new Gradient and Hessian (corresponding to the information matrix with the marginalized states' information absorbed in them).
Now, I wonder how to realize this in the GTSAM API. Namely, what I do is - after solving one window I take the solution and linearize the solved graph about it into the Hessian factor.
This operation gives me the Hessian, Gradient and Constant terms. Now I can perform the Schur Complement operation on the Hessian and Gradient in order to obtain the reduced Gauss-Newton system which is independent of the marginalized states.
Now we come to the problematic part - namely, how do I use this newly obtained Hessian and Gradient (which contain the information from the marginalized states) to build the new prior? I tried to use the obtained matrices to build a `HessianFactor` and place it in the graph, nevertheless I obtain errors saying that the graph is a `NonlinearFactorGraph` and hence cannot accept the `HessianFactor` as a prior. Is there a way to use these obtained matrices to build a `PriorFactor`? If so, how to do it?
I believe there is a simple way to perform this operation in GTSAM, yet I am unable to find it - any information and help from more expereinced users is extremely welcome!
Thanks you,
Jan