Hands and feet · Robot club · about 30 min
Every ball into the home zone.
[1 mark]The first ball is home. On the second trip, what goes wrong with a plain find_ball("red")?
blobs() can only see one ball per runfetch always returns False after the first ball[1 mark]What does this program print?
def at_home(bx, by):
return abs(bx) < 15 and by < 16
for bx, by in [(5, 10), (-20, 10), (0, 40)]:
print(bx, by, "home" if at_home(bx, by) else "still out")[1 mark]What does this program print?
import math px, py = 0, 0 heading = 90 bearing = 0 dist = 4 * 92 / 23 h = math.radians(heading + bearing) print(round(px + math.sin(h) * dist), round(py + math.cos(h) * dist))
[1 mark]After opening the jaws at home, put the moves in order so the robot never drives through the ball it just dropped.
Number the lines 1 to 4 to put them in the right order.
gripper("open")backward(50, distance=8)forward(50, distance=20)right(50, distance=14)[1 mark]Why step back and then sideways before driving away?
go_to only works facing sideways[1 mark]Three balls must be home within two minutes. On average, how many seconds can each ball take?
Bring all three red balls into the home zone within two minutes.
Plan your program here, then type it in and press Run.