Hands and feet · Robot club · about 15 min
kick(): aiming, and how far the ball goes.
[1 mark]The kicker's servo is a continuous-rotation servo. What does servo(1, 90) do to it?
[1 mark]Every kick goes about 45 cm. How do you change where the ball ends up?
kick(30)servo(1, 180) for a harder kickkick()[1 mark]Put the three steps that kick() does underneath in order.
Number the lines 1 to 3 to put them in the right order.
servo(1, 90)wait(1)servo(1, 91)servo(1, 91) wait(1) servo(1, 90)
Start the servo turning, let it make one turn (which fires the lever), then stop it before it fires again.
[1 mark]Which of these are true about the kicker?
Tick every answer that is true.
kick() stops after one turn so it fires once.[1 mark]What does this program print?
width = 23 print(round(4 * 92 / width), "cm")
16 cm
A 4 cm ball that looks 23 pixels wide is 4 x 92 / 23 = 16 cm from the camera.
[1 mark]The robot faces up the mat. The target zone is 30 degrees to its left. Which line aims the kick?
turn_left(30, angle=30)turn_right(30, angle=30)servo(1, 30)kick() then turn_left(30, angle=30)[1 mark]One turn of the kicker takes about 1 s and fires once, half a second in. You run servo(1, 91), wait 3 s, then servo(1, 90). How many times does it fire?
kick() stops the servo after one turn.The ball lies 8 cm away, straight towards the green zone, but you are facing 30 degrees to the right of it, so it is not in front of the kicker yet. Turn to face the zone, then kick so the ball stops in it. Do not drive.
# the two lines every program starts with: the commands, then the robot from bugbot import * connect() # kick: one turn of the kicker winds the spring and lets it go kick() # pause 4 s (the robot keeps doing what it was told) wait(4)
The hint students can ask for: The ball lies 8 cm away, straight towards the green zone, but you are facing 30 degrees right of it, so the kicker cannot reach it yet. Turn to face the zone, then kick: a kick goes about 45 cm. Do not drive.
from bugbot import * connect() turn_left(30, angle=30) kick() wait(5)
Any program that meets the task's checks is marked correct in the simulator; this is one way, not the only way.