Problems with Marginals and ISAM2

Skip to first unread message

Felix Esser

Sep 23, 2020, 12:08:18 PM9/23/20
Hello GTsam Users,

During the last weeks I have been working on the topic of factor graphs for my master thesis.
I use the Python wrapper from GTSAM and want to optimize IMU and GPS data using a factor graph. Later I will add pictures and landmarks into the graph.

For this I currently use ISAM2 (as in the example file

My graph is based on this example and was extended by the GPS observations.

Now my problem:

For the calculation of the statistically best trajectory I need the covariance matrices of the estimated navigation states and BIAS estimates. I would like to calculate these using the following line:

marginals = gtsam.marginals(newgraph, result)

But with ISAM2 the error message appears: IndeterminantLinearSystemException after the first incremental step.
This also occurs, if I add the line: marginals = gtsam.Marginals(newgraph, result) in the example 

A corresponding screenshot of the error message and the inserted line in the is added to the Appendix.

Best regards,


Felix Esser

Sep 23, 2020, 12:23:05 PM9/23/20
Update. correct screenshot 

Varun Agrawal

Sep 23, 2020, 11:20:47 PM9/23/20
to gtsam users
A couple of things:

1. I highly recommend using the latest version of GTSAM (the develop branch on github). It has a bunch of fixes and updates to the IMUFactor code and examples. The file has been renamed to
2. I cannot reproduce the Indeterminate Linear System (ILS) error in the basic example. However, you will encounter the ILS error if you try to compute marginals because this example is inherently underconstrained. Ideally, you would also have some external measurements (such as landmarks or GPS) to further constrain the problem. Take a look at ImuFactorsExample.cpp for information on adding GPSFactors. If you need help understanding that example, you can respond to this message. :)

Reply all
Reply to author
0 new messages