... | ... | @@ -129,11 +129,15 @@ In the lesson plan, an alternative build is presented (see Figure 5, "Figure 6" |
|
|
|
|
|
The lesson plan's first suggestion is to use a light sensor and an ultrasound sensor, but we chose to follow the alternative suggestion of using a sound sensor instead of an ultrasound sensor. We thus constructed the robot by combining sound sensors and light sensors.
|
|
|
|
|
|
The illustration in Figure 6 ("Figure 7" in the lesson plan) shows the sound sensors with a direct, inhibitory connection to the motors, while the light sensors have a 'crossed', exhibitory connection to the motors. Based on our experiences in the previous exercises, we can infer from this that the robot will steer towards both light and sound.
|
|
|
The illustration in Figure 6 ("Figure 7" in the lesson plan) shows the sound sensors with a direct, inhibitory connection to the motors, while the light sensors have a 'crossed', exitatory connection to the motors. Based on our experiences in the previous exercises, we can infer from this that the robot will steer towards both light and sound.
|
|
|
|
|
|
We wrote a program **RaveBot.java** that tries to seek towards places with both high sound and high light levels. The program is mostly a mash of our previous programs **SoundLover.java** and **LightLover.java**, where we simply add together the two values received from the sensors, and then dividing by two (halfing each sensors impact), and then using the value as motor power for the appropriately connected motor, according to the drawing in figure 7. The result can be seen in video [RAVE BOT TIME]
|
|
|
![vehicle 3 diagram](https://gitlab.au.dk/LEGO/lego-kode/raw/master/week8/img/fig7.PNG)
|
|
|
*Figure 6: The diagrammatic illustration of Vehicle 3 provided as Figure 7 in the lesson plan*
|
|
|
|
|
|
[WUBWUBWUBWUBWUB]
|
|
|
We wrote a program, ***RaveBot.java***, that seeks towards places with both high sound levels and high light levels. The program mostly consists of a mash of our previous programs ***SoundLover.java*** and ***LightLover.java***, where we simply add together the two values received from the sensors and then divide by two (halving the impact of each sensor), using the resulting value as the motor power for the corresponding motor according to the drawing in Figure 6. The result can be seen in Video 10.
|
|
|
|
|
|
[TODO: RAVE BOT TIME WUBWUBWUBWUBWUB]
|
|
|
*Video 10: Robot running the RaveBot program*
|
|
|
|
|
|
The video shows that the robot correctly powers up the appropriate motor to seek towards light when seen. It however mostly stops up when hearing sound, with a slight veering towards the sound source. This is expected, as our inhibitory implementation of the sound sensor causes it to give a great deal of power to both sensors when there is no sound present. When we whistle near one sound sensor, the opposite sound sensor is bound to pick up a great deal of sound as well (although not as much), resulting in lower motor power for both motors. All in all, the combination of sensors works reasonably well, but it could be argued that it would be possible to find a more refined way of calculating the combination of sensor readings, rather than the pretty naive "average of the two" approach that we used.
|
|
|
|
... | ... | |