Localisation · University · about 50 min
No idea where it starts. Work it out, then drive somewhere on purpose.
[1 mark]What does this program print?
import math SIGMA = 3.5 particles = [40.0, 42.0, 44.0, 150.0, 152.0] measured = 157.0 w = [math.exp(-(((200 - y) - measured) ** 2) / (2 * SIGMA * SIGMA)) + 1e-12 for y in particles] total = sum(w) weights = [v / total for v in w] print(round(sum(v * y for v, y in zip(weights, particles)), 1))
[1 mark]The depth sensor faces the far wall, so its readings pin down y. The robot turns ninety degrees to the left. What does a cloud weighed against the new readings pin down?
[1 mark]In phase one the robot faces the far wall, and the cloud finds y but stays a stripe across the mat. What cuts the stripe down to a spot?
[1 mark]A project filter weighs its x cloud against every reading, including those taken during the ninety degree turn towards the left wall. It ends 58 cm from the robot with a spread of 5 cm. Why?
[1 mark]During the run the estimate suddenly jumps by 60 cm. What has most likely happened?
[1 mark]In phase two the spread starts climbing steadily. What does that mean?
[1 mark]Which defence specifically lets the filter recover if the robot is picked up and moved mid-run?
Work out where the robot woke up, print it as found:, and then drive into the green corner. position() is not allowed anywhere.
from bugbot import * import math, random connect() DT, N, SIGMA = 0.1, 400, 3.5 particles = [random.uniform(0, 200) for i in range(N)]
Plan your program here, then type it in and press Run.
x? Why not?