← All virtual labs
Robotics & AI · Virtual lab

Robot kinematics, planning & control

Eight self-contained experiments, each solved live in your browser with hand-rolled math — no libraries. Pick an experiment on the left, then move through Aim, Theory, Procedure, the live Simulation, a graded Self-assessment, and References.

1 · Robot arm forward kinematics

Planar 2-link manipulator — joint angles to end-effector pose
To compute and visualise the Cartesian pose of the end-effector of a planar 2-link revolute manipulator as a direct function of its joint angles, and to develop intuition for how each joint contributes to reach.

Forward kinematics maps joint space to task space. For a planar arm with links L1, L2 and joint angles θ1, θ2 measured cumulatively from the base, each link adds its projection onto the global axes. The end-effector position is obtained by summing the link vectors.

x = L1·cos(θ1) + L2·cos(θ1+θ2)
y = L1·sin(θ1) + L2·sin(θ1+θ2)

The map is single-valued: every joint configuration yields exactly one pose. The reachable set lies in an annulus of outer radius L1+L2 and inner radius |L1-L2|.

  1. Open the Simulation tab.
  2. Drag the θ1 slider and observe the whole arm rotate about the base.
  3. Drag θ2 and note that only the second link folds — the base joint is unaffected.
  4. Read the live end-effector X / Y values and confirm they match the equations.
  5. Watch reach used: it reaches 100% only when both links are aligned outward.

Planar arm in reach

Forward kinematics: drag the angle sliders to pose the arm; the green dot and label are the live end-effector position.

Configuration

35°
60°
-30°
Up
Down
End-effector X
0
End-effector Y
0
Reach used
0%
Target dist
--

The math

FK: x = L1 c1 + L2 c12, y = L1 s1 + L2 s12. IK (2-link): cosθ2 = (x²+y²-L1²-L2²)/(2 L1 L2), then θ1 = atan2(y,x) - atan2(L2 s2, L1+L2 c2). The 3rd link, if present, holds a fixed wrist offset.
  • Spong, Hutchinson & Vidyasagar — Robot Modeling and Control, Ch. 3 (Forward Kinematics). Wiley.
  • Craig, J. J. — Introduction to Robotics: Mechanics and Control, Ch. 3. Pearson.
  • Virtual Labs (IIT) — Robotics: Manipulator Kinematics, vlabs.ac.in.

2 · Robot arm inverse kinematics

Closed-form 2-link IK — target pose to joint angles, elbow up / down
To solve the inverse-kinematics problem for a planar 2-link arm in closed form — given a target Cartesian point, find joint angles that place the end-effector there — and to explore the two-solution (elbow-up / elbow-down) nature of the problem and its singularities.

Inverse kinematics inverts the FK map. Applying the law of cosines to the triangle formed by the two links and the line to the target (x,y) gives the elbow angle directly:

cosθ2 = (x² + y² - L1² - L2²) / (2·L1·L2)
θ2 = ± atan2(√(1-cos²θ2), cosθ2)
θ1 = atan2(y,x) - atan2(L2·sinθ2, L1 + L2·cosθ2)

The ± sign selects elbow-up vs elbow-down. If |cosθ2| > 1 the point is unreachable. At the workspace boundary the two solutions merge — a singularity where the arm loses a degree of freedom.

  1. Open the Simulation tab.
  2. Click anywhere inside the workspace to set a target; the arm animates to the analytic solution.
  3. Toggle Elbow Up / Down and click the same point — both pose the tip identically but bend oppositely.
  4. Click a point outside the dashed reach circle — the badge reads out of reach and no solution is drawn.
  5. Aim for a point on the boundary to observe the near-singular straightened arm.

Click-to-solve IK in reach

Inverse kinematics: click a target in the workspace — the arm solves its joint angles analytically (law of cosines) and animates to it. Sliders still drive forward kinematics.

Configuration

35°
60°
Up
Down
End-effector X
0
End-effector Y
0
θ₁ solved
--
θ₂ solved
--

Solution branches

Two joint solutions reach the same point. Elbow-up and elbow-down are mirror images about the base-to-target line. They coincide on the reach boundary — a singular configuration.
  • Spong, Hutchinson & Vidyasagar — Robot Modeling and Control, Ch. 4 (Inverse Kinematics). Wiley.
  • Paul, R. P. — Robot Manipulators: Mathematics, Programming, and Control. MIT Press.
  • Virtual Labs (IIT) — Robotics: Inverse Kinematics of 2R Manipulator, vlabs.ac.in.

