... | @@ -10,7 +10,7 @@ |
... | @@ -10,7 +10,7 @@ |
|
**Activity duration:** 6 hours
|
|
**Activity duration:** 6 hours
|
|
|
|
|
|
## Goal ##
|
|
## Goal ##
|
|
The goal of this lab session is to construct a robot, that will follow a black line and stop at the end of the line when the robot drives into a goal zone - a green rectangular piece of paper at the end of the black line. The idea is that we will try to use the light sensor to detect three different colors.
|
|
The goal of this lab session is to construct a robot, that will use sensors for color detection to define the state of the robots installed applications, which use these colors to drive on black lines and stop on a green end zone.
|
|
|
|
|
|
## Plan ##
|
|
## Plan ##
|
|
Follow the instructions given in the lesson plan \[1\].
|
|
Follow the instructions given in the lesson plan \[1\].
|
... | @@ -23,6 +23,21 @@ Follow the instructions given in the lesson plan \[1\]. |
... | @@ -23,6 +23,21 @@ Follow the instructions given in the lesson plan \[1\]. |
|
First, you should mount the sensor on the LEGO 9797 car as described in LEGO Mindstorms Education NXT Base Set 9797 building instruction page 32 to page 34. Second, make a program that use and test the class *BlackWhiteSensor.java*. After calibration, place the car with the light sensor over different dark and bright areas and investigate how well the BlackWhiteSensor works.
|
|
First, you should mount the sensor on the LEGO 9797 car as described in LEGO Mindstorms Education NXT Base Set 9797 building instruction page 32 to page 34. Second, make a program that use and test the class *BlackWhiteSensor.java*. After calibration, place the car with the light sensor over different dark and bright areas and investigate how well the BlackWhiteSensor works.
|
|
|
|
|
|
#### Execution ####
|
|
#### 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 >>>>>> to classify colors as either white or black. This application can be seen <<<<<indsæt kode eller reference til git med kode>>>>>>.
|
|
|
|
|
|
|
|
|
|
|
|
// 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
|
|
|
|
|
|
### Line Follower with Calibration ###
|
|
### Line Follower with Calibration ###
|
|
|
|
|
... | | ... | |