The answersDownload the PDF
Worksheet

7.6 Passing

Hands and feet · Robot club · about 20 min

BugBotLab
NameClassDate

What this lesson is about

Aim at a team mate's tag, judge the power from its distance.

Questions 7 marks in all

  1. [1 mark]A kick goes about 45 cm, and the ball starts about 8 cm in front of your centre. How far from you, in cm, should the receiver be?

  2. [1 mark]What does this program print?

    dist = 70
    if dist > 56:
        print("forward", dist - 53)
    elif dist < 50:
        print("backward", 53 - dist)
    else:
        print("kick from here")
  3. [1 mark]Put the steps of a pass in order.

    Number the lines 1 to 5 to put them in the right order.

    1. gripper("close")
    2. Carry the ball to about 53 cm from the receiver
    3. aim_at(101) again
    4. aim_at(101)
    5. kick()
  4. [1 mark]What does this program print?

    error = 20
    print(max(-30, min(30, error * 3)))
    error = -4
    print(max(-30, min(30, error * 3)))
  5. [1 mark]Why does the passing code call aim_at(101) a second time after moving?

    1. ADriving forward or back changes the bearing a little
    2. BThe tag's id changes when you move
    3. Ckick() only works after two aims
    4. DThe gripper opens when the robot drives
  6. [1 mark]You are the receiver. What should your program do?

    1. AFace the passer, wait, and close the jaws when distance() drops to a few centimetres
    2. BClose the jaws before the kick so they are ready
    3. CDrive at the ball as fast as you can
    4. DWait until holding() says red, then close the jaws
  7. [1 mark]The receiver is 70 cm away and you kick without moving. What happens?

    1. AThe ball stops about 17 cm short of the receiver
    2. BThe ball rolls past the receiver
    3. CThe ball reaches the receiver
    4. DThe kick is stronger to make up the distance

The task: pass to your partner

Grip the ball, get to kicking range of the blue robot, aim, and kick so the ball stops within the square around it.

# the two lines every program starts with: the commands, then the robot
from bugbot import *
connect()

# close the jaws (it waits while they move)
gripper("close")
# kick: one turn of the kicker winds the spring and lets it go
kick()
# pause 5 s (the robot keeps doing what it was told)
wait(5)

Plan your program here, then type it in and press Run.

QR code
Do it on the robot
www.bugbotlab.com/learn/7-6-passing/
The simulator checks it and tells you when it passes. Nothing to install, no account.

Challenges

  1. Pass to a partner who is moving: aim a little ahead of them.
  2. Make the pass bounce off the right wall on its way (aim at the wall, and think about the range).
  3. Write pass_to(tag_id) that does the whole thing, and time it.