1
00:00:04,220 --> 00:00:09,170
Throughout the next couple of videos where we develop the common filter, we're going to use a common

2
00:00:09,170 --> 00:00:11,280
filter example to help explain the concepts.

3
00:00:12,080 --> 00:00:15,740
For this, we're going to look at developing a 2D tracking filter.

4
00:00:17,650 --> 00:00:22,960
The goal of a two day track, a filter, is to estimate the position and velocity of a moving object

5
00:00:22,960 --> 00:00:24,490
based on remote measurements.

6
00:00:25,240 --> 00:00:30,070
When we say remote measurements, we mean an uncooperative target or object.

7
00:00:30,070 --> 00:00:33,000
So we don't have any intrinsic information about the object.

8
00:00:33,460 --> 00:00:34,950
So there are no sensors on board.

9
00:00:34,960 --> 00:00:40,810
We don't get any acceleration measurements or we have to go is just from remote measurements or external

10
00:00:40,810 --> 00:00:41,350
measurements.

11
00:00:41,980 --> 00:00:46,960
And these could be made by a radar that could be made by another sensor.

12
00:00:48,010 --> 00:00:50,590
But all the sensing is done remotely.

13
00:00:52,130 --> 00:00:57,320
Now, this type of filter has many different applications and crops up in many different areas, such

14
00:00:57,320 --> 00:01:03,380
as radar aircraft tracking is done for optical tracking and self-driving cars, such as looking for

15
00:01:03,380 --> 00:01:09,330
obstacles or pedestrians tracking them, trying to avoid them, object tracking in images.

16
00:01:09,350 --> 00:01:15,350
So when we look at a series of images we're trying to track an object through, the image is used for

17
00:01:15,350 --> 00:01:17,600
many surveillance and military applications.

18
00:01:17,990 --> 00:01:23,270
It is used in robotics and is commonly used in GPS aided navigation and guidance.

19
00:01:25,350 --> 00:01:31,010
The problem that we want to solve is looking at a tracking attorney object as it moves in a third plane.

20
00:01:31,350 --> 00:01:34,950
So we have this to Pinay, we have the X and the Y axis.

21
00:01:34,960 --> 00:01:40,770
We have an object that's moving at some velocity and we want to work out the position of the object

22
00:01:40,770 --> 00:01:42,240
and the velocity of the object.

23
00:01:43,280 --> 00:01:48,890
So this forms subprocess process model or the dynamics of the fuda, we also assume that we get position

24
00:01:48,890 --> 00:01:52,850
measurements of the objects such as using from a radar or something or some other sensor source.

25
00:01:53,150 --> 00:01:57,500
So we have these measurements here and each of these measurements provide a measurement of the position

26
00:01:57,500 --> 00:01:59,060
of the object with time.

27
00:02:00,300 --> 00:02:02,160
So this becomes the sense of moral.

28
00:02:04,350 --> 00:02:10,170
Included in the course is a series of Python files now these files form a simulation, and one of the

29
00:02:10,170 --> 00:02:12,760
simulations they form is for a 2D tracking filter.

30
00:02:13,530 --> 00:02:17,690
So we'll be extending these files to develop a common filter for this problem.

31
00:02:19,120 --> 00:02:24,100
So now let's have a quick look at the code that's included how to use it, how it's structured and how

32
00:02:24,100 --> 00:02:26,200
we're going to use it in the examples coming up.

33
00:02:28,110 --> 00:02:33,660
The Python simulation for the two day track and field includes a number of different files as shown

34
00:02:33,660 --> 00:02:33,990
here.

35
00:02:34,650 --> 00:02:39,280
So these are the main ones we're going to be using for the first exercise being the 2D tracking filter.

36
00:02:39,900 --> 00:02:43,770
So if we have actually a look at the code and actually see what happened, we run it.

37
00:02:43,770 --> 00:02:50,220
If we open up our assignment, one underscore answer, we can get a feel for what the final simulation

38
00:02:50,400 --> 00:02:52,890
is going to look like once we complete all the exercises.

39
00:02:53,970 --> 00:02:56,670
So switching over to your favorite python environment.

