Hands and feet · Robot club · about 20 min
Rolling, friction, bouncing, and measuring power against distance.
[1 mark]The box is 23 to 31 cm ahead of the ball, closer than a kick goes. What is the right tool?
[1 mark]Why does every kick travel about the same distance?
kick() measures the distance and brakes the ball[1 mark]What does this program print?
for width in [46, 23]:
print(width, "px ->", round(4 * 92 / width), "cm")46 px -> 8 cm 23 px -> 16 cm
Half the width, twice the distance: 46 px is 8 cm away and 23 px is 16 cm away.
[1 mark]You carry the ball and stop with the robot's centre 22 cm up the mat, then open the jaws. About how far up the mat is the ball, in whole cm?
[1 mark]A wall returns the ball with about half its speed, and how far a ball rolls is proportional to its speed. A ball hits the wall moving fast enough to roll another 20 cm. About how far does it roll back, in whole cm?
[1 mark]A friend measured 45 cm on their smooth mat. Your mat is carpet. What kick distance should your program use?
The box is 23 to 31 cm ahead of the ball, closer than a kick goes. Get the ball to stop in it: carry it there with the gripper and let go.
# 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 5 s (the robot keeps doing what it was told) wait(5)
The hint students can ask for: The box is 23 to 31 cm ahead of the ball, too close for a kick. Carry the ball there instead: close the jaws on it, drive forward, and open them where you want it to stay.
from bugbot import *
connect()
gripper("close")
forward(40, distance=28)
gripper("open")
wait(2)
Any program that meets the task's checks is marked correct in the simulator; this is one way, not the only way.