Talking to each other · Robot club · about 25 min
Drive to the handover, then and only then say go.
[1 mark]Put the relay handover in order.
Number the lines 1 to 5 to put them in the right order.
wait(0.5) to settlesend("go")Stay put and listen for finishedstop()Drive into the handover zone[1 mark]The starter code sends go before driving. What happens?
[1 mark]The handover zone starts 32 cm ahead and is 16 cm deep. How many cm ahead is its middle?
[1 mark]What does this program print?
def in_zone(y):
return 32 <= y <= 48
for y in [30, 40, 49]:
print(y, in_zone(y))[1 mark]Why is there a wait(0.5) between stop() and send("go")?
stop() only works after a wait[1 mark]You sent go and have heard nothing for two seconds. What is a sensible thing to do?
go again, in case the first was missedDrive into the handover zone, stop, send go, and stay there until the Runner says finished.
# the two lines every program starts with: the commands, then the robot
from bugbot import *
connect()
# radio this to every other robot
send('go')
# drive forward at 60 for 40 cm, then stop
forward(60, distance=40)Plan your program here, then type it in and press Run.
go only when velocity() says you have stopped.go to its finished.go a second time if nothing is heard within two seconds, in case the first was missed.