... | @@ -83,17 +83,23 @@ We then tried increasing the values of the threshold for turning left or right t |
... | @@ -83,17 +83,23 @@ We then tried increasing the values of the threshold for turning left or right t |
|
|
|
|
|
### Vehicle 2
|
|
### Vehicle 2
|
|
|
|
|
|
The robot was rebuilt to include two light sensors instead of the sound sensor, as shown in [Insert picture]
|
|
The robot was rebuilt to include two light sensors instead of the sound sensor, as shown in Figure 3.
|
|
|
|
|
|
[Insert picture 2 light sensors]
|
|
![robot with light sensors](https://gitlab.au.dk/LEGO/lego-kode/raw/master/week8/img/firefry1.PNG)
|
|
|
|
*Figure 3: Robot fitted with two light sensors*
|
|
|
|
|
|
A program was created, **LightLover.java** which behaves similarly to **SoundLover.java**. The difference being we now have two sensors, where we map one sensors light readings to one motors power, and the other sensors readings to the second motors power. We created Braitenberg's Vehicle 2a by simply mapping the left light sensors value to the left motor, and the right light sensors value to the right motor. As we have programmed for an exitatory behavior, this means that high light levels on the left sensor will mean a high power on the left motor, and as a result cause the robot to drive *away* from light sources. The result is that the robot mostly stands still, as the ambient light values in the room does not map to a high enough motor power to get the motors to actually move (usually around 57). When given a high light source however, for example from the torch on our phone, the robot accurately drives away from it, as seen in video [LIGHT HATER VIDEO]. If we wanted the robot to properly drive around and search for light, we could simply do a small calibration by adding some extra base power to each motor, to get the robot to actually drive around in ambient lighting
|
|
We created a program, ***LightLover.java***, which behaves similarly to ***SoundLover.java*** - the difference being that we now have two sensors, mapping one sensor's light readings to the power of one motor, and the other sensor's readings to the power of the other motor. We created Braitenberg's Vehicle 2a (see Figure 4) by simply mapping the value measured by the left sensor to the left motor, and the value from the right sensor to the right motor. As we have programmed for an exitatory behavior, this means that high light levels on the left sensor will induce a high power on the left motor and as a result cause the robot to drive *away* from light sources. The resulting behaviour turned our to be that the robot mostly stood still, as the ambient light values in the room did not map to a high enough motor power to get the motors to actually move (the measured values would lie around 57). However, when stimulated by a bright light source, such as the torch on our phone, the robot accurately drives away from it, as shown in Video 8. If we wanted the robot to properly drive around and watch out for light, we could simply do a small calibration by adding some extra base power to each motor, to get the robot to actually drive around in ambient lighting
|
|
|
|
|
|
[Light hater vidz]
|
|
[TODO: Light hater vidz]
|
|
|
|
*Video 8: The robot moving away from bright light*
|
|
|
|
|
|
Next we wanted to make the Vehicle 2b. We did this by simply switching the two wires to the sensors, as this flips which motor they cause to drive, and as such causes the robot to drive towards light, instead of away from it, as seen in [Light luvver vid].
|
|
Next, we constructed vehicle 2b by simply switching the attachments of the connecting wires of the sensor's (the difference is illustrated in Figure 4, taken from the lesson plan), such that which sensor causes which motor to drive is flipped - i.e. the robot will drive towards light instead of away from it. This is shown in Video 9.
|
|
|
|
|
|
[LIGHT LOOOVE]
|
|
![vehicles 2a and 2b](https://gitlab.au.dk/LEGO/lego-kode/raw/master/week8/img/2a2b.PNG)
|
|
|
|
*Figure 4: Illustration of vehicle 2a and vehicle 2b*
|
|
|
|
|
|
|
|
[TODO: LIGHT LOOOVE / Light luvver vid]
|
|
|
|
*Video 9: The robot driving towards bright light*
|
|
|
|
|
|
We did not create similar programs that cause the robot to have inhibitory connections, but they would be reasonably trivial. By simply inverting the values used as parameters for the motor powers, the robot would now have inhibitory connections, which would cause the robot to instead stand still in high lighting environment, and drive towards dark (low light) sources.
|
|
We did not create similar programs that cause the robot to have inhibitory connections, but they would be reasonably trivial. By simply inverting the values used as parameters for the motor powers, the robot would now have inhibitory connections, which would cause the robot to instead stand still in high lighting environment, and drive towards dark (low light) sources.
|
|
|
|
|
... | @@ -134,4 +140,6 @@ The video shows that the robot correctly powers up the appropriate motor to seek |
... | @@ -134,4 +140,6 @@ The video shows that the robot correctly powers up the appropriate motor to seek |
|
|
|
|
|
[2] [Tom Dean's Notes](http://cs.brown.edu/people/tld/courses/cs148/01/vehicles/vehicles.htm)
|
|
[2] [Tom Dean's Notes](http://cs.brown.edu/people/tld/courses/cs148/01/vehicles/vehicles.htm)
|
|
|
|
|
|
[3] [The decibel scale with examples, in Danish](http://fys.dk/fipnet/1_oeret/11_temaer/116_skala/) |
|
[3] [The decibel scale with examples, in Danish](http://fys.dk/fipnet/1_oeret/11_temaer/116_skala/)
|
|
\ No newline at end of file |
|
|
|
|
|
[TODO: refs til kode] |
|
|
|
\ No newline at end of file |