Linear Algebra, Probability & Optimisation
Calibrate a camera by solving a linear system, then fit it properly with least squares. Measure a sensor's noise and bias, fuse two sensors, and finish by letting gradient descent find joint angles for you.
Start the lesson0/5 steps done
What you'll learn
- Solve square linear systems and fit overdetermined ones with least squares
- Describe sensor error with mean, variance and bias
- Fuse two noisy measurements by inverse-variance weighting
- Minimise a cost function with gradient descent
- Recognise local minima and constraints
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
- 1Linear systems: calibrate a cameraA camera that reports pixels, three known points and six unknowns: solve Ax = b to turn pixels into metres.MatricesLinear equationsAx = bSingular systemsOpen
- 2Least squares: fitting noisy dataThree noisy points fit exactly, noise and all. Twelve points and least squares average the noise away.Overdetermined systemsResidualsLeast squaresCalibrationOpen
- 3Noise, mean, variance & biasA sensor's error has two parts. Noise averages away; bias doesn't, so measure it on something you know.MeanVariance and standard deviationGaussian noiseBias vs noiseOpen
- 4Combining two sensorsTwo cameras, each blind in a different direction. Weigh every reading by how much you trust it.Inverse-variance weightingUncertainty shrinksTrusting the better sensorOpen
- 5Optimisation: gradient descentTurn reaching into a number to minimise, then walk downhill. Numerical IK in a dozen lines.Cost functionsGradientsStep sizeLocal minimaConstraintsOpen
- ★Bonus: Probability & Bayes' ruleA sensor that's usually right can still leave you unsure. Bayes' rule says how sure, and how evidence adds up.ProbabilityConditional probabilityBayes' ruleEvidence adds upOpen