Localisation · University · about 35 min
The measurement update: how likely is this reading if the robot were there?
[1 mark]What does this program print?
import math
sigma = 3.0
measured = 144.0
for predicted in (144.0, 147.0, 150.0):
d = predicted - measured
w = math.exp(-d * d / (2 * sigma * sigma))
print(predicted, round(w, 3))
[1 mark]What does this program print?
weights = [0.4, 0.3, 0.2, 0.1] neff = 1.0 / sum(w * w for w in weights) print(round(neff, 2))
[1 mark]A cloud has 100 particles. After normalising, two particles have weight 0.5 each and every other particle has weight 0. What is the effective sample size?
[1 mark]Why add a tiny floor such as 1e-12 to every weight?
[1 mark]The sensor's real noise has a standard deviation of 3 cm, but the filter uses sigma = 0.5 cm. What happens?
[1 mark]What is the quantity 1 / (sum of the squared normalised weights) called?
[1 mark]The robot is 80 cm from the far wall and has turned 60 degrees towards the left wall. The depth sensor reads 152 cm. A filter weighs its cloud with predicted = 200 - y. What happens?
Scatter particles over the mat, take a reading, weight them, and print best y: (the weighted mean) and neff:.
from bugbot import * import math, random connect() N, SIGMA = 500, 3.0 particles = [random.uniform(0, 200) for i in range(N)]
Plan your program here, then type it in and press Run.