The answersDownload the PDF
Worksheet

10.6 Project: enter a hard game

Competing · Robot club · about 25 min

BugBotLab
NameClassDate

What this lesson is about

Light Cycles, Rescue Line or Capture the Flag: how to practise one properly, and the line and gripper rehearsal.

Questions 6 marks in all

  1. [1 mark]Which game do you play on your own, after Module 7, using the line and the gripper at once?

    1. ARescue Line
    2. BLight Cycles
    3. CCapture the Flag
    4. DShuttle Relay
  2. [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.

    1. Change one thing at a time
    2. Then play people
    3. Print, race, read
    4. Beat one bot
    5. Read the game page
  3. [1 mark]You change your top speed and your turning gain together, and the next race is better. What have you learned?

    1. AVery little: you cannot tell which change helped
    2. BBoth changes helped
    3. CThe speed change helped
    4. DYou should always change two things
  4. [1 mark]What does this program print?

    for cx in [200, 160, 100]:
        print(cx, round((cx - 160) * 0.35, 1))
  5. [1 mark]In the carry-home task, when should the jaws close?

    1. AOnce the robot has stopped with the ball in reach
    2. BAt the very start, so they are ready
    3. CAs soon as the line comes into view
    4. DWhen the robot reaches the green zone
  6. [1 mark]In the rehearsal, line() sees nothing and the robot runs drive(25, 0, 40). What is it doing?

    1. ACreeping forward while turning clockwise to find the line again
    2. BStopping until the line comes back
    3. CReversing along its path
    4. DSliding sideways

The task: carry it home

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.

QR code
Do it on the robot
www.bugbotlab.com/learn/10-6-project-enter-a-hard-game/
The simulator checks it and tells you when it passes. Nothing to install, no account.