Family edition
Robot Soccer Lab: Get Behind the Ball, Why Driving Straight at It Fails
In Robot Soccer Lab your child programs a soccer robot in Blocks, and finds out why driving straight at the ball scores in your own goal.
What you need
- A computer or Chromebook with a current browser.
- The link: mytekdev.com/try/robotsoccerlab?lesson=get-behind-the-ball-why-driving-straight-fails&ref=fam-robotsoccerlab-1. No account, no email and nothing to install.
Before you start: try it once yourself
Open mytekdev.com/try/robotsoccerlab?lesson=get-behind-the-ball-why-driving-straight-fails&ref=fam-robotsoccerlab-1. A short guide opens over Level 1, Find the ball. The field is in the middle: green carpet, white lines, the yellow goal (the robot's own) and the blue goal it attacks. The red robot is round, with an arrow on top for its front, and the orange ball glows so the robot can find it. The box on the field says the level's goal and, after each run, what happened and why. The readings beside it show the ball clock, the heading, the speed and how far away the ball is.
- The starter. In Blocks: forever, if the ball clock is 12, move at angle 0 speed 80; else if it is 0, stop; else if it is 6 or less, turn at 40; else turn at -40. The robot turns to face the ball, which sits behind it, then drives at it.
- Card one. Show me the blocks in the box, then Put them in. The two turn blocks become move at angle: for clock 1 to 6, ball clock x 30 + 60; for 7 to 11, ball clock x 30 - 60; speed 70. The robot moves round the ball without turning until the ball is at 12, then pushes it ahead.
- The other levels. Levels, in the menu bar, opens any level; the program stays as it is. Levels 2 and 3 each have their own card in the box.
- Speed. Each level starts in real time. Speed up and Slower, under the field, change the speed; the round play button starts the level again from the beginning, with the program as it is now. Each press of play takes the next seed for the receivers' small noise, so times can differ by a few hundredths of a second between runs.
- Numbers to expect. Level 1: the starter scores in its own goal at about 2.9 s; card one scores in blue at 3.77 s. Card one with both 60s changed to 0: own goal, 2.1 s; 30: out of bounds at the wall, about 2.2 s; 90: a goal in about 5.5 to 5.8 s on most runs, and on some it goes out. Level 2: the starter turns and fails at once; card one goes wholly into its own penalty area at about 2.6 s and is called out; card two passes in about 4.2 s. Level 3: card two scores facing its own goal (heading 180), which the level refuses; card one scores an own goal at about 3.4 s; card three scores at about 2.4 s, facing 350 to 356.
The ideas, in plain words
In child robot soccer the ball gives off infrared light, and the robot senses it with a ring of receivers. The strongest receiver says roughly where the ball is; the app gives it as a clock position, and the clock times 30 is the ball's angle from the robot's front, clockwise. The field and rules are modeled on the RoboCupJunior Soccer rules; the app is not affiliated with or endorsed by the RoboCup Federation.
Driving straight at the ball is the first idea every team has, and it only works from behind the ball. Real teams move round it first, aiming past it by an angle, then push it ahead. Omni wheels make this easy: they let the robot move in any direction while it keeps facing the same way. A compass keeps it pointed at the goal it attacks, and a buffer stops it correcting all the time.
Robot soccer has led to real companies: Raffaello D'Andrea, who coached Cornell's robot soccer team, went on to co-found Kiva Systems, whose warehouse robots Amazon bought in 2012. Robotics, mechanical, electrical and software engineers all work on robots like these.
Do it together
- Open mytekdev.com/try/robotsoccerlab?lesson=get-behind-the-ball-why-driving-straight-fails&ref=fam-robotsoccerlab-1 together. Ask where the ball will go, then press play.
You'll know it worked when: The robot turns to the ball, drives at it and pushes it into its own yellow goal, in about 3 seconds.
- In the box on the field press Show me the blocks, then Put them in. Go back to Simulator and press play.
You'll know it worked when: The robot moves round the ball and scores in the blue goal, in about 3.8 seconds.
- Open Blocks and change both 60s to 30. Play. Then try 0 and 90.
If you get stuck: Change the 60 in both move at angle blocks: the ball can be on either side.
You'll know it worked when: 0 scores an own goal again, 30 runs into the wall, 90 usually scores but takes longer.
- Put the 60s back, press Next: Level 2 and press play. Then try card two in the box.
You'll know it worked when: Card one goes into its own penalty area and is called out; card two touches the ball three times without turning.
- Go on to Level 3 and try card two, then card three.
You'll know it worked when: Card two scores facing backwards, which this level refuses; card three turns to face the blue goal with the compass and scores.
Talk about it
Ask these while you work together. A child who has understood it can answer them without help:
- Why did the starter push the ball into its own goal?
- The ball is at 4 o'clock. What angle is that, and where does card one move?
- What happened at offset 0, and why is it like the starter?
- Why does card one fail on Level 2?
- What does the buffer in card three stop?
For younger and older kids
Younger: For a younger child, stop after the four offsets on Level 1, and talk about what each one did.
Older: For an older child, go on to Level 4, where card one is not enough, and read the hint in the box.
Keep going
- Open Level 4, Get behind it: card one is not enough there. Read the hint in the box and make the offset grow with the ball's angle.
- Open the Python tab after putting in card one. Find the line for each block.
- Card one goes at speed 70. Try 50 and 90 on Level 1 and time each goal.
Bring it into other subjects
- Math: draw a clock face and mark the angle for every hour. Which hours are more than 90 degrees from 12?
- Physical education: practice getting behind the ball before a pass. What does a player look at first?
- Careers: look up what a robotics engineer does, and which companies build robots that find things with sensors.
- Computer science: write the three parts of the robot's job as a list, then add a fourth for Level 4 or 5.
For your records
Ready to copy into an hour log, a portfolio or a transcript.
| Lesson | Robot Soccer Lab: Get Behind the Ball, Why Driving Straight at It Fails |
|---|---|
| Subjects | Computer science |
| Time | 45 minutes |
| What we did | Programmed a simulated soccer robot in Blocks: found why driving straight at the ball scores an own goal, tested an offset at four values, and used a compass to keep the robot facing the goal. |
| Skills practiced | Conditionals; Testing a program; Angles and sensors |
Robot Soccer Lab: Get Behind the Ball, Why Driving Straight at It Fails
Activity sheet (optional)
Name: ______________________________ Date: ______________
Open the app: scan the QR code, or go to mytekdev.com/try/robotsoccerlab?lesson=get-behind-the-ball-why-driving-straight-fails
Essential question: Why does driving straight at the ball fail, and what plan works instead?
Warm-up: The ball is between you and your own goal. What do you do before you kick it? ________________________
- Vocabulary. Sensor, ball clock, omni wheels, offset, compass heading, buffer: write each in your own words.
- The starter. The ball went into the ________ goal after about ____ seconds.
- My offset table. Both 60s changed to: 0: ________. 30: ________. 60: ________. 90: ________.
- Levels 2 and 3. Card one on Level 2: ________. Card two on Level 3: ________. Card three on Level 3: ________.
1. Why does driving straight at the ball fail from its wrong side?
2. What does the buffer in card three stop?
Quick check
Name: ______________________________
1. The ball is at 3 o'clock. Its angle from the robot's front is: (A) 3 degrees (B) 90 degrees (C) 180 degrees
2. Card one moves at the ball's angle plus 60 because: (A) it is faster (B) it goes round the ball to get behind it (C) the sensor is wrong
3. A friend's robot keeps scoring in its own goal. Use what you learned today to say what to change, and why.
Answers
| Question | Answer | Why |
|---|---|---|
| 1 | B | 3 times 30 is 90: straight to the right. |
| 2 | B | Aiming past the ball takes the robot round it until the ball is in front, between the robot and the far goal. |
| 3 | Open answer | Move round the ball first, with an offset such as 60, so the robot pushes it from behind toward the right goal. |
If your state or umbrella school asks, this lesson covers CSTA 2017 2-AP-12, CSTA 2017 2-AP-13, CSTA 2017 2-AP-17.