Competing · Robot club · about 25 min
Light Cycles, Rescue Line or Capture the Flag: how to practise one properly, and the line and gripper rehearsal.
[1 mark]Which game do you play on your own, after Module 7, using the line and the gripper at once?
[1 mark]Put the steps for getting good at a game in order.
Number the lines 1 to 5 to put them in the right order.
Change one thing at a timeThen play peoplePrint, race, readBeat one botRead the game page[1 mark]You change your top speed and your turning gain together, and the next race is better. What have you learned?
[1 mark]What does this program print?
for cx in [200, 160, 100]:
print(cx, round((cx - 160) * 0.35, 1))[1 mark]In the carry-home task, when should the jaws close?
[1 mark]In the rehearsal, line() sees nothing and the robot runs drive(25, 0, 40). What is it doing?
Follow the black line to the red ball, pick it up with the gripper, and carry it into the green zone at the end without dropping it. The line bends to the right, so driving straight up the mat misses the ball by 15 cm: the line is the only way to it.
from bugbot import *
connect()
set_cv('line')
gripper("open")
# follow the line first: steer by where it is and where it is going,
# and slide sideways onto it if you drift
while position()[1] < 40:
seen = line()
if seen:
cx, angle = seen
drive(35, (cx - 160) * 0.15, (cx - 160) * 0.15 + angle * 1.5)
else:
forward(20)
wait(0.1)
stop()Plan your program here, then type it in and press Run.