... | ... | @@ -25,27 +25,17 @@ First, you should mount the sensor on the LEGO 9797 car as described in LEGO Min |
|
|
#### Execution ####
|
|
|
First, we rebuilt the robot to utilise a light sensor. Our initial construction can be seen in <<<<<<indsæt reference til billedet her >>>>>>.
|
|
|

|
|
|
Secondly, we programmed an application which used the *BlackWhiteSensor.java* <<<<<<indsæt reference til koden her >>>>>> class to classify colors as either white or black. This application can be seen <<<<<indsæt kode eller reference til git med kode>>>>>>.
|
|
|
Secondly, we programmed an application which used the *BlackWhiteSensor.java* <<<<<<indsæt reference til koden her >>>>>> class to classify colors as either white or black. This application can be seen <<<<<indsæt kode eller reference til git med kode>>>>>>. We used this application to analyse the effectiveness of application calibration.
|
|
|
|
|
|
The *BlackWhiteSensor.java* class also prints light values to the display as a percentage <<<<indsæt reference til hvor dette er kendt fra >>>>>. We noted these below.
|
|
|
White | Black
|
|
|
--- | ---
|
|
|
51 | 33
|
|
|
The *BlackWhiteSensor.java* class prints light values to the display as a percentage <<<<indsæt reference til hvor dette er kendt fra >>>>>. We noted these in table <<<<<table ref >>>>>.
|
|
|
|
|
|
**White** | **Black**
|
|
|
--- | ---
|
|
|
51 | 33
|
|
|
|
|
|
// The threshold is calculated as the median between
|
|
|
// the two readings over the two types of surfaces
|
|
|
- Virkede fint.
|
|
|
- Hvid 51
|
|
|
- Sort 33
|
|
|
- Lavede et testprogram til at undersøge effektiviteten af kalibreringen.
|
|
|
- Indsæt kode!
|
|
|
- Var meget effektiv til sort hvid.
|
|
|
- Da det givne program laver en blackwhite threshold ved at tage medianen af den sorte og hvide værdi var det interessant at teste på en gråskala om den virkeligt passede med threshold. Vi fik maskinen lidt over midten på gråskalaen, hvilket stemmer overens med det antagede.
|
|
|
- Indsæt billede af gråskala
|
|
|
We noticed that the application was very effective at classifying the differences between black and white. It does this by calculating the median between the black and white readings and setting this value as the threshold between the two colors.
|
|
|
Because of this, it was interesting to test the sensor on a greyscale. Starting at white, we moved the robot (and thus the sensor) towards black until the classification changed. This happened around the middle of the scale which makes sense. The exact point at which the application changed from white to black can be in <<<<<indsæt ref til billede>>>>>>.
|
|
|

|
|
|
|
|
|
### Line Follower with Calibration ###
|
|
|
|
... | ... | |