The answersDownload the PDF
Worksheet

U6.2 Predict and correct

State estimation · University · about 30 min

BugBotLab
NameClassDate

What this lesson is about

The shape every filter has: a model that guesses forward, a measurement that pulls it back.

Questions 7 marks in all

  1. [1 mark]Put one tick of the lesson's fusion loop in order.

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

    1. measured = START_GAP - distance()
    2. est = 0.9 * est + 0.1 * measured
    3. plot("estimate", est)
    4. est += flow()[1] * DT
  2. [1 mark]Three ticks of predict and correct with made-up sensor values. What does it print?

    DT, START_GAP = 0.1, 110.0
    est = 0.0
    for speed, d in ((20.0, 107.0), (20.0, 103.0), (20.0, 104.0)):
        est += speed * DT
        measured = START_GAP - d
        est = 0.9 * est + 0.1 * measured
        print(round(est, 2))
  3. [1 mark]What is measured - est called?

  4. [1 mark]The plotted innovation is consistently positive. What does that say?

    1. AThe model is biased and the filter is fighting it
    2. BThe filter is working well
    3. CThe measurement noise is larger than expected
    4. DThe blend weight is too large
  5. [1 mark]Why does predict and correct keep up with a moving robot better than a low pass filter on the distance alone?

    1. AThe prediction uses a measurement of the motion, so the correction only fixes a small residue
    2. BIt uses a smaller alpha
    3. CIt uses two sensors, which halves the noise
    4. DIt runs the loop faster
  6. [1 mark]The correct step is changed to est = 0.98 * est + 0.02 * measured. What is the filter now trusting?

    1. AMostly the flow prediction, so drift is corrected only slowly
    2. BMostly the wall measurement, so the estimate is noisy
    3. CBoth equally
    4. DNeither, the estimate stops updating
  7. [1 mark]The robot has no velocity sensor. What does the lesson suggest as the model for the predict step?

    1. AThe commands sent, through the kinematics from U2
    2. BA copy of the last measurement
    3. CA low pass filter on the measurement
    4. DNo prediction; correct only

The task: predict, then correct

Drive at least 40 cm towards the wall, running predict and correct, plotting measured and estimate, and print my y:. position() is not allowed.

from bugbot import *
connect()

DT = 0.1
START_GAP = 110.0
est = 0.0

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

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

Challenges

  1. Plot the innovation as well. Is it centred on zero?
  2. Set the blend to 0.5 and to 0.02 and compare. What is each one trusting?
  3. Break the prediction on purpose by multiplying the flow by 1.2. Where does that show up?