40
00:02:58,700 --> 00:03:03,590
So let's have a look at an example of what happens when we run the code, so when we run the code,

41
00:03:04,100 --> 00:03:06,980
first thing we notice is that a number of Grauwe plot up.

42
00:03:07,760 --> 00:03:11,720
The first animation here is the animation or the filtering action while it's running.

43
00:03:12,290 --> 00:03:17,320
The second plot here is going to be the innovation from the measurements, which we'll talk about later.

44
00:03:17,600 --> 00:03:22,960
And we also have a figure that has the different states of the filter as well as the true state.

45
00:03:22,970 --> 00:03:26,300
So we can look at the error between the true and the estimated states.

46
00:03:27,200 --> 00:03:32,540
So this first figure here that had the animation, we have these black crosses and these represent the

47
00:03:32,540 --> 00:03:36,340
different the different position measurements as they're happening.

48
00:03:36,860 --> 00:03:38,330
We can see we have this blue dot.

49
00:03:38,450 --> 00:03:41,540
The blue represents the true state of the object that we're tracking.

50
00:03:42,230 --> 00:03:46,040
And he saw as time went on, the object moved this red dot.

51
00:03:46,040 --> 00:03:48,750
Here is the estimated position from the common filter.

52
00:03:49,040 --> 00:03:51,980
So ideally, this red dot should be tracking this blue dot.

53
00:03:51,980 --> 00:03:57,200
And you can see in this example is tracking it for fairly well, this green bubble.

54
00:03:57,200 --> 00:03:59,630
Around the red estimate is the covariance.

55
00:03:59,630 --> 00:04:02,000
This is the uncertainty around the estimate.

56
00:04:02,150 --> 00:04:05,400
So this shows you the uncertainty around the position estimates.

57
00:04:05,420 --> 00:04:11,090
So as the field of runs the true state, the blue dot should be within this uncertainty ellipse here.

58
00:04:13,490 --> 00:04:18,530
Our next figure is the innovations, so this is the difference between the actual measurements that

59
00:04:18,530 --> 00:04:22,130
we get and our predictive measurements, which we'll talk about later on.

60
00:04:22,790 --> 00:04:29,540
So these graphs here show the difference between the X and Y position measurements and the X and Y estimated

61
00:04:29,540 --> 00:04:34,060
positions or the difference between the estimated measurements and the real measurements.

62
00:04:35,180 --> 00:04:39,950
So you can see these blue lines here represent the innovations for each of the update steps inside the

63
00:04:39,960 --> 00:04:40,580
computer.

64
00:04:41,360 --> 00:04:48,010
While the green line here represents C one signal bounds of the covariance uncertainty for the innovations,

65
00:04:48,170 --> 00:04:49,610
which we'll discuss later on.

66
00:04:51,050 --> 00:04:55,880
The final figure that we want to have a look at is this one that has all the different states so you

67
00:04:55,880 --> 00:04:58,170
can see these graphs on the left side here.

68
00:04:58,190 --> 00:05:03,200
This is the exposition Y position X plus the Y velocity.

69
00:05:03,920 --> 00:05:07,210
And again, the blue line represents the true state of the system.

70
00:05:07,220 --> 00:05:12,220
So you can see in this case, we have a time across this city and this is the exposition.

71
00:05:12,860 --> 00:05:18,000
And similarly, in the Y axis, this line here represents the objects y position with time.

72
00:05:18,710 --> 00:05:23,650
Now, the black crosses represent the position measurements in the X and Y axes.

73
00:05:24,080 --> 00:05:27,500
And the red line here is the actual output from the common field.

74
00:05:28,040 --> 00:05:34,280
So their red line is the estimated position from the common theorem in the X and position in the Y.

75
00:05:34,940 --> 00:05:41,270
Now down here we have the X and Y states for velocity so we can see that the true state is moving at

76
00:05:41,270 --> 00:05:42,260
a constant velocity.

77
00:05:42,260 --> 00:05:48,320
And this case, it was moving about one meter, the second and the X and it was moving on that zero

