FixTheRobot Explore Robotics / Probability for Robotics / M3 / M3-L1

This lab works on phones, but writing code is much easier on a laptop.

Probability for Robotics · Conditional Probability and Bayes' Rule · M3-L1 · Beginner

Bayesian Landmark Detection

Bench log · Rover in the teaching lab

11:05. Rover is looking for its charging dock. A marker detector watches for the dock sign and fires, but it also fires by mistake. The navigation log shows the belief "at the dock" jumping to 99% on frames that, to a human, look like nothing.

You will find out how convincing a single detection really is, write the Bayes update, make it accumulate evidence over frames, and track down why a camera driver that sends some messages twice made the filter overconfident.

Your task

    Simulation
    solution.pyLoading Python…
    Ctrl+Enter runs
    What Python can I use?

    Plain Python with math and the course library robotprob (for example from robotprob import Rng, mean, gaussian_pdf). NumPy is not available in the browser. Your code runs in a background worker: an endless loop is stopped after a few seconds and the page stays usable. It runs in your browser and is never sent anywhere.

    Hints

    What this lab teaches

    Stage 1 is the base-rate effect: with a rare dock, a detector with a 5% false-alarm rate is a coin flip even at a 95% hit rate. Stage 2 implements Bayes' rule for one reading, including the readings that say nothing was seen. Stage 3 chains the updates so each posterior becomes the next prior. Stage 4 is the commonest fusion bug: the same evidence counted twice.

    Grading is exact: the posterior is compared with the value of Bayes' rule on random priors and rates, the sequence with the recursion, and the final belief with the belief that counts each frame once.

    Theory for this lab

    Conditional Probability and Bayes' Rule labs

    1. M3-L1: Bayesian Landmark Detection: this lab.

    Educational simplification: the robot is either at the dock or not; the detector reports seen or not seen with a fixed hit rate at the dock and a fixed false-alarm rate elsewhere, independently from frame to frame. Real detectors have rates that depend on distance, light and angle, and their false alarms often repeat.

    Get the next lab

    Get notified when new robotics labs are released. One email per new lab, nothing else.