@@ -111,3 +111,65 @@ To calibrate the robots travel distance according to the wheel diameter we modif
This code should drive the robot forward 50 cm’s. In order to get accurate results the robot was placed on a paper with a grid layout and markers for each 25 cm’s. By doing this we know that if the robot is calibrated correctly it will stop after two lines corresponding to 50 cm.
The initial drive revealed a traveled distance of 51 cm which is 1 cm more than targeted. This result is also proved by the pose() values showed below which indicates a value larger than 50.
##### Fig. 17 - Ending position with wheel diameter at 3.025.
### Causes for different Odometry (forklar i forhold til teorien generelle fejlkilder)
In [7] causes for different odometry errors are described, both systematic errors e.g. caused by unequal wheel diameters and non-systematic errors e.g. caused by wheel-slippage due to irregularities of the surface or over-acceleration. According to [7] the non-systematic errors can be reduced significantly by adjusting the wheel diameters and track width used in the software. In [7] a method is given that reduces the systematic odometry errors. We will, however, in the following use a more ad hoc method.
Vi observerede også at den altid drejer til den samme side. Derfor prøvede vi at bytte rundt på hjulene for at se om den drejede til modsatte side.
### Adjusting trackWidth through rotation
* After having adjusted the wheel diameters then make the vehicle rotate a given angle e.g. 180 degrees and adjust the trackWidth until the vehicle rotates as close to the given angle as possible.
To make the robot turn 180 degrees we modified the for-loop in PilotSquare.java. The initial trackWidth value was set to 3.
```
pilot.rotate(180);
show(poseProvider.getPose());
```
##### Fig. 18 - Codesnippet from PilotSquare.java
With the value trackWidth correctly calibrated we expect the robot to turn exactly 180 degrees.
### Results
The results showed the robot turn 180 degrees and stop with the pointer touching the line. When looking at the pose result V we see that it is practically as close to 180 degrees as itcan be, meaning that the trackWidth value is calibrated properly from the start.
Fig. 21 - Finish position of the robot after 90 degree turn.
In [4] it is described that "With proper adjustment of these parameters, errors in distance traveled and angle of rotation can be held to 2% or perhaps less". See if this can be achieved.
Our values and test drives reveals an error of less than…. (50.8 cm / 50 cm * 100 ) - 100 = 1.8 % error