Contents

## Matrix Fill In

[Narrator] Hi class, this is homework assignment #6 on SLAM, and we're going to practice some more questions about the graph SLAM algorithm, and I will ask you something new about how to make graph SLAM more efficient towards the end of this homework assignment. There's 3 questions and 1 new thing, which comes with additional questions and a programming assignment. Let's dive in. In this example, picture a robot that starts at initial position 5. This robot which lives in 1D, even though I'm drawing this in 2D, sees a landmark with a relative measurement of 2. It then moves to coordinate X1 by taking a step of 7. It now sees a different landmark, L1, with a measurement value of 4. Finally, it moves again with a motion 2, and now it sees the same second landmark, not the original one,at a value of 2. Obviously, when I work it out and solve this, you find that the best coordinates over here are 12 and 14, with landmark coordinates of 7 and 16, but none of the numbers I just told you will be inserted in the question I'm about to ask. Picture the matrix omega and the vector C. I want you to add all these constraints into omega with a caveat that for the initial constraint I assume the strength is just 1, so enter it the way you're used to. Now let's assume the motion update has a sigma of 1, but the measurement update--the sigma for measurements has a value of 0.5, and remember we weigh those updates with 1 over sigma, which in the measurement case would therefore be 2. I want you to fill in the values for sigma and for C for this specific example. I gave you some of the sigma values and some of the C values, and I want you to fill in the missing values over here. You can check whether you got them correct by verifying that I got those numbers correct, and you can also solve for omega minus 1 times C, and out should come the right positions shown in the diagram over here.

## Online Slam Solution

So here is my solution to the programming assignment where I asked you to program an online version of online SLAM. Let me run it and compare it to the offline SLAM. When I run it, I get random landmarks and a random initial robot pose. My offline solution gives me this long path over here and estimated landmarks, and the remarkable thing here is that my online version that I coded gives me the same final pose and the same landmarks without retaining this huge matrix for the path before. So how did I do this? Here is my online SLAM routine. In large parts it looks exactly like my offline SLAM routine. I do it in 2D Â I have a measurement and motion. Step, here is my measurement update. I have to get all these indices right so you can stare at them for a while, but theyÂre all correct here, there is a plus one and minus one over here. And here is the first nontrivial thing. My matrix so far has one robot pose and one entry for each landmark, but now I need to add space for the next robot pose. And the way I do this is, I make an expansion list using the expand command. And this expansion list retains the original robot pose, which is coded 0 and 1, these are two-dimensional poses, and indices for the landmarks. So, IÂm squeezing in two new rows and two new columns for the next robot pose. ThatÂs happening in this code over here. With this squeezed in, I can now do the update. The update is being applied exactly at these two new rows and columns that I put in. And here is the math I gave you for factorization applied to this problem, where I go and compute the intermediate matrices A, B and C that I explained in class. And then I use the take command to kick out the very first row and column, the first two of them, to remove the old robot pose, using the exact same logic that I gave you in class. So you can look at this, this actually implements online SLAM.