HomeRobotics & KinematicsPose-Graph SLAM: Gauss–Newton Solver (2D)

Pose-Graph SLAM: Gauss–Newton Solver (2D)

Interactive 2D companion to the 3D loop-closure demo: instead of a local edge-by-edge relaxation, this simulator assembles the full sparse normal equations for the same SE(2) pose graph — analytic Jacobians, an information-weighted Gauss-Newton step solved by dense Gaussian elimination every iteration — and plots the live log-cost convergence curve alongside the trajectory. Verified against the 3D sim's relaxation method: the batch solver reaches the true optimum in a handful of iterations, while the relaxation formula plateaus at a measurably worse fixed point on the identical graph.

Robotics & Kinematics2DAdvanced60 FPS📱 Mobile-adapted⇄ 3D version
2d-slam-algorithms ↗ Open standalone

This is the 2D companion to the 3D pose-graph SLAM loop-closure simulator, and it deliberately solves the identical SE(2) pose-graph problem with a different, more rigorous numerical method. Rather than the lightweight Gauss-Seidel edge relaxation used in the 3D scene — where each odometry or loop-closure edge locally nudges only its own two endpoints, one at a time, and correction has to propagate one hop per sweep — this simulator assembles the full information-weighted normal equations for the whole graph every iteration: analytic 3×3 Jacobian blocks for every node, a dense Hessian and gradient built from all 48 edges at once, and a Gauss-Newton step solved by Gaussian elimination with the first pose fixed as the gauge anchor. The live log-cost convergence plot makes the difference visible directly: because the measurements are noisy, the true minimum of the cost isn't zero, and this batch solver's cost stabilizes at that real optimum in just a few iterations — the same class of solver (Gauss-Newton / Levenberg-Marquardt) that runs inside g2o, GTSAM and Cartographer. A standalone numerical check confirmed the gap is real: replaying the 3D sim's exact relaxation formula on the identical noisy graph does not converge to that same optimum at all — it plateaus at a fixed point roughly 50× worse after thousands of sweeps — so the two methods here aren't just different speeds on the same answer, they land on measurably different solutions to the same problem.

⚙ Under the hood

2D companion to the 3D loop-closure demo: instead of local edge-by-edge relaxation, this simulator assembles the full sparse normal equations for the same SE(2) pose graph — analytic Jacobians, an information-weighted Gauss-Newton step solved by dense Gaussian elimination every iteration — and plots the live log-cost convergence curve alongside the trajectory.

SLAMroboticsloop closurepose graphGauss-Newtonleast squares

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)