# How to avoid matrix singularity in GraphSLAM

I am trying to implement GraphSLAM from Sebastian Thrun's paper, The GraphSLAM Algorithm with Applications to Large-Scale Mapping of Urban Structures.

When I compute the inverse of my information matrix, $\Omega^{-1}$, I get an error, Matrix is Singular, because $\Omega$ is singular. How could I avoid matrix singularity when implementing GraphSLAM?

Please don't suggest me pinv() method it cannot give me actual answer.

I had considered using a pseudo-inverse, but, instead, I want to prevent $\Omega$ from becoming singular so that I can compute the exact inverse.

Below is where $\Omega$ is computed (see line 7), from Table 2. Calculation of and ξ in GraphSLAM:

• It is a 3*3 matrix where diagonal elements are 0.001 and all other elements are zero. – Encipher Jul 25 '18 at 17:28
• I retracted my earlier comments. I saw $R_t^{-1}$ and assumed that that was the inverse matrix you were computing. You should update your post to include more details on the $\Omega^{-1}$ computation, because it is not performed in the given pseudo code. – koverman47 Jul 25 '18 at 20:20
• I have only this pseudo code. This is the problem of this implementation. So that I am looking for help. – Encipher Jul 26 '18 at 6:10
• Is the code here the code that you are using? – koverman47 Jul 26 '18 at 14:44
• If you don't want to use a pseudo-inverse, you can regularize $\Omega$ by adding $\Omega := \Omega + \epsilon I$ for some small $\epsilon > 0$. Also, looking at your first comment, if $\Omega$ is a diagonal with 0.001, then it should be invertible. – LanguagesNamedAfterCofee Oct 28 '18 at 6:37

If $\Omega$ is singular, you cannot avoid a matrix singularity. This is like saying you want to solve the system of equations $$x = 1$$ $$x = 7$$