manif: The Lie Theory Library That Makes You Read the Paper First
A header-only C++ toolkit that turns micro Lie theory into a consistent API for robotics state estimation, with analytic Jacobians and no hidden conventions.
- manif packages micro Lie theory into a header-only C++ API for robotics state estimation.
- Its core promise is analytic Jacobians expressed in local tangent-space perturbations.
- The library treats documentation as part of the product, asking users to read a 17-page paper before writing code.
- It occupies the gap between pose libraries like Sophus and full estimation frameworks like GTSAM.
The README That Sends You to a Paper
Most libraries open with a quickstart. manif opens with homework.
The README says it plainly: "We recommend every user of manif to read the paper (17 pages) before starting to use the library." That paper is Solà, Deray, and Atchuthan's "A micro Lie theory for state estimation in robotics."
That single instruction tells you what kind of project this is. manif is not trying to hide its conventions behind a friendly wrapper. It is trying to make the math usable, and it assumes you want to understand the math. In robotics state estimation, the conventions are the hard part. Rotations do not add. Poses do not subtract. Jacobians depend on where you define your perturbation. Get that wrong and your filter diverges.
manif is a Lie theory library for state-estimation targeted at robotics applications.
From a Paper to Header-Only C++
manif is the code half of a two-part project. The math half is the micro Lie theory paper, a robotics-focused presentation of Lie groups that is careful about every convention. The paper is not a survey. It picks one consistent way to define things and sticks to it.
manif turns that presentation into a header-only C++11 library with Python 3 wrappers. Drop the headers into your project, link Eigen, and the groups are available. There is no build step for the library itself, which keeps it easy to vendor into an existing codebase.
The project was published in the Journal of Open Source Software as "Manif: A micro Lie theory library for state estimation in robotics applications," by Jeremie Deray and Joan Solà, under the MIT license. Deray is the primary maintainer.
What Is Actually in the Box
manif supports a set of groups that maps directly onto robotics problems:
- ℝ(n): the Euclidean vector space, the flat baseline case.
- SO(2) and SO(3): rotations in 2D and 3D.
- SE(2) and SE(3): rigid transformations, or poses, in 2D and 3D.
- SE₂(3): an extended pose that carries velocity, useful for inertial navigation.
- SGal(3): the Galilean group, for inertial sensors that have to account for gravity.
- Bundle<>: a way to compose several groups into a single compound state.
For each group, manif provides the operations a filter or optimizer needs: exp and log maps, composition, inverse, the adjoint, plus and minus on the manifold, and analytic Jacobians for each of them. The unusual groups are part of the point. SE₂(3) and SGal(3) show up in inertial navigation, and many general-purpose geometry libraries stop at SE(3).
Why Rotations Do Not Add
Rotations are not vectors. Poses are not vectors. You cannot add two rotation matrices and get a meaningful rotation, and you cannot subtract two poses and get a displacement.
State estimation has to take derivatives anyway. A Kalman filter or a least-squares solver needs to nudge a state, measure the effect, and build a Jacobian. On a flat vector space that is easy. On a curved manifold it is where the whole problem lives.
The fix is to work in the tangent space. Pick a point on the manifold. At that point there is a flat tangent plane, and a small perturbation lives there as an ordinary vector. The exponential map takes that vector and lands you at a nearby point on the manifold. The logarithm map goes the other way.
The key choice is where the perturbation is defined. manif uses local tangent-space perturbations: the perturbation is applied at the current estimate, in the local frame. That is not the only convention. It is the one that keeps the Jacobians simple and consistent across operations, and it is the one the paper teaches.
The Jacobian Is the Product
What you actually pay for when you use manif is the Jacobians. Every operation ships with its analytic derivative, expressed with respect to local tangent-space perturbations.
That matters for two reasons. First, speed: analytic Jacobians are exact and cheaper than finite differences or runtime symbolic expansion. Second, consistency: every operation reports its derivative in the same convention, so the Jacobians compose without manual bookkeeping. When you chain operations in a filter update, you do not have to re-derive the chain rule by hand for each group.
manif is also built to interoperate with automatic differentiation. It documents compatibility with Ceres Jets and other autodiff types, so you can use the analytic Jacobians where you have them and mix in autodiff where you do not. The shape of the API reflects that idea: a group element, a tangent vector, and a Jacobian.
#include "manif/SO3.h"
using namespace manif;
SO3d R = SO3d::Identity(); // a point on the manifold
SO3d::Tangent d = SO3d::Tangent::Zero(); // a vector in the local tangent space
SO3d R2 = R + d; // exp map: move along the manifold
SO3d::Jacobian J = R.plusJacobian(); // analytic Jacobian of the operation
manif vs. Sophus, GTSAM, kindr, and Ceres
manif is not a SLAM framework. It is a reusable geometry and Lie-theory layer that slots underneath one. The table below places it against the closest projects.
| Project | Primary role | Group coverage | Jacobian / API convention | Best for |
|---|---|---|---|---|
| manif | Reusable Lie-group layer for state estimation | SO(2), SO(3), SE(2), SE(3), SE₂(3), SGal(3), bundles, ℝ(n) | Analytic Jacobians in local tangent-space perturbations | Filters and optimizers that need explicit manifold math |
| Sophus | Lie-group and geometry types | SO(2), SO(3), SE(2), SE(3) and related | Group operations, Eigen-based | General rotation and pose math |
| GTSAM | Full SLAM and estimation framework | Pose and manifold types inside a factor-graph system | Factor graphs, optimization, inference | Whole estimation systems, not just geometry |
| kindr | Typed kinematics and geometry | Rotations, poses, conversions | Kinematics-oriented typed API | Kinematics and transformation math |
| Ceres Solver manifolds | Nonlinear least-squares optimizer | Manifold interface for optimization variables | Local parameterization / manifold abstraction | Solving least-squares problems |
Two clarifications matter here. GTSAM and Ceres are complementary rather than competing: GTSAM is the whole estimation stack, and Ceres supplies the solver and the manifold abstraction that manif can plug into. Sophus is the closest conceptual alternative, and the difference to weigh is group coverage and the explicit local-perturbation Jacobian convention. kindr is a typed kinematics library, aimed more at transformations than at Lie-group calculus.
Star counts for the alternatives are deliberately omitted. They change, and the point of the comparison is the role each project plays, not its popularity.
Who Uses It and Why It Stays Small
manif maintains a curated list of downstream projects. It names:
- lie-group-controllers, for control on Lie groups.
- bipedal-locomotion-framework, for legged locomotion.
- kalmanif, for Kalman filtering on manifolds.
- cpp_filter, a filtering library built on the same ideas.
That list supports ecosystem use, but it is project-maintained, so it demonstrates that these projects rely on manif, not how deeply. The library stays small on purpose. It does not try to own your state representation, your solver, or your filter. It gives you the groups and their derivatives and gets out of the way.
The Trade-off: A Library That Refuses to Be a Black Box
manif makes a deliberate trade. It asks you to learn the math in exchange for giving you a consistent, explicit, and fast foundation for it. If you are a roboticist or a state-estimation researcher who wants rigor and control over conventions, that is a good trade. You get analytic Jacobians, unusual groups like SE₂(3) and SGal(3), and a Python interface when you want to prototype.
If you want a drop-in SLAM stack, this is not it. manif is a layer, not a system. It will not solve your problem for you, and the README is honest about that. It hands you the paper and the code together and trusts you to use both.





