The answersDownload the PDF
Worksheet

U3.7 Project: the long lap

Odometry and drift · University · about 45 min

BugBotLab
NameClassDate

What this lesson is about

Two metres of driving, one landmark, and an estimate that has to stay honest.

Questions 6 marks in all

  1. [1 mark]Put the long lap program in order.

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

    1. Stop in the home zone and keep updating while stopped
    2. Steer towards (0, 0) in your own estimated frame, still updating every tick
    3. Drive the outward part of the lap, updating the odometry every tick
    4. Stand still and average the gyro rate to learn the bias
    5. Print my x and my y
  2. [1 mark]The example program calls step(4) after stop(). Why keep updating the odometry while the robot is stopped?

    1. AThe robot coasts after the stop and can be nudged while still, and an update skipped is a piece of the path missing
    2. BIt recalibrates the gyro bias
    3. CThe plot needs extra points to draw properly
    4. DIt keeps the deadman from stopping the robot
  3. [1 mark]The lap is marked to within 10 cm after 200 cm of driving. If heading error were the only source, what is the largest heading error you could afford, in degrees to one decimal place?

  4. [1 mark]An uncalibrated gyro has a bias of 0.4 deg/s. How many seconds does it take to build up a 2.9 degree heading error, to one decimal place?

  5. [1 mark]Which of the steps in the lesson is optional?

    1. ATaking a fix from tag 3
    2. BCalibrating the gyro
    3. CRotating by the midpoint heading
    4. DRunning the odometry while stopped
  6. [1 mark]The same lap driven in the other direction ends with a noticeably different error. What is the most likely cause?

    1. AA leftover gyro bias, which adds to turns one way and takes away from turns the other
    2. BFlow noise, which is larger in one direction of travel
    3. CSlip, which only happens on right turns
    4. DNothing; the two errors should always be the same size

The task: the long lap

Two metres of driving, back into the home zone under your own navigation, with my x: and my y: printed at the end and within 10 cm of the truth.

from bugbot import *
import math
connect()

DT = 0.1
# calibrate, then drive the lap, updating every tick

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

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

Challenges

  1. Plot your estimate and the truth for both axes on one chart. Where does the gap open up?
  2. Do the lap in the other direction. Is the error the same size? If not, what does that say about the bias?
  3. Run the lap at set_noise(0.5), 1 and 2, and plot the final error against the noise level. Is it a straight line?