... | ... | @@ -124,12 +124,32 @@ The distance noise factor was determined by having the robot perform multiple fo |
|
|
The angle noise factor was determined by two tests, both performed multiple times. In the first test, the robot performed four 360 degrees rotation. The second test was similar, but reversed the direction of the 2nd and 4th rotation. For both tests, the average deviation was 0.5 degrees.
|
|
|
|
|
|
### Test with `PilotMonitor` and `PilotRoute`
|
|
|
The `applyMove` function in the `Particle` class was initially corrected, so that the addition of the random error is not dependent of the coordinate system. In the snippet below, the old implementation is shown. Here the addition of noise depends on the distance traveled in the x or y direction, meaning that if the Lego car only moved in the y direction, no noise would be added to the x-coordinate. And vice versa.
|
|
|
```java
|
|
|
pose.setLocation(new Point(
|
|
|
(float) (pose.getX() + xm + (distanceNoiseFactor * xm * rand.nextGaussian())),
|
|
|
(float) (pose.getY() + ym + (distanceNoiseFactor * ym * rand.nextGaussian()))));
|
|
|
```
|
|
|
In the snippet below the corrected implementation is shown. Instead of using the distance in the x and y direction, the total distance is used. In this way, the noise addition is independent of the coordinate system.
|
|
|
|
|
|
Hastighed ændret fra 5 til 15
|
|
|
```java
|
|
|
pose.setLocation(new Point(
|
|
|
(float) (pose.getX() + xm + (distanceNoiseFactor * move.getDistanceTraveled() * rand.nextGaussian())),
|
|
|
(float) (pose.getY() + ym + (distanceNoiseFactor * move.getDistanceTraveled() * rand.nextGaussian()))));
|
|
|
```
|
|
|
|
|
|
Distance noise factor = 0.005
|
|
|
The particle filter was tested by making the car follow the track as shown in the picture below. By using the poster with distances it is possible to see how accurate the car is.
|
|
|
|
|
|
Test setup med billede.
|
|
|
|
|
|
The test was run two different settings:
|
|
|
1. Speed = 5, distance noise factor = 0.001 and angle noise factor = 0.5.
|
|
|
2. Speed = 15, distance noise factor = 0.005 and angle noise factor = 2.5.
|
|
|
|
|
|
Below is a picture of the test results.
|
|
|
|
|
|
![Test results with speed = 15, distance noise factor = 0.005 and angle noise factor = 2.5. The robot was supposed to stop with the black brick underneath the front pointing on the cross. It is approximately 4 cm away. The PC shows the possible locations calculated using the particle filter. ](https://gitlab.au.dk/rene2014/lego/raw/master/Lesson10/Images/ParticleFilter.JPG)
|
|
|
|
|
|
Angle noise factor = 2.5
|
|
|
|
|
|
|
|
|
## Position tracking while avoiding obstacles
|
... | ... | |