// the take
g2o is a C++ library for solving the nonlinear least-squares graph optimization problems that sit at the core of SLAM and bundle adjustment. It's a back-end, not a full SLAM stack: you build a graph of poses/landmarks and constraints, and it gives you solvers (Gauss-Newton, Levenberg-Marquardt, Dogleg) to optimize it. Aimed at robotics and computer-vision engineers who need the optimization math, not researchers looking for a turnkey SLAM system.
The vertex/edge templating (base_vertex, base_fixed_sized_edge, base_variable_sized_edge) genuinely makes adding a new problem type a few hundred lines of code, which is why it's the optimization back-end inside ORB-SLAM2, RTAB-Map, and a long list of other SLAM systems. It ships multiple solver backends (CSparse, CHOLMOD/SuiteSparse, dense) so you can swap sparse linear algebra without touching your graph definition. Auto-differentiation (borrowed from Ceres' jet.h) means you can skip hand-deriving Jacobians for new edge types. CI actually covers Linux, macOS and Windows/MSVC, which a lot of robotics C++ libraries don't bother with.
Licensing is a real trap for anything commercial: the core is BSD, but g2o_viewer, g2o_incremental and the slam2d_g2o example are GPL3+, and if your SuiteSparse build includes CHOLMOD's supernodal factorization (common on Ubuntu/Debian packages), you silently pull in GPL code — you have to audit your dependency build, not just the g2o license file. The Python story is a dead end in this repo: bindings live on an experimental `pymem` branch that rewrites memory management to smart pointers and isn't merged, so the usable bindings are a separate third-party package (g2o-python) tracking a different codebase. The viewer stack (Qt5 + libQGLViewer + a freeglut fork stripped down and vendored since ~2000) is visibly dated and not something you'd want to build new tooling on. Incremental/online optimization (g2o_incremental, g2o_online) is a secondary example app bolted onto a system designed for batch optimization, not a maintained real-time API — expect to do real engineering work if you need online updates rather than offline graph solves.
We read the README, the directory tree and a key source file in October 2026. Nobody pays to be listed. How we judge →