Hands and feet · Robot club · about 20 min
Aim at a team mate's tag, judge the power from its distance.
[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?
[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")[1 mark]Put the steps of a pass in order.
Number the lines 1 to 5 to put them in the right order.
gripper("close")Carry the ball to about 53 cm from the receiveraim_at(101) againaim_at(101)kick()[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)))
[1 mark]Why does the passing code call aim_at(101) a second time after moving?
kick() only works after two aims[1 mark]You are the receiver. What should your program do?
distance() drops to a few centimetresholding() says red, then close the jaws[1 mark]The receiver is 70 cm away and you kick without moving. What happens?
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.
pass_to(tag_id) that does the whole thing, and time it.