How the fix lag smoother handling (Marginalize) prior factors

125 views
Skip to first unread message

J Zhang

unread,
Dec 1, 2021, 9:51:08 PM12/1/21
to gtsam users
Assume I have a SFM problem where I fixed X0 with a strong prior and some strong priors for all the landmarks anchored on X0, then I am start tracking the landmark 2d features by optical flow. This could be a monocular VO pipeline where the system bootstaped by some known 3d points. 

So my factor graph would look like this:
prior--> X0 - X1 - X2 - X3 - X4 - X5
prior-> P0,   [many landmarks]

If I just use a fixlagsmoother (batch or isam2), do I need to keep track of the oldest pose and the points originated from it, so I will need to keep adding prior to them to keep locking the scale?
A batch fix lag smoother seems will drop the prior factors when removing a variable since they are not connected to other nodes. Any comments are welcome.  

J Zhang

unread,
Dec 7, 2021, 5:45:11 PM12/7/21
to gtsam users
After reading the iSAM2 paper again, I _think_ I know how the prior factors are being handled. 
During the Bayes tree building process (Factorization, Reordering), the prior information will be absorbed into the upper part of Bayes tree so I think there is no need to manually track the first pose/landmarks and keep setting their prior as this 
has been handled automatically by iSAM2/Incremental smother. 

Dellaert, Frank

unread,
Dec 8, 2021, 11:16:05 PM12/8/21
to J Zhang, gtsam users
That’s right, you should only add factors once. ISAM it’s just an incremental solver for a factor graph. You could do a batch optimize for exactly the same graph, and you should get the same answer. With exactly the same factors added, only once. In fact, that is not a bad unit test for your implementation, for a small number of times, say.

Frank

From: gtsam...@googlegroups.com <gtsam...@googlegroups.com> on behalf of J Zhang <zju...@gmail.com>
Sent: Tuesday, December 7, 2021 5:45:11 PM
To: gtsam users <gtsam...@googlegroups.com>
Subject: [GTSAM] Re: How the fix lag smoother handling (Marginalize) prior factors
 
--
You received this message because you are subscribed to the Google Groups "gtsam users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gtsam-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gtsam-users/ed419a5a-3d3f-4971-8a25-7f27b92200b0n%40googlegroups.com.

J Zhang

unread,
Dec 9, 2021, 7:49:33 AM12/9/21
to gtsam users
Thank you for the input, professor. 
The fact that the iSAM2/Bayes tree can get  the  exact solution with full batch solver sometimes sounds too good to be true. However, after reading the paper a few times, I am starting getting the beauty of it. 
Reply all
Reply to author
Forward
0 new messages