Cadette Programming Robots Badge Activity
Use A Chess Or Checkers Board To Design A Program For A Robot
Write a computer program that tells a robot what to do!
Time needed: 60 minutes
- Programming Challenge handout
- 1 checkerboard to use as a map of the room to be vacuumed (Alternatively, print out or draw a checkboard grid.)
- Red and black checkers (Alternatively, use two sets of beads or objects in two different colors.)
- Sticky notes
- Pen or pencil
A computer program is a type of algorithm—a set of step-by-step instructions. The list of steps for telling the robot how to complete a task is an algorithm. Recipes and driving directions are algorithms, too!
Computer programs are written in code, a language that can be understood by machines. Programs use commands to tell the machine what to do. A command is one step in a program.
You’ve been challenged to write a program a robot can follow to perform two different tasks. First, you’ll write a program for a task of your choice. Then, you’ll code a program a robot can follow to navigate and vacuum a room!
Part 1: Write a paper program. (15 minutes)
A computer program is a type of algorithm—a set of step-by-step instructions. Do you think you can write an algorithm to tell someone how to complete a familiar task?
Pick a simple physical task to turn into an algorithm. Use regular language—you don't need to write commands in computer code yet.
For example, here’s an algorithm you could use to plant a vegetable garden:
- Collect seeds to plant.
- Pick up a shovel
- Dig up the soil (called turning the soil).
- Mix the freshly turned soil with natural fertilizer and compost. Plant seeds.
- Turn on a hose or fill a watering bucket.
- Water the soil.
- Turn off the hose.
- Put the seeds away.
- Put the shovel away.
- Water daily.
- After several days, pull weeds.
- Pull weeds again daily
- Pick vegetables when ripe.
- Wash ripe vegetables.
Other ideas for tasks include mowing the lawn, vacuuming a room, sorting objects into different bins by size or color, setting up a campsite, painting a room, grooming or feeding a pet, or packing up a fragile gift item to send across the country.
Test your program by following the commands in your program, line by line, and acting out what you read. As you test your program, take notes about any problems you find so you can go back and fix them.
Part 2: Write a program for a robot. (45 minutes)
Engineers design complicated machines for big factories, but they also use their skills to create products for the home. For example, Helen Greiner, one of the founders of the company iRobot, was working on an industrial-sized robotic vacuum, but it was so large and heavy that it could damage furniture or hurt people if anything went wrong. So, the iRobot team decided to work out any problems by making a smaller prototype. The smaller model was so handy that the company began producing it as the Roomba robotic vacuum, which is now used in homes around the country.
For the next part of the activity, you’re going to write simulated computer code that tells a robovac how to vacuum a room and return to its charging station. To help, you’ll use a checkerboard as a map of the room to be vacuumed, red checkers as obstacles, and a black checker as the robovac to be moved around the room. Your goal is to write a program that will move the red checker around every square that is not covered by a black checker.
When you’re writing a computer program, spelling and punctuation must be perfect. Otherwise, the computer won't understand what you’re trying to say. However, when you’re just trying to figure out the steps in your program and what order they should go in, it's OK to make up your own pseudocode. That means writing out the commands using real words to make it easier to understand.
Some examples of pseudocode that tell a robovac how to move around include:
FORWARD 3 = move ahead three squares
RIGHT = turn and face right
So, follow the challenge instructions found below and on the Programming Challenge handout to write pseudocode for a robovac.
- Set the board in front of you. Label one sticky note as the robot's charging station and place it on the board, along the "wall" of the room (edge of the board). Place the red checker (the "robovac") on the charging station square.
- Label one sticky note as a stairway going down. Place the sticky note on one of the squares on the board, somewhere in the "room.
- Place a few black checkers around the board as stationary obstacles—tables, chairs, sofa, bookcase, etc. Label them using the sticky notes.
- If you’re writing a program using sensors (see “Want more challenge?” below), label one checker as a dog, cat, or other pet and place it on the board.
- Write out a program for your robovac using pseudocode (plain language) by writing each command on a sticky note. Attach the sticky notes to a sheet of paper. Move the commands around as needed.
- Test out your code as you work using the pieces on the checkerboard. Debug your program, adjusting your program as needed.
Want more challenge? Try this!
Add sensors in your program! A robot is a machine that can sense, think, and act. That means you can tell the robot to gather information about its environment using its sensors, decide whether the information meets certain conditions by using its brain, and take different actions depending on what it finds. To add challenge to the activity, add instructions for sensors to your program.
For ideas on sensors and conditions to add to your robovac’s program and tips for programming a robot with sensors, check out the “Want more challenge?” section of the Programming Challenge handout.
And that’s it! You’ve now completed two steps of the Cadette Programming Robots badge! If you had fun doing this, you might want to learn more about robots and design your own with the rest of the Senior Robotics badges.
Troop Leaders: The instructions for all badge steps are available free of charge in your Girl Scout Volunteer Toolkit.
Girl Scouts at Home activities have been adapted from existing Girl Scout programming and optimized for use at home during a period of social distancing.
Adapted from steps 4 and 5 of the Cadette Programming Robots badge. Contact your troop leader or your local Girl Scout council to become a Girl Scout member and learn all the requirements needed to earn the badge .