The answersDownload the PDF
Worksheet

7.2 The gripper

Hands and feet · Robot club · about 15 min

BugBotLab
NameClassDate

What this lesson is about

grip, release, holding: knowing when you have something.

Questions 7 marks in all

  1. [1 mark]The jaws close on nothing. What does holding() return?

    1. ANone
    2. BFalse
    3. C0
    4. D"red"
  2. [1 mark]Put the lines in order to drive up to a ball, stop and grab it. (The loop body is shown on one line.)

    Number the lines 1 to 4 to put them in the right order.

    1. while distance() > 6: forward(40); wait(0.1)
    2. stop()
    3. print("holding:", holding())
    4. gripper("close")
  3. [1 mark]A ball is 20 cm ahead. A student writes gripper("close") and then forward(40, distance=20). What goes wrong?

    1. AThe jaws shut on nothing before the robot arrives, so the ball is never held
    2. BNothing: the gripper waits until the robot reaches the ball
    3. CThe robot cannot drive while the jaws are closed
    4. Dholding() says red as soon as the jaws close
  4. [1 mark]distance() reads 7.5 cm, measured from the robot's centre, and the front of the robot is 3.5 cm from its centre. How many cm is the ball in front of the robot's front edge? Give a whole number.

  5. [1 mark]What does gripper("open") do underneath?

    1. Aservo(0, 0) then wait(0.4)
    2. Bservo(0, 90) then wait(0.4)
    3. Cservo(1, 0) then wait(0.4)
    4. Dservo(0, 0) with no wait
  6. [1 mark]The robot grips the red ball, slides left 15 cm, turns 90 degrees and reverses 10 cm. What does holding() say now?

    1. Ared, because the ball rides in the jaws until they open
    2. BNone, because turning shakes the ball loose
    3. CNone, because reversing leaves the ball behind
    4. DIt depends which way the robot is facing
  7. [1 mark]On the real robot, where does holding() get its answer from?

    1. AThe camera, seeing a ball filling the bottom of the picture in front of the jaws
    2. BA touch sensor inside the jaws
    3. CThe servo feeling how hard it is pushing
    4. DThe radio

The task: grab the ball

Drive up to the ball, grip it, and print holding: red.

# the two lines every program starts with: the commands, then the robot
from bugbot import *
connect()

# drive forward at 50 for 20 cm, then stop
forward(50, distance=20)
print("holding:", holding())

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

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

Challenges

  1. Try gripping from 8 cm and from 4 cm. Where does it stop working?
  2. Grip the ball, carry it 20 cm, release it, back away 10 cm, and grip it again.
  3. Print distance() before and after the grip.
  4. Close the jaws slowly with servo(0, angle), in steps of 10 degrees with a short wait between, and print holding() at each step: at what angle does the ball get caught?