3 · 3-link arm & workspace

3R planar manipulator — sweep joints to trace the reachable envelope
To compute the forward kinematics of a redundant 3-link planar arm and to map its reachable workspace by Monte-Carlo / grid sampling of the joint space, illustrating how added links enlarge the workspace and create dexterous inner regions.

For a 3R planar arm the tip position accumulates three link contributions, each rotated by the running sum of joint angles:

x = L1 c₁ + L2 c₁₂ + L3 c₁₂₃
y = L1 s₁ + L2 s₁₂ + L3 s₁₂₃

where c₁₂₃ = cos(θ1+θ2+θ3) and so on. The arm is kinematically redundant: it has 3 joints for a 2-DOF task, so infinitely many configurations reach most points. The workspace is the set of all reachable tips — here a disc of radius L1+L2+L3, with a possible unreachable inner hole when one link dominates. Sampling the joint space and plotting every resulting tip reveals this envelope empirically.

  1. Open the Simulation tab.
  2. Press Sweep workspace — the simulator samples thousands of joint triples and stipples each reachable tip, building up the envelope.
  3. Adjust the L3 length slider and re-sweep; note how the outer radius and inner hole change.
  4. Drag θ1 / θ2 / θ3 to pose the live arm and confirm the tip always lands inside the sampled cloud.
  5. Read outer / inner radius — the measured envelope matches L1+L2+L3.

3R workspace ready

Workspace: each cyan dot is the tip of one sampled joint configuration. The purple arm is your live pose. The dashed circle is the theoretical reach L1+L2+L3.

Joints & geometry

40°
50°
-35°
70
Tip X
0
Tip Y
0
Outer radius
0
Inner hole
0

Redundancy

A 3R arm has one extra DOF over a planar task. The same tip point can be reached by a continuum of elbow configurations — useful for dodging obstacles while holding a pose. The sampled cloud is the union of all those tips.
  • Siciliano, Sciavicco, Villani & Oriolo — Robotics: Modelling, Planning and Control, Ch. 2-3. Springer.
  • Lynch & Park — Modern Robotics, Ch. 4 (Forward Kinematics) & workspace analysis. Cambridge.
  • Virtual Labs (IIT) — Robotics: Workspace of a Planar Manipulator, vlabs.ac.in.

4 · Differential-drive mobile robot navigation

Unicycle model with a proportional heading + speed controller
To model a differential-drive (unicycle) mobile robot and drive it to clicked waypoints using a proportional controller on heading and speed, observing the integrated trajectory and the effect of controller gains on the approach.

A differential-drive robot is modelled as a unicycle with pose (x, y, θ), linear speed v and turn rate ω:

ẋ = v·cosθ   ẏ = v·sinθ   θ̇ = ω

The controller computes a heading error to the goal, wrapped to [-π,π], and commands turn rate proportionally; forward speed scales with remaining distance and de-rates when the heading error is large:

eθ = atan2(dy,dx) - θ  ω = Kω·eθ  v = Kᵛ·d·max(0, cos eθ)

The pose is integrated each frame with Euler steps. This is a nonholonomic system — it cannot move sideways — so it must turn toward a goal before advancing.

  1. Open the Simulation tab and click a point to drop a goal.
  2. Watch the robot turn toward the goal first, then drive in — the cyan curve is its integrated path.
  3. Lower and re-click: the robot arcs in slowly. Raise it for crisp turns (too high — it wobbles).
  4. Adjust Kᵛ and Max v to change how aggressively it accelerates and its top speed.
  5. Use Reset robot to return it to the corner.

Differential-drive field idle

Click to drop a waypoint goal. The robot follows a proportional heading + speed controller integrating the unicycle model x'=v cosθ, y'=v sinθ, θ'=ω.

Controller gains

3.5
1.2
110
1.4
Speed v
0
ω rad/s
0
Heading
Goal dist
--

How it steers

Heading error eθ = atan2(dy,dx) - θ wrapped to [-π,π]; ω = Kω · eθ. Forward speed scales with distance and de-rates when steering hard. Obstacles (Exp. 5) add a repulsive push.
  • Siegwart, Nourbakhsh & Scaramuzza — Introduction to Autonomous Mobile Robots, Ch. 3. MIT Press.
  • LaValle, S. M. — Planning Algorithms, Ch. 13 (Differential Models). Cambridge.
  • Virtual Labs (IIT) — Mobile Robotics: Unicycle Kinematics, vlabs.ac.in.

