We're looking at the residual, if this were the matrix that maps this perfectly

into this, then vb minus BN v in the N frame, that's going to give you 0.

0 squared is 0 times weight still 0, summed up is still 0.

So if you had a perfect measurement, no noise, no corruption, no ignorance and

you map it up together.

This cost function gives me 0.

You had a question?

>> Why scale it by a half?

Why would that make a difference?

>> Laziness, right?

This is what we're after, laziness in this class.

Because if I don't do a half, you will see in a moment.

If you have a function you want to optimize, if you have y of x,

find the minimum of that function, you take the derivative of that.

And if you have something squared, taking the derivative.

I get two times that, and there's a two factor write out.

And I'm really lazy, so I put a half in front of it.

That's honestly, if you look at the papers, there's mathematical language and

very flowery.

And why this makes sense, but

the bottom line is we're lazy, that's really what it's about.

So let's talk about these terms.

So if it were perfect we would get this, but we know with measurement errors.

This is not going to have five observations that are perfectly going to

match from known quantities to the measured quantities.

There's going to be some things off.

They're not completely compliant.

So this is going to be non zero.

So we take the errors, [COUGH] norm them.

That's a vector, we did the norm, L2 norm.

We square that, that's basically the dot product between these two things, right?

And we sum them all up,

that's a least squares error measure, like you're doing a least squares estimation.

It'll quickly come in here.

The next thing we could introduce is weights.

That's really important because we know, for example, a sum sensor is way better

than an emingnetic field sensor, now what is way better mean?

This is were you control it with the weights,

do I trust the sound sensor 5 times more than the magnetic field sensor?

Then you just have to make sure the weights are such that.

The weight of the sun sensor is 5 times bigger than the weight of the magnetic

field sensor.

The actual value of the weight doesn't matter.

So you could make magnetic field sensor 100 and then the sun sensor 500.

Or you could make one 5,000ths, and then the other one 1,000ths.

The absolute value doesn't matter, it's the relative value of the weights.

So again laziness, the easiest way to have is what?

One, exactly.

Yeah, we just pick one and then everything is relative to one.

So if something's better, I would go, that's good, that one's one.

These one's twice as good or twice as bad.

You can go to 0.5 or 2 depending on which one you're scaling on.

They're all equally good and in homeworks, that's kind of what you do.

You just set all the weights to one.

Since absolute values don't matter, this is what allows us to

throw a one-half in front of this and just avoid a factor of two afterwards.

If you're optimizing a cost function and you multiply the cost

function times some positive scaler, you don't change the optimum location of it.

So it's just a convenience.

But now this is Wahba's problem that she posed.

And if you go Google Wahba's problem, it's amazing to this day, decades and

decades later.

People are still solving Wahba's problem in novel and interesting ways.

And I will show you some classic methods.

There's Davenport's q-method which was very nice,

kind of groundbreaking in what it does and it enabled other methods.

There's QUESTs method.

The QUEST method flown probably that's the most popular thing flying right now.

And it was done by Malcolm Shuster and

there's lots of add-ons that were done around QUEST.

And then there's something very recent called OLE method,

it's a different kind of a thing.

And also dosens kind of optimisation, but in a different way.

So those are the three that we're going to focus on today and the rest.

But this is it, so the least squares fit.

If these mathematics look weird,

everybody has seen this kind of a least squares problem.

We've all taken measurements in labs somewhere, and it's supposed to be

a straight line, you never get a straight with line measurements.

And then you have to fit somehow a least squares behavior to it.

That's what we're doing with the attitude measure.

But we have to come up with a way to fit this three by three DCM that was embedded

in this function, right?

And that's kind of tricky.

And so how do we do this?

And that's what lots of papers to look at.

So I'm going to just start here for a few minutes and then we'll continue this.

But I wanted to set up at least the idea.

So embedded in here is this DCM.

And tracking this in a DCM form here to project inertial quantities into

body frame quantities, the DCM makes perfect sense.