Noisy Sensors & Kalman Filters
Add noise, then motion. Average and fuse measurements, track a moving ball with a Kalman filter, and use its prediction to grab the ball on the move.
Start the lesson0/4 steps done
What you'll learn
- Quantify sensor noise and reduce it by averaging
- Fuse measurements optimally with the Kalman update
- Track a moving object with a constant-velocity Kalman filter
- Use predictions to act ahead of time
- Reject outliers with a Mahalanobis gate
Before you start
You should be comfortable with basic Python: variables, loops and functions. We'll introduce the robotics and the maths as you go. The first visit downloads the physics engine and Python, about 20 MB, and later visits load from your browser's cache.
Steps
- 1Noise and averagingEvery reading of the ball is a little wrong. Measure how wrong, then average the error away.Measurement noiseStandard deviationAveragingOpen
- 2Fusing measurementsTwo sensors, one precise and one sloppy. Weigh each reading by how much you trust it: the Kalman update.Kalman gainCovarianceSensor fusionPro
- 3Tracking a moving ballThe ball is on a conveyor now. Predict where it went, correct with each reading: the full Kalman filter.State-space modelsPredict / updateProcess noisePro
- 4Catch itUse the filter's prediction to be where the ball will be, then close the gripper at exactly the right moment.PredictionTimingActing under uncertaintyPro
- ★Bonus: Don't trust every readingNow and then the sensor reports something wild. Spot readings that can't be right and skip them.OutliersInnovationMahalanobis gatingPro