The answersDownload the PDF
Worksheet

1.4 Sideways

Driving · Robot club · about 15 min

BugBotLab
NameClassDate

What this lesson is about

Strafing: moving without turning, the thing wheels cannot do.

Questions 7 marks in all

  1. [1 mark]What is strafing?

    1. ASliding sideways or diagonally while facing the same way
    2. BTurning on the spot
    3. CDriving backwards
    4. DDriving in a curve
  2. [1 mark]What does this program make the robot do?

    forward(60, distance=20)
    right(60, distance=20)
    backward(60, distance=20)
    left(60, distance=20)
    1. ADrive a square, facing the same way the whole time
    2. BDrive a square, turning at each corner
    3. CDrive forward 40 cm
    4. DStay exactly where it is
  3. [1 mark]Why is strafing useful? Choose all that apply.

    Tick every answer that is true.

    1. AIt keeps the heading, so no turning error is added
    2. BThe camera and distance sensor can stay pointed at something while the robot moves
    3. CIt makes the robot drive perfectly straight
    4. DIt uses no power
  4. [1 mark]What does drive(60, -60, 0) do?

    1. ADrives diagonally forward and to the left
    2. BDrives diagonally forward and to the right
    3. CDrives forward and turns left
    4. DStays still, because 60 and -60 cancel out
  5. [1 mark]Why does drive need a wait and a stop around it?

    1. AIt returns at once and takes no distance
    2. BIt only works inside a loop
    3. CIt drives for exactly one second
    4. Dwait and stop set its speed
  6. [1 mark]What does this program print?

    p = (12.5, 30.0)
    print("moved right to x =", p[0])
  7. [1 mark]What does drive(60, 0, 20) with a wait(3) make the robot do?

    1. ADrive forward in a gentle curve
    2. BSlide sideways
    3. CSpin on the spot without moving forward
    4. DDrive dead straight

The task: reach the green square

There is a wall between you and the green square. Get the robot into the square within 20 seconds without touching the wall. The wall is 20 cm wide and the square 20 cm beyond it. Forward, sideways, forward, sideways, and no turning needed. Remember the margin for coasting.

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

# drive forward at 60 for 20 cm, then stop
forward(60, distance=20)
# your turn: go round the wall and into the square

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

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

Challenges

  1. Solve reach-the-square by strafing first, then forward, then strafing back.
  2. Draw a diamond with four drive calls.
  3. Drive a circle: drive(50, 0, rotation) with the right rotation for three seconds. Hint: the heading should change by 360.