1
00:00:03,480 --> 00:00:08,760
We will now look at the simulation framework that we're going to use for the extent to theater, and

2
00:00:08,760 --> 00:00:13,920
this is just going to continue on building on the framework we use for any upcoming theater.

3
00:00:14,610 --> 00:00:19,050
So in the extended coming theater, we're going to implement a 2D vehicle filter.

4
00:00:19,440 --> 00:00:27,180
The problem is to estimate the position, velocity and orientation of a moving vehicle based on Leida

5
00:00:27,180 --> 00:00:33,280
like measurements to know landmarks or features using GPS measurements and gyroscope measurements.

6
00:00:34,230 --> 00:00:36,830
So this type of filter has many different applications.

7
00:00:36,840 --> 00:00:39,790
It's used potentially in self-driving cars.

8
00:00:39,810 --> 00:00:44,280
It's used in robotics, is used in navigation, in GPS denied areas.

9
00:00:44,520 --> 00:00:49,860
It's a very common problem to try to navigate a vehicle based on the sensor measurements of these types.

10
00:00:52,710 --> 00:00:58,860
So let's assume that the vehicle can travel at a constant speed in the 2D, X, Y plane in the direction

11
00:00:58,860 --> 00:01:05,280
it is facing, let the inputs be the turn right or the vehicle from a gyroscope and assume that the

12
00:01:05,280 --> 00:01:07,170
acceleration is a random variable.

13
00:01:07,680 --> 00:01:13,020
This is going to be the precise model of the filter, and this is going to be similar to what we did

14
00:01:13,020 --> 00:01:16,970
in the video coming through by assuming that the acceleration is random variable.

15
00:01:17,160 --> 00:01:23,190
But now we're going to add the nonlinear system into it and we're going to input the JavaScript measurements

16
00:01:23,190 --> 00:01:24,140
into it as well.

17
00:01:25,310 --> 00:01:30,860
We will assume that we get position measurements of the vehicle location, such as a sensor, like a

18
00:01:30,860 --> 00:01:31,600
GPS.

19
00:01:31,640 --> 00:01:33,390
So this is going to be the first sensor model.

20
00:01:34,070 --> 00:01:37,380
We also are going to use data fusion to fuse in a different sensor model.

21
00:01:37,710 --> 00:01:42,590
We're going to assume that we get a number of range and relative bearing measurements to known landmark

22
00:01:42,590 --> 00:01:43,330
locations.

23
00:01:43,580 --> 00:01:46,220
And this is going to be a bit like a light sensor.

24
00:01:46,430 --> 00:01:51,410
So this is going to be the second sensor model that we're going to implement and fuse into the extent

25
00:01:51,410 --> 00:01:52,160
to come and filter.

26
00:01:54,850 --> 00:01:59,620
So breaking it down, we're going to have the dynamics of the vehicle looking at this, we're going

27
00:01:59,620 --> 00:02:06,130
to represent the vehicle position in X and Y coordinates so we can have a Y, we're going to have the

28
00:02:06,130 --> 00:02:10,210
velocity of the vehicle traveling in the direction it's facing.

29
00:02:10,210 --> 00:02:14,140
So we're going to have Vocativ and it's going to be facing with a heading angle.

30
00:02:15,370 --> 00:02:18,750
Now we're going to assume that we get PSI measurements.

31
00:02:18,760 --> 00:02:21,690
So they're heading right measurements from a gyroscope.

32
00:02:22,150 --> 00:02:28,060
But we're going to assume that the acceleration right out of right is going to be sampled from a normal

33
00:02:28,060 --> 00:02:30,010
distribution with a certain uncertainty.

34
00:02:30,280 --> 00:02:34,240
So this is going to be the random variable for the acceleration.

35
00:02:34,390 --> 00:02:37,410
So this is going to be very similar to what we did in the linear theater.

36
00:02:38,620 --> 00:02:42,330
Now, for the first since the measurement, we're going to get GPS measurements.

37
00:02:42,640 --> 00:02:46,800
So they're basically just going to be pure measurements of the position of the vehicle.

38
00:02:46,810 --> 00:02:50,290
So they're going to give us pay X and pay Y with some noise.

39
00:02:50,380 --> 00:02:55,990
As a vehicle travels in this direction here, we're going to get these measurements of the vehicle's

40
00:02:55,990 --> 00:02:58,590
position from the GPS sensor as the valves.

41
00:02:59,590 --> 00:03:06,070
We also going to fuse in our light our sensor measurements to basically what the light gives us is a

42
00:03:06,070 --> 00:03:08,740
range and bearing information to know landmarks.

43
00:03:09,160 --> 00:03:14,800
So these dots here, these processes are going to be landmarks inside the environment and they're going

44
00:03:14,800 --> 00:03:16,030
to be at known positions.

45
00:03:16,030 --> 00:03:19,570
So we can have like a landmark here, landmark here, here and here.

46
00:03:20,260 --> 00:03:25,420
Now, when the landmarks in Orange Range, the leader is going to measure them and it's going to give

47
00:03:25,420 --> 00:03:27,630
us the range to Landmark from the vehicle.