5 · Potential-field obstacle avoidance

Attractive goal + repulsive obstacles bending the motion vector
To implement artificial potential-field navigation, where the robot is pulled toward a goal by an attractive field and pushed away from obstacles by repulsive fields, and to observe the resulting collision-free trajectory and the local-minimum failure mode.

The robot descends the gradient of a total potential U = U_att + U_rep. The attractive part pulls toward the goal; each obstacle contributes a repulsion that grows as the robot nears it, active only within an influence radius d₀:

F_att = k_a · (goal - p) / |goal - p|
F_rep = k_r · (d₀ - d)/d₀ · (p - obs)/d,  for d < d₀

The net force vector sets the desired heading; the same unicycle controller then tracks it. Potential fields are fast and reactive but can trap the robot in a local minimum where attraction and repulsion cancel before reaching the goal.

  1. Open the Simulation tab — two obstacles are pre-placed.
  2. Click a goal on the far side of an obstacle and watch the path bow smoothly around it.
  3. Press Add obstacle, then click to place a new repeller, and set a goal behind it.
  4. Raise the Avoid gain — the robot gives obstacles a wider berth.
  5. Try to trap the robot between two close obstacles to provoke a local minimum (it stalls short of the goal).

Potential field idle

Repulsive fields: each obstacle adds a 1/d-style push that bends the goal-seeking vector. Click for a goal; Add obstacle drops repellers.

Field gains

3.5
1.2
110
1.6
Speed v
0
Rep force
0
Obstacles
2
Goal dist
--

Local minima

When repulsion exactly opposes attraction the net force is zero away from the goal and the robot halts — the classic potential-field trap. Global planners (Exp. 6) avoid this by construction.
  • Khatib, O. — Real-Time Obstacle Avoidance for Manipulators and Mobile Robots. IJRR, 1986.
  • Choset et al. — Principles of Robot Motion, Ch. 4 (Potential Functions). MIT Press.
  • Virtual Labs (IIT) — Robot Navigation: Artificial Potential Fields, vlabs.ac.in.

6 · A* / Dijkstra grid path planning

Heuristic search on an editable occupancy grid with animated frontier
To find the shortest collision-free path on an occupancy grid using the A* algorithm, to visualise the expanding search frontier, and to compare heuristics (Manhattan, octile, Euclidean) and connectivity (4- vs 8-neighbour) for optimality and efficiency.

A* expands grid cells in increasing order of an estimated total cost, popping the open cell with the smallest:

f(n) = g(n) + h(n)

where g(n) is the exact cost from the start and h(n) is a heuristic estimate to the goal. If h never overestimates (it is admissible) A* returns an optimal path; if it also satisfies the triangle inequality (consistent) no cell is re-expanded. With h=0 A* degenerates to Dijkstra. For 8-connected grids the octile distance is the exact metric and so is admissible. Diagonal corner-cutting through walls is forbidden, and diagonal moves cost √2.

  1. Open the Simulation tab. Drag to paint walls; shift+click sets the start, ctrl+click the goal.
  2. Choose a heuristic — Manhattan forces 4-direction motion; octile / Euclidean allow diagonals.
  3. Press Plan & drive and watch the cyan frontier expand and the dark visited set fill in.
  4. Read expanded vs path cells — a sharper heuristic expands far fewer nodes for the same path.
  5. Set the heuristic so it acts like Dijkstra (Manhattan on an open grid) and note it expands a broad diamond.

A* grid edit walls

Drag to paint walls, shift+click sets start, ctrl+click sets goal. Run A* to watch the frontier expand, then the robot drives the shortest path.

Planner

14ms
Expanded
0
Frontier
0
Path cells
0
Path cost
0

A* notes

Expands the open node with smallest f = g + h, where g is true cost-so-far and h an admissible estimate. Octile distance is the exact shortest 8-connected metric, so it is admissible and yields optimal diagonal paths.
  • Hart, Nilsson & Raphael — A Formal Basis for the Heuristic Determination of Minimum Cost Paths. IEEE TSSC, 1968.
  • Russell & Norvig — Artificial Intelligence: A Modern Approach, Ch. 3 (Informed Search). Pearson.
  • Virtual Labs (IIT) — AI: A* and Dijkstra Shortest Path, vlabs.ac.in.

7 · PID control of a 1-D system

