Driving · Robot club · about 15 min
Strafing: moving without turning, the thing wheels cannot do.
[1 mark]What is strafing?
[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 mark]Why is strafing useful? Choose all that apply.
Tick every answer that is true.
[1 mark]What does drive(60, -60, 0) do?
[1 mark]Why does drive need a wait and a stop around it?
[1 mark]What does this program print?
p = (12.5, 30.0)
print("moved right to x =", p[0])[1 mark]What does drive(60, 0, 20) with a wait(3) make the robot do?
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.
drive calls.drive(50, 0, rotation) with the right rotation for three seconds. Hint: the heading should change by 360.