Now that we've gone over how the common thread update updates, works and the equations behind it,
we're going to look at implementing it in the third, try to come and filter example, the update measurement
model that we're going to use in our tutee track a filter is going to be a very simple model.
All it's going to be is just a measurement of the position in the X and Y axes with a bit of noise added
to it.
So we can represent this using the common field of measurement model equation.
So the measurement is just going to be a linear combination of the state with some additive noise.
So this matrix, the measurement model is just going to be a simple identity matrix with a one and one
in the X and Y columns.
So this model here just gives us the measurement model, which is just the X and Y position measurements,
and then we're going to have a bit of additive noise to it.
And this additive noise this week is just going to be of a normal distribution with a zero mean and
covariance.
Uh, where are is just a diagonal matrix so that the X and Y noises aren't correlated and the X and
Y noise is just going to have a standard deviation of the Sigma X squared and Sigma Y squared.
And we're actually just going to assume that these two components here are just going to be the same.
So it's just going to be a sigma measurement.
So we're going to have equal noise on the X and Y axes, so we're not going to be biased towards one
or the other.
Now, the actual exercise step for the update process is to implement the common or update equations
and the 2D tracking measurement model, which we discovered.
So the first step is to open the Python file assignment, one update.
Now, when we run it, as is, we see the object starts moving from the origin.
So X and Y equals zero zero, but it moves in a random direction and speed.
So every time you run it, the direction and speed are going to be slightly different.
So the V, X and the Y are unknown.
So we want to implement the update step to help estimate these parameters.
So we want to go down to the initialization part and implement the Haganah matrixes as shown here,
and all we want to do is fill in the and Matrix's as written on the right here.
And we also want to assume that the precision measurements have a standard deviation of 10.
So basically here we have 10 squared, 10 squared for the R matrix.
So it's probably best just to use a variable so we can quickly change it later.
So once we have set up the original matrix, the next step in the process is to implement the common
filter updates to the equations.
So inside the code, we have a function called Update Step and we want to go through and implement a
different common for update equations that are required.
So you can see here these equations on the right are the commentor update equations, which we're going
through.
So we want to mathematically write them in code under the update and you'll find the different positions
inside the code.
So you can see here we have Z ahat.
So in this line of code here would work at al-Said Hat, which is our predictive measurements, which
is Hech times X, which is also written here.
So we'll go through and implement the common filter equations in this part of the code.
And then the last step is to run the simulation.
So if we run the simulation, as is, we'll say that the Kamasutra estimate does not change or is updated.
This is because the initial uncertainty is set to zero.
So we're basically taking the field that we know exactly where it is at the initial time.
Therefore, any other information that we try to use to tell it otherwise is just going to be ignored.
So what we do is then change initial velocity sanitisation to 10 and rerun the simulation.
And then when we do that, we should be seeing that the common filter updates, the state estimates.
As time goes on and we start tracking the object and the covariance around the object starts to decrease
and shrink down and converge to the true position.
And when we do this, we should also see that the main position and main velocity square there should
be fairly small as well.
So it should be tracking the object fairly well.
So I'll let you go away and implement those equations inside the Python files and run the exercise.
So after you've done that in the next video, we'll go through an explanation of what's happening behind
the scenes and what we are actually seeing in the responses.