Mass-cart with drag driven to a setpoint — rise, overshoot, settling
To tune a PID controller regulating the position of a 1-D mass with viscous drag to a setpoint, and to study how the proportional, integral and derivative gains shape the rise time, overshoot, steady-state error and settling time of the closed-loop response.

The plant is a unit mass with drag c under control force u: m·a = u - c·v. The PID law acts on the tracking error e = setpoint - x:

u = Kp·e + Ki·∫e dt + Kd·de/dt

Kp gives a force proportional to error — bigger Kp means faster rise but more overshoot. Kd reacts to the rate of change, adding damping that suppresses overshoot and oscillation. Ki accumulates past error to eliminate steady-state offset, at the cost of possible wind-up (mitigated here by clamping the integral). Key metrics: overshoot (peak above setpoint), settling time (entering and staying within a 2% band).

  1. Open the Simulation tab — the cart chases the amber setpoint and the curve plots position over time.
  2. Increase Kp alone: rise speeds up but overshoot climbs and oscillation appears.
  3. Add Kd: the response damps — watch overshoot and settling time drop.
  4. If a steady offset remains, add Ki to drive it to zero.
  5. Press Step setpoint to command a fresh step and read overshoot / settling for your tuning.

Response — mass-cart to setpoint running

A unit mass with drag is driven by a PID force toward the setpoint. The curve is real-time integrated position; the lower strip shows the cart chasing the setpoint marker.

Gains & setpoint

12
2.0
6.0
55
1.0
Position
0
Error
0
Overshoot
0%
Settle t
--

Control law

u = Kp·e + Ki∫e dt + Kd·de/dt, with e = setpoint - x. Plant: m·a = u - c·v. Push Kp high for fast rise but watch overshoot; add Kd to damp it; trim steady-state offset with Ki.
  • Åström & Murray — Feedback Systems: An Introduction for Scientists and Engineers, Ch. 10. Princeton.
  • Ogata, K. — Modern Control Engineering, Ch. 5-8. Pearson.
  • Virtual Labs (IIT) — Control Systems: PID Controller Tuning, vlabs.ac.in.

8 · Inverted pendulum / cart-pole balance

Integrate the nonlinear cart-pole; state-feedback balances the pole upright
To integrate the nonlinear equations of motion of a cart-pole (inverted pendulum on a cart) and design a state-feedback / PID controller that applies a horizontal force to keep the pole balanced upright, studying the stabilising effect of each feedback term and the basin of attraction.

The cart (mass M) carries a hinged pole (mass m, half-length l) at angle θ from vertical, driven by force F. The coupled nonlinear dynamics are:

θ̈ = (g sinθ - cosθ·temp) / (l (4/3 - m cos²θ/(M+m)))
temp = (F + m l θ̇² sinθ) / (M+m)
ẍ = temp - m l θ̈ cosθ / (M+m)

The upright equilibrium θ=0 is unstable — any deviation grows without control. A linear state-feedback law F = kθ·θ + kω·θ̇ + kx·x + kv·ẋ stabilises it: the angle terms right the pole, the cart terms keep it centred. Integrated with sub-stepped Euler, the controller catches and balances the pole.

  1. Open the Simulation tab — the pole starts slightly tilted and the controller catches it.
  2. Press Nudge pole to inject a disturbance and watch the cart dart to recover.
  3. Lower toward zero — the controller can no longer hold the pole and it falls.
  4. Raise (angular damping) to calm oscillation; raise kx / kv to pull the cart back to centre.
  5. Press Drop pole (disable control) to see the open-loop instability, then re-enable to recover.

Cart-pole balancing

Nonlinear cart-pole integrated live. The amber curve is pole angle vs time; the controller force is shown as the arrow on the cart.

Feedback gains

120
18
3
6
Angle θ
Cart x
0
Force F
0
Status
up

Why it is hard

The upright pole is an unstable equilibrium — the linearised system has a right-half-plane pole. Feedback must act faster than the instability grows. Too little and the basin of attraction vanishes; the pole topples past recovery.
  • Barto, Sutton & Anderson — Neuronlike Adaptive Elements That Can Solve Difficult Learning Control Problems. IEEE SMC, 1983.
  • Ogata, K. — Modern Control Engineering, inverted-pendulum state-feedback example. Pearson.
  • Virtual Labs (IIT) — Control Systems: Inverted Pendulum Stabilisation, vlabs.ac.in.

9 · Jacobian inverse kinematics (damped least squares)

