larseh created page: Lesson10Week14 authored by Lars Eriksen Høeg's avatar Lars Eriksen Høeg
# Group 4
## Lab Notebook 10
**Date:** 28/05 2015.
**Group members participating:** Tine Hansen, Daniel Moltzen, Mads Eriksen, Lars Høeg.
**Activity duration:** 25 hours.
## Structure
The report is structured as follows;
- Goal: The goal for the lab report.
- Plan: What are we going to do.
- Final Results: Contains our final results and what we have done to reach our goal.
## Goal
## Plan
## Experiments with pilotSquare:
When testing the pilotSquare[pilotSquare kode fra hjemmesiden] we wanted to see if the legocar would start and stop in the same place. We tested this three times where the start position of the legocar where the same. The variables wheel diameter and track width were not changed and therefore had the values:
- Wheel diameter: 5.5
- Track width: 16
To know the exact starting and finishing point we attached two “pointers to the legocar” [Picture 1]. One on the left front and one i the center of the back. When placing the Legocar car at the starting position on a white paper we marked the two points with a pen where the two pointers pointed down on the paper.
![touchingpoint](http://gitlab.au.dk/uploads/u4099/legolabtimadala/5aa360bab7/touchingpoint.jpg)
###### Picture 1: the two blue legobricks are used as a pointer that point down towards the white paper. Then two dots are added beneath them to know the exact start position. The finishing position is then recorded by drawing dots beneath the two pointers.
We then ran the pilotSquare code, and as Picture 2 and video 1 shows, in every tested instance, the start and finish position where not the same. Although, the final position where almost identically in each of the tests.
![test1 with pilotsquare](http://gitlab.au.dk/uploads/u4099/legolabtimadala/6cddd42dd6/test1_with_pilotsquare.png)
##### Picture 2:first test of pilotSquare - comparing start and finishning position
--------------------------------Video 1 [google drive videor - first test]
As seen in the video and Pictureture above, the cars final position is approximately 4 cm to left and 1 cm above the start position. To make the vehicle start and stop at the same position we changed the variables wheel diameter and track width.
To reach the correct wheel diameter we made the vehicle travel 50 cm and adjusted the wheel diameter value variable within the class pilotSquare until the vehicle travelled as close to 50 cm as possible.
When testing it the first time, the legocar drove 52 cm with the following code:
for(int i = 0; i < 1; i++)
{
pilot.travel(50);
show(poseProvider.getPose());
Delay.msDelay(1000);
}
here the distance travelled should be 50 cm, therefore we changed the wheel diameter to 5.6 instead if 5.5. Here, it travelled 50.5 cm, which we found reasonable and therefore chose to use this number as a variable for the wheel diameter further on.
After having adjusted the wheel diameters we adjusted the trackWidth to make the legocar rotate as close to an angle of 180 degrees as possible. When testing it with a trackWidth of 16, the legocar rotated a few degrees more than 180. We tried with different values until we reach a perfect value of 15.6 as the track width.
After experimented with different values, we tried to run the pilotSquare again to see if the starting and finishing point would match. The results can be seen in Picture 3.
![test2 with pilotsquare](http://gitlab.au.dk/uploads/u4099/legolabtimadala/c2fb503c47/test2_with_pilotsquare.png)
##### Picture 3: second test of pilotSquare with new wheel diameter and trackWidth values. Comparing start and finishing position.
We believe that these results are as close as we can get to a matching starting and finishing point.
## Experiments with non-systematic odometry error model
In this experiment, we will work with the pilotMonitor program[pilotmonitor program] to investigate if the non-systematic odometry error model also models the errors of the base vehicle driven in a route of travel and rotate steps. To do this, we tested the program with the following code and see how it corresponds to the GUI that the PilotMonitor outputs:
public void go()
{
Sound.beep();
while ( ! Button.ENTER.isDown()) Thread.yield();
Sound.twoBeeps();
travel(50);
rotate(90);
travel(36);
while ( ! Button.ENTER.isDown()) Thread.yield();
LCD.clear();
LCD.drawString("Closing",0,0);
if ( PC.close() ) LCD.drawString("Closed",0,0);
try {Thread.sleep(2000);} catch (Exception e){}
}
In the test we used the variables for trackwidth and wheeldiameter that we found in the previous exercise and the variables:
- Private float distanceNoiseFactor = 0.2f; //0.2f;
- Private float angleNoiseFactor = 4; //4f;
For executing the test, we drew a starting position and the calculated finishing position on a blackboard Picture4. Hereafter, we drove the testprogram and compared the modelled errors with the finishing position. Our main goal was to investigate if the distanceNoiseFactor and angleNoiseFactor did model the error correctly, or if we had to change the values to make the model fit.
![FullSizeRender](http://gitlab.au.dk/uploads/u4099/legolabtimadala/c1d20f7e46/FullSizeRender.jpg)
##### Picture 4: The track where we tested the PilotRoute. Start posiotion is on the black line above where it says 18 cm. the center of the wheels should then be aligned with black line to get a correct starting position.
In the video beneath, we can see how the test i executed. The reason why the length of the final travelling distance is 45 and not 36(which is the distance set in the code) is that the legocars center point is positioned 9 cm to the left of the 50 cm line on start position. The reason to this is that it lets us know the precise start and finishing position.
We tested and compared the PilotMonitor GUI-output with the PilotRoute 4 times. The results can be seen in Picture 5.
![samlet testresultater](http://gitlab.au.dk/uploads/u4099/legolabtimadala/e651909461/samlet_testresultater.png)
##### Picture 5: test 1-4 showing each test with the result for the PilotMonitor and the observed testresult with PilotRoute.
We then took each instance of the finishing position and plotted it in a graph [Picture 6], and compared the result to each of the calculated error-models. The results shows that the points on the non-systematic odometry error model varies more and farther away from the expected end position than our test results show.
![samlet samlet test fra pilotroute](http://gitlab.au.dk/uploads/u4099/legolabtimadala/3f6f379061/samlet_samlet_test_fra_pilotroute.png)
##### Picture 6: Each test result from the PilotRoute plotted on the same graph
By investigating the odometry error model and compare it with real tests, it seems that the distance and angle noise factors are to high and cause some wrong results that are too far away from the expected finishing position. At least when compared to our results dePictureted in Picture 6.
To reach some noise factors that could give a more accurate error modelling, we tried to adjust the model according to our investigation as well as creating more turns and a longer travel distance on the test track (Picture 7). We also tried to adjust the distanceNoiseFactor and angleNoiseFactor to, private float distanceNoiseFactor = 0.3f; //0.2f and private float angleNoiseFactor = 1; //4f, to minimize the extent of the error calculated by PilotMonitor.
––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
## References
1. [Video 1: ](https://youtu.be/GaNep60og0A)
2. [Video 2: First Duel](http://youtu.be/Atu7SQaY1To)
3. [Video 3 - Second Duel](http://youtu.be/GTRwIvCHgnk)
4. [Video 4: Fourth Duel](http://youtu.be/PV5Hmiidi6o)
______________________________________________________________