Let's do a quick review of attitude estimation. So, Amanda. If I talk about an observation in attitude estimation, what am I talking about? >> Unit vector. >> A unit vector. Okay, that's a good answer. So, how may independent degrees of freedom do you measure with a unit vector? >> [INAUDIBLE]. >> Two. But a unit vector consist of, three coordinates. You can measure it relative to a body. There's an X, Y and Z coordinate. That's the direction the sun was. This is the direction magnetic field is, right. So while we get three coordinates, it's just a unit vector. So through the unit constraint, there's only two that are really independent. You can also think of it as [INAUDIBLE] elevation. You're really just getting two angles, gives you a heading, but we took an expressive as a three by one vector. That's typically what you have. So, that's the observation. So let's some highlights. There are several assumptions to do this estimation. We assumed a, and b, and c, and a bunch of things. So, to give you some highlights. What did we assume with this estimation problem? >> [INAUDIBLE] >> Okay. In this room, if you think of this, you do know if I'm the one doing the estimations, and somebody spun me around. I need to know where in the room am I? Otherwise saying hey, this big whiteboard is to my left, means one thing for my orientation, If I'm in a different location in the room, that thing being to my left, I'm actually pointing in a very different way. So that means for us to know where in the orbit am I, or enough information to resolve that. What else? Known location. What other things did we have. CK. >> [INAUDIBLE] >> Environment, you need to know. This count for zen thing, Kung fu fighting or something. Know your environment, all right. What was that? On Batman, the first one with Liam Niesen, when he's teaching him make some break through the ice, all of that. Know your environment stuff, all right. It's that kind of a thing, but it's important, because otherwise if somebody just tells me hey, you're in this room and you're here. And the white board's to my left. And you guys shuffle the white board all over the place, I have no idea where I'm actually pointing. I need to know where is the white board in this room to be able to do that. For us, that means we need to know where is the sun right now in space, relative to my location? What is the magnetic field? If I don't know the magnetic field, I can measure it, but I can't do much with it, right? So, all of these things are important. So, those are some key stuff. Now how does estimation work, fundamentally? What do we measure, one else do we need to make this completed? What do you think? You're being way too shy, considering we're T-minus of few weeks of the midterm. You remember something, Andrei? >> [INAUDIBLE] >> Okay, so let me just make a V1. >> [COUGH] >> I'd say that's my observations we're talking about, right? Something that I'm measuring. >> [COUGH] >> You need to know it in which space? >> Inertial. >> Why inertial? >> [INAUDIBLE] >> If you wanted to do a different problem, let us say I am doing relative heading. I am using a camera, you have all seen this. Like facial trackers that track features on a spacecraft. Each gives you a heading. I know the space craft, I know the geometry, I know my location trying to figure out what's my heading. This is kind of classic vision problems I got too. You may not be measuring relative to an inertial frame, right. You might be doing, so here in class we typically treat it as an inertial. But it's not a fundamental requirement of this estimation technique that we have. There's no here, it's really a purely kinematic relation of how do these headings expressed in one frame relate to another frame. So good, so I'm glad you said that. Inertia is typically what we use, but just remember it's not required to be inertial, this could be something else as well. Good, and then we have the measurement which is always in the body frame, right? That's what we care about with spacecraft. In the body you have the magnetometer, or sun sensors, horizon sensors. Star trackers, things that give me different kind of headings. Visual sensors, cameras, all this kind of stuff. And the question then is how does this relate? So, what's the fundamental thing, Robert? That we use to relate a vector in the N frame to a vector in the B frame? >> [INAUDIBLE] >> Which we use what? DCM, all right. Now I'm going to add a bar over stuff, because this is what we're trying to find. I won't get, unless I'm really, really lucky, the true body attitude. But I tend to get an estimated version of it. So this is how I differentiate in these notations between, this is my estimated body. Versus the truth body. Then we can look at B bar to find the actual estimation errors. This is it. Will I be able to use one observation, to do the complete general attitude problem. Trevor? >> [INAUDIBLE] >> Okay, so one, as we were talking about earlier, mentioned this was only two degrees of freedom. Attitude, is a three degrees of freedom problem. So one is not enough. It's immediately under-determined. If you do two measurements, it's immediately over-determined. And that's just a fundamental issue in life. [LAUGH] And it would be nice if we had one that was just, what we needed to keep it simple and just move it on. It's not quite that way, right. So that's a fundamental thing that we have. So good, we need a second measurement using all unit vectors. So, I'm just going to have the hat in the B frame. And it's the same estimated attitudes that will map one to another. Now, will there be an estimated attitude that will map these known quantities into these measured quantities? Math, is that going to happen perfectly in mathematics? >> [LAUGH] >> [INAUDIBLE] >> Okay, where I lose you? Step one? >> [INAUDIBLE] >> [LAUGH] Okay. So we'll let you recover. Okay, so Nick, help that out, will there be a single dcm that perfectly maps these known quantities into these measured quantities? >> No. >> Why not? >> [INAUDIBLE] >> Which one? >> [INAUDIBLE] I don't really know. I also realized in this last lecture one I sat down [INAUDIBLE] >> Definitely, catch up. Russell, help us out. Will those areas in there, right? So the answer was correct, no, you don't get it, right? But this is where I'm trying to review quickly fundamentally when you do this homework make sure you're on the right track. because, some people go, well, I tried this and I can match one of my vectors, but the other one's not right. Well, that's probably still correct. You won't be able to. because, with measurement noise there could be noise in here. Maybe you can find a DCM that perfectly matches one vector into another. But then it's not going to match the other. So it's kind of like, I'm really critical on this one, but this one I'm just not going to be able to match well, because with noise it won't always be the same. Is like when you do classic highschool physics problems, and you have to use voltage versus current measurements on the resistor or something. It's supposed to be a straight line, but who ever got a straight line? I never did. The line went all over the place, right? because that's real life, it's measurements, noise Corruptions. You can have this. So, it won't be one. So immediately we have to recognize with estimation, life is going to be a little bit more difficult. What is the best that we pick, right? And there's different ways to do this and that's what we're going to do. Now there is different ways to define best. There was one lady who defined the formula. Anybody remember her name? Wahba, right? She came up, it's the classic thing. If you look up Wahba's problem, tons of publications on how this could be solved. But they all solve the same optimality problem. And we saw last time, well, it didn't solve Wahba's problem actually. Which one was that, which estimation method did we do? Andrew? >> Triad. >> The triad method, right, the triad method doesn't solve an optimality problem. Who can outline for me what the triad method did? Just in basic words. Go ahead Jordan. >> You pick your best [INAUDIBLE] >> But our best measurement, we typically said that was the sun, if you had sun and magnetic. It was very, sun's tend to be way more accurate than magnetic fields. There's a lot of uncertainty in magnetic fields, right? Good, so we set that one. How do we get our second axis? >> Cross it into your second measurement and normalize >> Crossed with the magnetic field. And this is normalized by itself to make a unit vector, that should be a 2. And then 3 is t1 crossed to t2 which gives you a right handed coordinate frame, right. So we define, instead of going, I want the additive between these two frames, we actually step back and say well, It's easier to get the attitudes of body and inertial relative to a third independent frame, a different frame. And then we reassemble it. And that's the trick. So we have measurements in the N frame, so we can do all this stuff in the N frame, and in the end, you can get TN and we have everything in the B frame, so DN, we can get BN, no, BT, not BN, just messed it up. [COUGH] Once you get here, is NT, and you get BT. And then you multiply them out with the transpose, and that will give you BN. I mean, that's fundamentally, in quick terms, what the triad method to do this right. So, there's no optimality. We put in this light waving saying which one is better. That means we use one of the vectors completely, setting t one equal to s hat. I'm using that all information. All those two degrees of freedom we're talking about. And the m, we're just using partially to get something that's orthogonal >> [COUGH] >> To this and this but there's an infinity of m's that would actually give you that mathematically, right? So, that's it, but I cannot say the s is ten times better than m. To use it more or maybe the m is only part, you know slightly worse then this sensor because it's a very coarse sensor. There's no way to put weights into this function. One of them is picked completely, the other one is picked partially. That's all the knobs you have. And then, you just run through it and you get it. And there's different versions of this, right. Whereas [INAUDIBLE] problem, really formulates the estimation problem as a least squares optimization, where you're saying okay, this in the body frame minus as Robert was saying, right, we're looking for this DCN that maps the known quantity, I'll add indices in front of this, in the inertial frame. This will give you your error, right. This is supposed to be exactly equal to this, but we know with noise, corruptions, uncertainties of where I'm really at there's always these error sources. This is not going to give me perfectly a zero vector. But I want to make him as small as possible, in a least square sets. So you do this basically and you would, in matrix math, you would transpose. Vi-hat B- the estimated Vi-hat N, that's it. And now, we have N of these. So there's a cos function that sums up over, wait, equal to 1 to N. That's my cos function J. What else did we have in formulation? Weights, actually, right? So, there were weights in here. Each observation we could add a weight. Now, is it Ben? >> [COUGH] >> No. Billy? >> Brian. >> Brian. Man. Something with me. Sorry. Brian, what values of a weight do you pick? In here. How do you determine weights? >> Higher weight would be for a better measurement. >> Right, does the absolute value matter? >> No. >> That's the key thing to remember. Some people go, you didn't tell me what weights to use. I just know they're equally g >> [COUGH] >> Well if they're equally good make them ten and ten, make them one and one. People often like weights around one just as [INAUDIBLE] condition but. That's it. So the relative magnitude is important. The absolute magnitude, doesn't actually matter in this, okay? So good, this was a quick review of this stuff that we did last time, estimation. Now, let's look at some other methods. So we went through the triad method >> [SOUND] >> And that was good. We get an answer, but there's no way to add weights. There's no way, this method, to add five observations. I only can use two, in fact, actually I used one and a half. That's it. [INAUDIBLE] you had a question for me? >> In this problem, are we trying to [INAUDIBLE] cost function? >> Yes. In Wahba's formulation, we're trying to minimize this cost function J, because that means this vector ideally should be equal to this matrix, right. These matrices have to be the same, if I have no measurement [INAUDIBLE] and everything's perfectly lined up, but in real life with all these corruptions and uncertainty, it's not going to happen. So we want to make this residual, this is your least squares residual, as small as possible, so that finds that optimal fit. Which is kind of like this, kind of problem which is y equal to ax plus b. But it's done in a 3D attitude sense, which makes it look more complicated. But I'll be jumping back to this as an analogy. Several times as we go through this.