... | ... | @@ -24,11 +24,11 @@ The parameters of the LEGO car in this program is defined as the following. |
|
|
| Parameter | Value |
|
|
|
| ------------------------- |:---------------:|
|
|
|
| Left wheel diameter | 5.5 cm |
|
|
|
| Right wheel diameter | 5.5 cm |
|
|
|
| Right wheel diameter | 5.5 cm |
|
|
|
| Track width | 16 cm |
|
|
|
|
|
|
The program makes the car drive 20 cm straight forward, turn 90 degrees to the left and repeat this 4 times in order to get back to the initial position.
|
|
|
A special piece of paper with multiple grids on it is used to measure the accuracy of the system. This is shown in the following image.
|
|
|
A special piece of paper with multiple grids on it is used to measure the accuracy of the system. This is shown in the following image.
|
|
|
|
|
|
![Measuring physical accuracy of the DifferentialPilot class](https://gitlab.au.dk/rene2014/lego/raw/master/Lesson10/Images/Odometry.JPG)
|
|
|
|
... | ... | @@ -58,8 +58,8 @@ The final parameter values are shown in the following table. |
|
|
| Parameter | Value |
|
|
|
| ------------------------- |:---------------:|
|
|
|
| Left wheel diameter | 5.539 cm |
|
|
|
| Right wheel diameter | 5.544 cm |
|
|
|
| Track width | 16.27 cm |
|
|
|
| Right wheel diameter | 5.544 cm |
|
|
|
| Track width | 16.27 cm |
|
|
|
|
|
|
We found out that it was necessary to set the right wheel diameter a little higher than the left in order to make the LEGO car drive straight. The calibration is validated by letting the LEGO car drive in a 50 x 50 cm square as shown in following image.
|
|
|
|
... | ... | @@ -108,10 +108,10 @@ Due to these poor results the original calibrated parameter values are used. |
|
|
| Parameter | Value |
|
|
|
| ------------------------- |:---------------:|
|
|
|
| Left wheel diameter | 5.539 cm |
|
|
|
| Right wheel diameter | 5.544 cm |
|
|
|
| Track width | 16.27 cm |
|
|
|
| Right wheel diameter | 5.544 cm |
|
|
|
| Track width | 16.27 cm |
|
|
|
|
|
|
It seems like it is near impossible to calibrate the parameters so that the LEGO car is able to travel a given distance while performing a number of random turns. Multiple reason can cause this behavior. An obvious reason is the leJOS maximum precision of 2 %. So no matter how much calibration is performed some error will always exist. Other factors like the position of the back wheel could also be part of the explanation. If the back wheel is not aligned with the driving direction the car can be drawn out of course when pulling the back wheel into the correct direction.
|
|
|
It seems like it is near impossible to calibrate the parameters so that the LEGO car is able to travel a given distance while performing a number of random turns. Multiple reason can cause this behavior. An obvious reason is the leJOS maximum precision of 2 %. So no matter how much calibration is performed some error will always exist. Other factors like the position of the back wheel could also be part of the explanation. If the back wheel is not aligned with the driving direction the car can be drawn out of course when pulling the back wheel into the correct direction.
|
|
|
|
|
|
## Position tracking by means of particle filters
|
|
|
|
... | ... | @@ -121,15 +121,35 @@ The tests to estimate the noise factors was performed at low speeds, on a wooden |
|
|
|
|
|
The distance noise factor was determined by having the robot perform multiple forward travels of 50 cm. The average distance from the target was ~0.5 mm, thus the distance noise factor was estimated as: 0.5/500 = 0.001.
|
|
|
|
|
|
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.
|
|
|
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.
|
|
|
|
|
|
```java
|
|
|
pose.setLocation(new Point(
|
|
|
(float) (pose.getX() + xm + (distanceNoiseFactor * move.getDistanceTraveled() * rand.nextGaussian())),
|
|
|
(float) (pose.getY() + ym + (distanceNoiseFactor * move.getDistanceTraveled() * rand.nextGaussian()))));
|
|
|
```
|
|
|
|
|
|
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.
|
|
|
|
|
|
Hastighed ændret fra 5 til 15
|
|
|
Below is a picture of the test results.
|
|
|
|
|
|
Distance noise factor = 0.005
|
|
|
![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
|
... | ... | |