Vous êtes sur la page 1sur 3

Worksheet: Clap On, Clap Off

Introduction to Mobile Robotics > Clap On, Clap Off


Follow the steps in the online directions, and answer the questions at the appropriate times.

Construct: Write Your Program

Observations:

1. Record the sound value for quiet. 6% 2. Record the sound value for loud. 87% 3. Record the threshold value you calculated. 44% Contemplate

4. Write a brief description of what each block in your program does.

Block 1: Tells the motor blocks 3 and 4 to wait until a sound before starting. Block 2: Also tells motor blocks 3 and 4 to wait but for them to wait till the sound falls below 44. Block 3: Tells motor C to go forward. Block 4: Similar to block 3 except it tells motor B to go forward. Block 5: Tells blocks 3 and 4 to wait until a sound before stopping. Block 6: Tells blocks 3 and 4 to wait until the sound drop below 44. Block 7: Tells motor C to stop Block 8: It stops motor B 5. Define the Wait for Clap behaviour you built in the program.

i.

ii.

What are the two blocks that make up the behaviour? The two blocks are both wait for blocks that tell the next blocks on the program to wait for the sound to exceed 44 then wait for it to go below 44. Why isnt a single Wait For Sound block good enough?

The single wait for sound block is not good enough because with one it tells the robot to start when it exceeds the sound then stop when it exceeds the sound, meaning that the robot starts then stops straight after. 6. What does the threshold for the sound sensor do? What would happen if you set the threshold higher? Lower? The threshold is the amount of sound needed before the robot does what you asked it to do. If the threshold was higher you would not need to make as loud of a sound and if it was lower you would need to make a small amount of sound. 7. Why did you use a value from the sound sensor that was halfway between silence and clapping for your threshold value? We used a value that was halfway between silence and the clapping because then it accounts for the noise around you as well as the clapping sound. 8. Does your robot only respond to claps, or do other sounds trigger starting and stopping as well? Why do you think this is? Yes, the robot does only respond to claps because we used clapping to configure our threshold. If we used other sounds like words to make it work we would have to change our thresholds because they all make a different amount of noise 9. Marisa is using the robot as an actor in a class play. She wants the robot to start running across the stage on cue. The cue will be the sound of a door slamming as another (human) actor goes offstage. i. How should she go about programming her robot to recognize the correct sound and begin its performance at the right time? Be specific. She should firstly work out the threshold by measuring the stage as it is normally then seeing how much sound the door makes when it slams. If she adds these two together then divide by two then she will get her threshold which she can now put in her programming. Then she should add her wait for blocks into the program and change it so that is waits for the sound to exceed her threshold. She can then add the rest of her program. What possible problems might there be with this plan? Possible problems with this plan are that the audience might make a lot of noise and stop the robot from triggering when the door was slammed. Another potential problem would be if the human slamming the door did it too quietly or too loud which is very likely.

ii.

Continue
Answer the following:

10. How did the loop change the robots behaviour? The way the loop changed the robots behaviour is that it will now continuously start and stop now whenever you want it two. All you have to do is keep clapping. 11. How many times will the loop run? The loop will run forever or until you abort the program