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

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

Probability for Robotics · Random Variables and Probability Distributions · M2-L1 · Beginner

Sensor Noise Explorer

Bench log · Rover in the teaching lab

10:20. The new range sensor arrived without a data sheet. Rover looks at a flat wall exactly 1.50 m away and the readings scatter: some are a few centimetres off, some come in clear steps, a few are metres wrong. The navigation team needs numbers for their filter by lunch.

You will first reproduce the logged readings with a four-knob model, then write the three tools every sensor characterisation needs: a histogram that does not crash on real logs, an estimator that reports bias and spread separately, and an outlier detector that works even when a fifth of the readings are bad.

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 separates the four ingredients of a sensor error by eye: bias shifts the histogram, noise sets its width, resolution gives it teeth, and outliers are the thin tails. Stage 2 builds the histogram and the two boundary rules that make its counts add up. Stage 3 estimates the bias and the spread and shows why the spread must be measured around the mean, not around the truth. Stage 4 finds outliers with the median and the median absolute deviation, because the mean and standard deviation are exactly what outliers corrupt.

    Grading is on hidden logs: histogram counts are compared exactly, the bias and spread against the values computed from the same readings, and the outlier detector against the true outlier flags (recall and false-alarm rate).

    Theory for this lab

    Random Variables and Probability Distributions labs

    1. M2-L1: Sensor Noise Explorer: this lab.

    Educational simplification: a range sensor looking at a flat wall. A reading is the wall distance plus a constant bias plus Gaussian noise, rounded to the sensor resolution; with some probability the reading is replaced by a spurious value. Real sensors also drift with temperature, depend on the surface and have noise that grows with range.

    Get the next lab

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