The answersDownload the PDF
Worksheet

U11.7 Project: find the one that is green

Vision · University · about 50 min

BugBotLab
NameClassDate

What this lesson is about

Three identical shapes, one job, and a task the depth sensor cannot begin.

Questions 6 marks in all

  1. [1 mark]Three identical balls differ only in colour. Why can the depth sensor not pick out the green one?

    1. AIt measures a property of space, and identity lives in the surfaces, which only the camera sees
    2. BIts range is too short to reach the balls
    3. CIts readings are too noisy
    4. DIt cannot measure bearings
  2. [1 mark]The survey finds three 6 cm balls. What does this print?

    import math
    F, R = 92.4, 3.0
    seen = {"red": (100, 14), "green": (200, 28), "blue": (250, 9)}
    for colour, (cx, width) in seen.items():
        got = 2 * R * F / width, math.degrees(math.atan((cx - 160) / F))
        print(colour, "%.0f cm at %.0f degrees" % got)
  3. [1 mark]Why turn to the green ball's bearing and servo on its apparent size, rather than work out its coordinates and drive there open loop?

    1. AThe range is far worse than the bearing, and closing the loop on size lets the measurement improve as the robot gets closer
    2. BCoordinates cannot be computed from a bearing and a range
    3. COpen loop driving is not allowed on the mat
    4. DServoing is faster than driving a straight line
  4. [1 mark]Why must the survey be a separate phase before the approach?

    1. AThe camera runs one detector at a time, so it cannot watch for red while servoing on green
    2. BThe balls move once the robot sets off
    3. CThe depth sensor must be switched off while the camera runs
    4. DThe bearings change units when the robot moves
  5. [1 mark]The approach should stop 20 cm from a 6 cm ball. About how many pixels wide should it look, to 1 decimal place, with f = 92.4?

  6. [1 mark]Which choices help the robot stop short of the ball without touching it?

    Tick every answer that is true.

    1. AUse the dead band trick rather than a large forward gain
    2. BStop on a band of widths rather than one exact width
    3. CRaise the forward gain so it settles before it can overshoot
    4. DPlan the approach from the survey range and drive it without looking

The task: find the one that is green

Survey all three balls and print red:, green: and blue:, the range in centimetres to each. Then drive to the green ball and stop within reach of it without touching it. position() is not allowed: the robot has to find it by looking.

from bugbot import *
import math
connect()

F, R = 92.4, 3.0
TARGET = "green"

Plan your program here, then type it in and press Run.

QR code
Do it on the robot
www.bugbotlab.com/learn/u11-7-project-find-the-green/
The simulator checks it and tells you when it passes. Nothing to install, no account.

Challenges

  1. Run the survey again from where you finished. Which ranges improved, and by how much compared with the d^2 prediction?
  2. Make the choice of colour come from a tag: read a marker first and let its id decide which ball to fetch. What has to change in the program, and what does not?
  3. Replace the colour test with size: fetch the largest ball rather than the green one. Which measurement is doing the work now, and which of the two would you rather rely on in a room with a window?