n-link planar arm — numeric IK by Levenberg-Marquardt, manipulability & singularities
To solve the inverse-kinematics problem for a redundant n-link planar manipulator numerically, by building the geometric Jacobian and iterating a damped-least-squares (Levenberg-Marquardt) update toward a clicked target, while visualising the manipulability ellipse and observing how damping keeps the solver stable through singular configurations where the closed-form inverse blows up.

For an n-link planar arm the end-effector position p = f(q) depends nonlinearly on the joint vector q = (θ1..θn). Linearising gives the velocity relation through the Jacobian J, where ṗ = J(q) q̇. For the planar tip, column j is the perpendicular of the vector from joint j to the tip:

J[0][j] = -Σ(k≥j) Lᵤ sin(Θᵤ)  (= -(y_tip - y_j))
J[1][j] =  Σ(k≥j) Lᵤ cos(Θᵤ)  (=  (x_tip - x_j))

where Θᵤ = θ1+..+θᵤ. A naive Newton step Δq = J⁻¹ e (with error e = p_target - f(q)) diverges near singularities where J loses rank and J⁻¹ explodes. The damped least squares update adds a regulariser λ²I:

Δq = Jᵀ (J Jᵀ + λ² I)⁻¹ e

This is the Levenberg-Marquardt / Tikhonov solution: it behaves like the pseudo-inverse far from singularities and like gradient descent near them, trading a little tracking accuracy for bounded joint rates. The manipulability ellipse, with axes the singular values of J, shows the directions the tip can move easily; it collapses to a line at a singularity, where the manipulability w = √det(J Jᵀ) drops toward zero.

  1. Open the Simulation tab and click any target point — the solver iterates the DLS update and the arm animates to it.
  2. Choose 3-link or 4-link — with more joints the arm is redundant and reaches the same point many ways.
  3. Raise the damping λ and re-click: convergence is smoother but slower; lower λ converges fast but jitters near the boundary.
  4. Aim for a point on the reach circle to drive the arm near-straight (a singularity) — watch the manipulability ellipse flatten and w drop, while DLS still converges gracefully.
  5. Read iterations and final error; click an unreachable point and see the solver settle at the closest boundary pose.

DLS inverse kinematics ready

Click a target; the solver runs damped least squares Δq = Jᵀ(J Jᵀ+λ²I)⁻¹e per iteration. The amber ellipse is the manipulability ellipse from the Jacobian's singular values.

Solver

8.0
0.60
Iterations
0
Error px
--
Manip w
0
Cond σmax/σmin
--

Singularities

When the arm straightens, the Jacobian's smallest singular value → 0, so w = √det(J Jᵀ) → 0 and the ellipse flattens. The λ²I term keeps (J Jᵀ+λ²I) invertible, bounding the joint update instead of letting it diverge.
  • Buss, S. R. — Introduction to Inverse Kinematics with Jacobian Transpose, Pseudoinverse and Damped Least Squares. UCSD, 2004.
  • Nakamura & Hanafusa — Inverse Kinematic Solutions with Singularity Robustness for Robot Manipulator Control. ASME J. Dyn. Sys., 1986.
  • Siciliano, Sciavicco, Villani & Oriolo — Robotics: Modelling, Planning and Control, Ch. 3 (Differential Kinematics). Springer.

10 · RRT* sampling-based motion planning

Grow an asymptotically-optimal tree among obstacles, rewire, then drive the path
To implement the RRT* (optimal Rapidly-exploring Random Tree) planner in a 2D field cluttered with obstacles — sampling the free space, extending the tree toward each sample by a steered step, choosing the best parent and rewiring the local neighbourhood for optimality — and to observe the tree filling the space while the solution path shortens toward the optimum, after which the robot follows it.

RRT* builds a tree of collision-free configurations rooted at the start. Each iteration: sample a random point x_rand (occasionally the goal); find the nearest tree node x_near; steer a fixed step η toward it to get x_new; reject if the segment hits an obstacle.

x_new = x_near + η·(x_rand - x_near)/|x_rand - x_near|

What makes it RRT* (asymptotically optimal, unlike plain RRT) is two extra steps over the near set within radius r:

choose parent: argmin over near n of (cost(n) + |n - x_new|), collision-free
rewire: for each near n, if cost(x_new) + |x_new - n| < cost(n) then re-parent n to x_new