78
00:05:48,320 --> 00:05:53,450
meters per second in the Y, the red line here is the estimate inversely from the Kalmykia.

79
00:05:53,780 --> 00:05:58,840
So I can see as a common field of runs, it starts to converge down towards the true state.

80
00:05:59,900 --> 00:06:02,690
Now, on the right hand side over here, we have the error.

81
00:06:02,990 --> 00:06:05,310
So this is the position error.

82
00:06:05,330 --> 00:06:06,770
This is, of course, the error.

83
00:06:07,160 --> 00:06:13,040
And all the error is is just the difference between the true state from the simulation and the common

84
00:06:13,040 --> 00:06:13,440
filter.

85
00:06:13,880 --> 00:06:19,070
So ideally, we want the common field of error to be about zero, which means that the estimated states

86
00:06:19,070 --> 00:06:20,450
are following the true states.

87
00:06:21,260 --> 00:06:27,350
So the red line, the error from the common of the green line here is the uncertainty from the comments

88
00:06:27,590 --> 00:06:28,610
around the error.

89
00:06:28,940 --> 00:06:35,540
So this is our three sigma uncertainty from the covariance matrix p, which we'll discuss later on.

90
00:06:37,030 --> 00:06:41,750
So when the filter is running correctly, we should see that the errors with inside are three sigma

91
00:06:41,750 --> 00:06:42,320
bounds.

92
00:06:43,180 --> 00:06:48,720
So this is a plus and minus three sigma to give you the upper and lower bounds on the error.

93
00:06:49,120 --> 00:06:51,030
So you can say this is the error for the precision.

94
00:06:51,040 --> 00:06:52,990
This is the error for our velocity.

95
00:06:54,730 --> 00:07:00,430
So every time we run the simulation, we can get a different response, so we run it again, we're going

96
00:07:00,430 --> 00:07:05,020
to start off with a different initial conditions for velocity and position.

97
00:07:05,020 --> 00:07:11,170
And we can see as the field runs, our estimate state of the position should track the blue dot quite

98
00:07:11,170 --> 00:07:11,710
nicely.

99
00:07:14,820 --> 00:07:20,640
And again, if we look at these graphs here, you can see the estimated state, the red line tracks

100
00:07:20,640 --> 00:07:25,850
the blue line very well and you can see that our velocity starts off as being zero.

101
00:07:25,860 --> 00:07:30,390
So we don't know I've lost initially, but as we run and get our position measurements, the common

102
00:07:30,390 --> 00:07:35,600
thread then can estimate the velocity and it comes and it estimates velocity and it converges towards

103
00:07:35,610 --> 00:07:36,080
a tree.

104
00:07:36,390 --> 00:07:42,630
So I can see we start off with a large initial error for Awasthi in the X and Y, but as the filter

105
00:07:42,630 --> 00:07:46,400
runs, the velocity estimates converge down to the truth.

106
00:07:46,920 --> 00:07:48,860
So they converge down to zero error.

107
00:07:49,320 --> 00:07:54,810
And the same thing for the position as the field of runs, the uncertainty shrinks and our position

108
00:07:54,810 --> 00:07:57,150
starts to converge towards the true position.

109
00:07:57,360 --> 00:08:01,350
So the object so the position filter is tracking the object very nicely.

110
00:08:03,010 --> 00:08:08,280
So in the exercises are going to be in this section, you're going to open up the corresponding file.

111
00:08:08,290 --> 00:08:11,890
So the first one we're going to be doing is the assignment one prediction.

112
00:08:12,460 --> 00:08:18,040
So if you open up the assignment, one prediction, you will see inside the script file that there'll

113
00:08:18,050 --> 00:08:20,110
be a number of common that lines.

114
00:08:20,140 --> 00:08:24,130
And these are the lines of code that you're going to have to go through and fill out the appropriate

115
00:08:24,130 --> 00:08:24,820
answer for.

116
00:08:24,820 --> 00:08:29,740
As we go through the exercises and as you go through the different exercises for the different steps,

117
00:08:30,610 --> 00:08:34,660
you should end up with a simulation that works as well as one of your shiny previously.

