... | ... | @@ -59,13 +59,17 @@ Next, we modified our program to receive raw values directly from the sensor por |
|
|
[TODO: Video, one from corner to middle in 3 bursts (Nicolai knows wtf this means)]
|
|
|
*Video 3: Running SoundLover.java using raw values read directly from the sensor port instead of dB values read from the sound sensor*
|
|
|
|
|
|
We now want to map our raw value to the range -100 to 100, in order for the robot motor power range to go from full power backwards to full power forwards, rather than from full stop to full power forwards. We do this by simply multiplying the percentage of measured raw value (inverted) with our full range value, in this case 200, and then adding this number to our minimum range value, in this case -100. We implemented this in the program **SoundReactor.java**, and the result can be seen in [INSERT NEXT VIDEO].
|
|
|
The next task was to map the raw values to the range [-100, 100], in order for the robot motor power range to go from full power backwards to full power forwards, rather than from full stop to full power forwards. We do this simply by multiplying the percentage of measured raw value (inverted) by 2 - that is, instead of obtaining a percentage value by multiplying by 100, we multiply by the full range value of 200. The resulting value is then added to the minimum range value of -100. We implemented this in the program ***SoundReactor.java***, and the result can be seen in Video 4.
|
|
|
|
|
|
[Insert videooo (killed the radio star)]
|
|
|
[TODO: Insert videooo (killed the radio star) - Ida: Thank you, Nicolai, nu har man den på hjernen (min venindes kommentar: Thanks Obama)]
|
|
|
*Video 4: The robot running SoundReactor.java*
|
|
|
|
|
|
After being thoroughly confused by draw int for a while (THANK YOU NXT!?!!11), we managed to get it working. As can be seen in the video, the robot drives forward and backward according to sound level reasonably appropriately, although it appears that when driving backwards the noise/vibrations caused by the robot is enough increase in the values picked up by the sensor that it immediately stops driving backwards, and even drives forward a bit.
|
|
|
After being thoroughly confused by draw int for a while (THANK YOU NXT!?!!11), we managed to get it working. As can be seen in the video, the robot drives forward and backward according to sound level reasonably appropriately, although it appears that when driving backwards the noise/vibrations caused by the robot is enough of an increase in the values picked up by the sensor that the robot immediately slows down its backwards driving and even drives forward a bit.
|
|
|
|
|
|
We wrote a program **SoundHater.java**, to create the inhibitory connection. The program is exactly the same as **SoundLover.java**, except we don't invert the given read value. The result is as seen in [Video sound hater]. The robot accurately stops when hearing loud noises, and drives forward when hearing nothing.
|
|
|
We wrote a program, ***SoundHater.java***, as the inhibitory version of ***SoundLover.java***. The program is exactly the same as the SoundLover program, except we don't invert the read value. The result is shown in Video 5. The robot accurately stops when hearing loud noises and drives forward under low sound levels.
|
|
|
|
|
|
[TODO: insert SoundHater video]
|
|
|
*Video 5: The robot running SoundHater.java*
|
|
|
|
|
|
We made a program **TinyDancer.java**, where we initially made the robot turn left if read sound level was over 50, and turn right if under 50. The robot kept constantly turning left, as the sound level caused by itself was too high. Result can be seen in [Video spin-to-win]
|
|
|
|
... | ... | |