The answersDownload the PDF
Worksheet

U7.2 A cloud of guesses

Localisation · University · about 30 min

BugBotLab
NameClassDate

What this lesson is about

Representing a belief as a thousand samples, and what that buys over a mean and a variance.

Questions 6 marks in all

  1. [1 mark]Why did particle filters take over robot localisation from filters that assume Gaussian noise?

    1. ARange sensors have likelihoods full of spikes and floors that do not fit a Gaussian, and a particle filter only needs to evaluate the likelihood
    2. BParticle filters always use less computation than a Kalman filter
    3. CParticle filters give the same answer on every run, which makes them easier to debug
    4. DParticle filters need fewer samples as the state gets more dimensions
  2. [1 mark]Why is a particle filter hopeless for estimating the configuration of a 12 degree of freedom arm?

    1. AThe number of particles needed grows exponentially with the number of dimensions of the state
    2. BAn arm's motion model is nonlinear, which a particle filter cannot handle
    3. CThe measurement model of an arm is Gaussian, so a Kalman filter is always better
    4. DParticles can only represent positions, not joint angles
  3. [1 mark]Particles are spread evenly along x from 0 to 200 cm. What is the standard deviation (the spread) of their x values, in cm, to one decimal place?

  4. [1 mark]What does this program print?

    xs = [10.0, 10.0, 10.0, 190.0, 190.0, 190.0]
    N = len(xs)
    mean = sum(xs) / N
    spread = (sum((x - mean) ** 2 for x in xs) / N) ** 0.5
    print(mean, spread)
    
  5. [1 mark]Which of these are genuine costs of a particle filter?

    Tick every answer that is true.

    1. AEvery particle is moved and weighted every tick
    2. BThe particles needed grow exponentially with the state's dimensions
    3. CTwo runs give slightly different answers, which makes debugging harder
    4. DIt needs a motion model that is linear or can be differentiated
    5. EIt can only represent a belief with one peak
  6. [1 mark]Why must some particles start near the true pose?

    1. AThe filter only ever reweights and copies the guesses it has, so it cannot invent a guess near the truth
    2. BParticles far from the truth make the weights sum to more than one
    3. CDistant particles slow the motion update down
    4. DThe weighted mean is only defined when a particle is within one sigma of the truth

The task: a thousand guesses

Make a cloud spread evenly over the whole mat and print particles:, mean x: and spread x:.

from bugbot import *
import random
connect()

N = 600

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

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

Challenges

  1. Print the spread of a cloud that is all in one place. What is it?
  2. Make a cloud that says "in one of two corners" and print its mean. Is the mean a sensible answer?
  3. Work out how much of the mat 600 particles cover if each represents a 5 cm patch.