The connection radius shrinks as the tree grows, r = min(γ·(log N / N)^(1/d), η), which guarantees the path cost converges to the optimum as samples N→∞. cost(n) is the path length from the root along the tree.

  1. Open the Simulation tab. The start (green) and goal (red) sit on opposite sides of the obstacle field.
  2. Press Grow tree — nodes sprout toward random samples, edges avoid obstacles, and the best path so far is drawn in amber.
  3. Keep watching: as rewiring proceeds, the amber path straightens and shortens — its length is shown live.
  4. Adjust step η (smaller = finer, slower) and goal bias (higher = greedier toward the goal) and re-grow.
  5. When a path exists, press Drive path — the robot follows the optimised route to the goal.

RRT* field ready

Grow tree samples free space, steers a step η from the nearest node, picks the cheapest parent and rewires neighbours. The amber path is the current best; it shortens as the tree refines.

Planner

30
8%
24/f
Nodes
1
Path cost
--
Rewires
0
Status
idle

Optimality

Plain RRT finds a path but never improves it. RRT* adds choose-parent and rewire over a shrinking neighbourhood, so the cost provably converges to the optimum as nodes accumulate — you can watch the amber path tighten.
  • Karaman & Frazzoli — Sampling-based Algorithms for Optimal Motion Planning. IJRR, 2011 (introduces RRT*).
  • LaValle, S. M. — Planning Algorithms, Ch. 5 (Sampling-Based Motion Planning). Cambridge.
  • Virtual Labs (IIT) — Robotics: Sampling-Based Path Planning (RRT), vlabs.ac.in.

11 · EKF localization & SLAM

Noisy odometry + range-bearing landmarks — Extended Kalman Filter predict / update
To localise a mobile robot that moves with noisy odometry while taking noisy range-bearing measurements to known landmarks, by implementing the Extended Kalman Filter's predict and update steps over the nonlinear motion and observation models, and to watch the 3σ covariance ellipse shrink and the estimated pose lock onto the true pose as each landmark is observed.

The state is the pose x = (px, py, θ) with covariance P. Predict propagates the velocity-motion model with control (v, ω) over dt, linearising about the current mean via the Jacobian F = ∂g/∂x and adding process noise Q:

px′=px+v·cosθ·dt  py′=py+v·sinθ·dt  θ′=θ+ω·dt
P ← F P Fᵀ + Q

Update folds in each landmark observation z = (range, bearing). The expected measurement h(x) and its Jacobian H for a landmark at (mx, my), with dx=mx-px, dy=my-py, q=dx²+dy², are:

h = ( √q , atan2(dy,dx) - θ )
H = [ -dx/√q  -dy/√q  0 ;  dy/q  -dx/q  -1 ]
K = P Hᵀ (H P Hᵀ + R)⁻¹,  x ← x + K(z - h),  P ← (I - K H) P

The innovation z - h has its bearing wrapped to [-π,π]. Each correction shrinks P — the uncertainty ellipse contracts — while prediction between observations re-inflates it. This is EKF localization with a known map; extending the state to also hold landmark positions makes it EKF-SLAM.

  1. Open the Simulation tab. The robot (true pose = cyan, estimate = purple with its covariance ellipse) drives a loop; fixed landmarks are the amber stars.
  2. Press Run. During predict-only stretches the purple ellipse grows as odometry noise accumulates and the estimate drifts from the true pose.
  3. When a landmark falls in sensor range, an observation line is drawn and the EKF update snaps the estimate back — the ellipse visibly shrinks.
  4. Raise odometry noise to make the ellipse balloon faster between fixes; raise sensor noise to weaken each correction.
  5. Read position error and trace(P) — both fall sharply at each update and creep up during prediction.

EKF localization idle

Cyan = true pose, purple = EKF estimate with its 3σ covariance ellipse, amber stars = landmarks. Lines flash when a landmark is observed and the filter corrects.

Noise & sensing

2.0
4.0
200
70
Pos error
0
trace(P)
0
Obs/loop
0
Heading err

Predict vs update

Predict grows uncertainty: P ← F P Fᵀ + Q. Update shrinks it via the Kalman gain K = P Hᵀ(H P Hᵀ+R)⁻¹. The ellipse breathes — inflating on dead-reckoning, contracting on every landmark fix.
  • Thrun, Burgard & Fox — Probabilistic Robotics, Ch. 3 (Gaussian Filters) & Ch. 7 (EKF Localization). MIT Press.
  • Smith, Self & Cheeseman — Estimating Uncertain Spatial Relationships in Robotics. 1990 (foundational EKF-SLAM).
  • Durrant-Whyte & Bailey — Simultaneous Localization and Mapping (SLAM): Part I. IEEE RAM, 2006.