48
00:03:28,120 --> 00:03:32,260
It is also going to give us the relative bearing of the landmark from the vehicle.

49
00:03:32,560 --> 00:03:33,910
So these are very angles.

50
00:03:33,910 --> 00:03:39,820
They are going to be the difference between the angle that the vehicle is facing this direction here

51
00:03:39,820 --> 00:03:41,750
and where the landmark is located.

52
00:03:42,190 --> 00:03:45,850
So as the vehicle turns, we're going to get different relative bearing measurements.

53
00:03:47,510 --> 00:03:53,060
So these are going to be the dynamics and measurements of we want the non-linear mattilda using the

54
00:03:53,060 --> 00:03:54,800
extended of diffusion.

55
00:03:57,060 --> 00:04:02,670
Now, when we start to look at the simulation code again, what we want to do is we want to investigate

56
00:04:02,670 --> 00:04:08,010
these two functions here so we have the common filter to have an answer and current field IQF student.

57
00:04:09,090 --> 00:04:15,450
So we want to do is to rename this fall here the one that's highlighted the common field of Akef, underscore

58
00:04:15,450 --> 00:04:15,930
a student.

59
00:04:16,210 --> 00:04:18,450
We want to rename that to Common Filter.

60
00:04:19,050 --> 00:04:24,300
Once we do that, then we can build the simulation and then we can go through the different exercises

61
00:04:24,300 --> 00:04:27,230
building in the changes to this file here.

62
00:04:27,900 --> 00:04:32,400
If you want to know what the full, complete simulation should look like, once you finish, you can

63
00:04:32,400 --> 00:04:34,280
do the same thing with the common thread.

64
00:04:34,290 --> 00:04:36,330
Underscore NKF, underscore ANSYS.

65
00:04:36,570 --> 00:04:42,930
If you rename Miss Tucumán to build the application, then you should be able to see what the complete

66
00:04:42,930 --> 00:04:48,140
simulation looks like before the exercises that we're going to complete for the external filter.

67
00:04:48,360 --> 00:04:50,190
We first want to start with this file here.

68
00:04:50,220 --> 00:04:55,110
So I want to rename this to Come and Filter and then we're going to make all your changes into this

69
00:04:55,110 --> 00:04:56,730
common filter code here.

70
00:04:58,750 --> 00:05:04,090
So now let's have a look at the end result of the simulation, so this is going to be running the common

71
00:05:04,090 --> 00:05:08,470
thread and so far so we're going to look at what you're going to try to build up towards.

72
00:05:10,120 --> 00:05:14,890
So now that we're using the normal and you feel the excitement coming forward, we can include a nonlinear

73
00:05:14,890 --> 00:05:19,880
process model and this allows us to use the gyroscope measurements as part of the process model.

74
00:05:20,260 --> 00:05:23,710
So when we run the simulation, we've profiled number three.

75
00:05:24,100 --> 00:05:29,300
We can include this gyroscope information, which gives us information about the right of the vehicle.

76
00:05:29,620 --> 00:05:35,140
So now that you can see that as we turn when the vehicle turns, it can be filled up at the state a

77
00:05:35,140 --> 00:05:35,680
lot quicker.

78
00:05:35,950 --> 00:05:39,740
So you can see that now we get more uncertainty in the direction that's traveling because we're using

79
00:05:39,780 --> 00:05:45,220
a random acceleration, but we can turn a lot better so we no longer have the filter blowing out large

80
00:05:45,220 --> 00:05:45,850
areas.

81
00:05:45,850 --> 00:05:50,440
And as we're doing the turn because we're using the JavaScript to update the heading of the vehicle.

82
00:05:50,860 --> 00:05:57,190
So this is one of the advantages of using a gyroscope, which means that we can get a lot more turning

83
00:05:57,190 --> 00:05:57,700
precision.

84
00:05:59,500 --> 00:06:01,240
We can also include the measurements.

85
00:06:01,250 --> 00:06:06,370
So when we run the same thing with the lighter enabled, we can see that the filter is detecting these

86
00:06:06,370 --> 00:06:11,080
light landmarks and then the yellow lines are the current measurement.

87
00:06:11,620 --> 00:06:16,270
So when we include this information inside the field, you can see that our uncertainty ellipse is a

88
00:06:16,270 --> 00:06:16,840
lot smaller.

89
00:06:16,840 --> 00:06:22,090
So we get a lot higher precision data because we're using these lighter measurements compared to as

90
00:06:22,090 --> 00:06:26,080
if we're just using the GPS measurements, which are the white crosses.

91
00:06:26,680 --> 00:06:31,240
So I can say that including this information allows us to get a higher precision result.

92
00:06:32,050 --> 00:06:36,370
So by the end of this exercise, you should be able to write the external Campbellfield to perform these

93
00:06:36,370 --> 00:06:37,030
two functions.

94
00:06:37,030 --> 00:06:42,310
It should be able to fuse the gyroscope in a non-linear model and use the GPS and other measurement

95
00:06:42,310 --> 00:06:48,010
models to come up with this even better model of how we can represent the state of the vehicle.
