You are on page 1of 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. 2. Record the sound value for loud. 3. Record the threshold value you calculated. Contemplate

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

Block 1: Block 1 in this program is a sound sensor. Its threshold is less than 65, and it detects sound, forcing the robot to move forward. Block 2: Block 2 in this program is a sound sensor. Its threshold is more than 65, and it detects sound, forcing the robot to move forward. Block 3: Block 3 in this program is a motor block. Its job is to make the robot move forward, using only one motor. It is connected to port C. Block 4: Block 4 in this program is a motor block. Its job is to make the robot move forward, using only one motor. It is connected to port B. Blocks 5, 6, 7 and 8 serve the same functions as blocks 1, 2, 3 and 4 accordingly. They are basically a repeat of the program. The entire program is placed in a loop, which tells the robot that it must repeat the program endlessly. In order to stop this repeat, you must abort the action.

5. Define the Wait for Clap behaviour you built in the program. The wait for clap behaviour used in this program simply commands the robot not to manoeuvre itself to move unless it hears a clap/sound. Creating a program like this is simple, we must use sound sensors. These are placed on the right of the robot, and when they hear a sound, they start to perform the program created, in this case, moving forward using the 2 motor blocks.

i.

What are the two blocks that make up the behaviour? The 2 blocks above that make up the behaviour are the sound detectors. They make the robot understand that it is not to move unless it hears a sound. Once a sound is heard, the behaviour is comprised of 2 motor blocks moving forward.

ii.

Why isnt a single Wait For Sound block good enough? There are 2 reasons why a single block isnt enough. Firstly, we must use 2 blocks in order to manoeuvre both motors to move forward.

6. What does the threshold for the sound sensor do? What would happen if you set the threshold higher? Lower? The threshold determines at what sound level the robot will react and begin its program. If you set the threshold higher, the robot is not sensitive and only reacts to loud noises. If you set the threshold lower, the robot is sensitive to sound and will immediately begin its program, even when immune to the smallest of sounds. 7. Why did you use a value from the sound sensor that was halfway between silence and clapping for your threshold value? If the robot is too sensitive, it will pick up any sound and activate itself whenever it wanted to. That is why we had to crank up the threshold to 60.

8. Does your robot only respond to claps, or do other sounds trigger starting and stopping as well? Why do you think this is? Our robot responded to any sound, not just claps. At one stage, the robot was continually moving. Because the class was so noisy, the robot was reacting too sensitively and couldnt stop meaning. We had to abort the entire program to make the robot stop. 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.

In order to help the robot react in the right time, she should measure the amount of sound it takes for the door slam to activate the robot. ii. What possible problems might there be with this plan?

Problems with this plan are: There might be another loud sound that activates the robot, causing it to move forward on the wrong cue.

Continue
Answer the following:

10. How did the loop change the robots behaviour? The loop enabled the robot to repeat the program endlessly. In order to stop it from doing this, we had to abort the program from running.

11. How many times will the loop run? There isnt a certain amount of times the robot will loop; it will continue until told to stop.

You might also like