... | @@ -54,6 +54,13 @@ After taking this approach, the robot ran as expected and followed the line. The |
... | @@ -54,6 +54,13 @@ After taking this approach, the robot ran as expected and followed the line. The |
|
Use the idea and structure of the BlackWhiteSensor to program a class ThreeColorSensor that can detect three colors: black, green and white. Make a test program that investigate the usefulness of the class.
|
|
Use the idea and structure of the BlackWhiteSensor to program a class ThreeColorSensor that can detect three colors: black, green and white. Make a test program that investigate the usefulness of the class.
|
|
|
|
|
|
#### Execution ####
|
|
#### Execution ####
|
|
|
|
3)
|
|
|
|
- Grøn har en værdi meget tæt på sort (37)
|
|
|
|
- Programmerede programmet ved at tilføje nye thresholds så de stemte overens med grøn. Vi erstattede sort hvid med sort-grøn + grøn-hvid idet vi antager at sort<grøn<hvid. I disse lysforhold stemmer dette overens, men der kan være tilfælde hvor denne antagelse ikke stemmer overens. I så fald kan man tilføje yderligere et threshold black-white.
|
|
|
|
- Vi udnytter thresholds ved at bruge < og > til at sammenligne over thresholds (mindre end black-green -> black, mindre end green-white -> grøn, større end green-white -> hvid)
|
|
|
|
- Da det er Integers rundes der altid ned. Der er altså en tendens til at favorisere mørke værdier. Vi kunne anvende raw values i stedet. I så fald ville vi have 1023 værdier at gå ud fra, og ville derfor kunne bedømme edge cases bedre.
|
|
|
|
|
|
|
|
We extended the behaviour of *BlackWhiteSensor.java* to calibrate for green as well as the black and white. The extended application can be seen in <<<<<<indsæt ref til kode, eller indsæt kode>>>>>>.
|
|
|
|
|
|
### Line Follower that stops in a Goal Zone ###
|
|
### Line Follower that stops in a Goal Zone ###
|
|
|
|
|
... | | ... | |