The answersDownload the PDF
Worksheet

U6.5 Covariance and the ellipse

State estimation · University · about 30 min

BugBotLab
NameClassDate

What this lesson is about

Uncertainty in two dimensions has a shape, and the shape is the useful part.

Questions 6 marks in all

  1. [1 mark]A robot drives 200 cm straight with a 1 degree heading error. How large, in cm to one decimal place, is the across-track error?

  2. [1 mark]In two dimensions, about what percentage of the probability lies inside the one sigma ellipse?

  3. [1 mark]The ellipse axes of a covariance matrix [[5, 2], [2, 2]], from the 2 x 2 eigenvalue formula. What does it print?

    a, b, d = 5.0, 2.0, 2.0
    tr, det = a + d, a * d - b * b
    root = (tr * tr / 4 - det) ** 0.5
    l1, l2 = tr / 2 + root, tr / 2 - root
    print(l1, l2)
    print(round(l1 ** 0.5, 2), round(l2 ** 0.5, 2))
  4. [1 mark]A tag straight ahead of the robot gives a good range and a poor bearing. Which part of the uncertainty ellipse does a fix mainly shrink?

    1. AAlong the line of sight
    2. BAcross the line of sight
    3. CBoth equally
    4. DNeither, bearings are needed to shrink anything
  5. [1 mark]What does the off-diagonal term cov(x, y) of P tell you?

    1. AWhether the x and y errors move together, which tilts the ellipse
    2. BHow large the x uncertainty is
    3. CThe total uncertainty
    4. DThe heading error
  6. [1 mark]The uncertainty ellipse has grown long across the direction of travel. What kind of landmark would help most?

    1. AOne to the side of the track
    2. BOne straight ahead
    3. COne directly behind
    4. DAny landmark helps equally

The task: the shape of the uncertainty

Drive at least 60 cm, growing an along-track and an across-track uncertainty as you go. Plot both, and print along: and across: at the end.

from bugbot import *
import math
connect()

DT = 0.1
along = across = 0.0
head_sigma = 0.5

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

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

Challenges

  1. Turn 90 degrees half way and swap the two, since along and across have changed places in the world.
  2. Work out how far the robot can drive before the across-track uncertainty passes 10 cm.
  3. Given a tag directly ahead, which of the two would a fix shrink?