---
title: 'FactorMPC: Manifold Graph-Based MPC Toolkit'
url: https://www.emergentmind.com/topics/factormpc
type: topic
---

# FactorMPC: Manifold Graph-Based MPC Toolkit

Searching arXiv for the cited FactorMPC paper and closely related MPC formulation papers.
FactorMPC is a factor-graph based model predictive control toolkit for systems evolving on nonlinear manifolds, introduced in “Integrated Planning and Control on Manifolds: Factor Graph Representation and Toolkit” [2510.04278]. It is designed for settings in which Euclidean MPC formulations struggle with singularities, over-parameterization, and poor convergence, particularly for robotic attitude dynamics and constrained motion planning. The framework unifies system dynamics, constraints, and objectives in a modular optimization structure, natively supports manifold-valued states, represents Gaussian uncertainties in tangent spaces, and incorporates control barrier function factors for safety-critical obstacle avoidance. In the reported quadrotor simulations and experiments, it demonstrates smaller RMS tracking error than a differential-flatness baseline and maintains real-time operation at a 100 Hz control rate [2510.04278].

## 1. Problem setting and design objective

FactorMPC addresses MPC problems in which the state evolves on a manifold \(\mathcal M\) rather than in a purely Euclidean vector space. The formulation uses manifold-valued states \(x_k \in \mathcal M\) for \(k=0,\dots,N\) and Euclidean controls \(u_k \in \mathbb R^m\). The stated motivation is that traditional Euclidean formulations encounter difficulty on nonlinear manifolds because of singularities, over-parameterization, and poor convergence, whereas a manifold-consistent treatment can preserve geometric structure [2510.04278].

The framework is organized as a factor graph. Variable nodes correspond to states and controls, while factor nodes encode dynamics, reference tracking, control regularization, control bounds, and obstacle-avoidance constraints. This organization is explicitly modular: factors such as \(\phi_k^{\rm D}\), \(\phi_k^{\rm ref}\), \(\phi_k^{\rm U}\), \(\phi_k^{\rm B}\), \(\phi_{i,k}^{\rm CBF}\), and \(\phi_{i,k}^{\rm vCBF}\) can be added to the graph according to the problem specification [2510.04278].

A plausible implication is that the principal contribution of FactorMPC is not a new MPC objective in isolation, but a representation and software architecture that makes manifold-consistent integrated planning and control amenable to sparse nonlinear optimization. That interpretation is consistent with the paper’s emphasis on modularity, sparsity exploitation, and plug-and-play factors [2510.04278].

## 2. Factor-graph representation of the MPC problem

The core of FactorMPC is a maximum-a-posteriori optimization problem defined on a factor graph. The dynamics factor \(\phi_k^{\rm D}(x_k,u_k,x_{k+1})\) enforces one-step discrete dynamics on \(\mathcal M\), while cost factors encode state tracking and control regularization. Inequality factors represent actuator bounds and obstacle-avoidance conditions. In the summary provided for the paper, the full optimization is written as

$$
\min_{\{x_k,u_k\}}
\sum_{k=0}^{N-1}\Bigl\|r^D_k\Bigr\|^2_{\Sigma_k^{-1}}
\;+\;\sum_{k=1}^{N}\Bigl\|x_k\boxminus x_k^r\Bigr\|^2_{Q}
\;+\;\sum_{k=0}^{N-1}\Bigl\|u_k-u_k^r\Bigr\|^2_{R}
+\!\sum_{k=0}^{N-1}\Bigl\|r^B_k\Bigr\|^2_{Q_B}
+\!\sum_{i,k}\Bigl\|r_{i,k}^{\rm vCBF}\Bigr\|^2
$$

subject to

$$
x_{k+1}=x_k\boxplus\bigl(f(x_k,u_k)\Delta t\bigr),\quad
u_{\min}\le u_k\le u_{\max},\quad
h_i(x_k)\ge0,\quad
\dot h_i(x_k,u_k)+\alpha h_i(x_k)\ge0.
$$

This formulation combines hard model structure with penalty-based residual terms. The dynamics residual in general manifold form is given as

$$
r_{\rm dyn}(x_k,u_k,x_{k+1})
\;=\;\log_{x_{k+1}}\!\bigl(x_k\boxplus\Delta t\,f(x_k,u_k)\bigr)
\;\in T_{x_{k+1}}\mathcal M,
$$

with quadratic penalty

$$
\|r_{\rm dyn}\|^2_{\Sigma_k^{-1}}
\;=\;
r_{\rm dyn}^\top\,\Sigma_k^{-1}\,r_{\rm dyn}.
$$

For the quadrotor example, the state manifold is \(\mathcal M = SO(3)\times\mathbb R^3\times\mathbb R^3\). The paper summary gives the stacked dynamics residual \(r_k^D\) in terms of translational and rotational increments, including \(\Log\bigl(R_w^{b_k}R_{b_{k+1}}^w\bigr) - \omega_{b_k}\Delta t\), thereby making the manifold dependence explicit [2510.04278].

This factor-graph construction exploits the fact that each factor contributes a small Jacobian block, so the resulting Hessian is block-sparse and banded. The paper explicitly attributes computational efficiency to this sparsity structure together with the probabilistic interpretation of the graph [2510.04278].

## 3. Manifold geometry and uncertainty modeling

A defining feature of FactorMPC is that uncertainty is represented in tangent spaces rather than by imposing a Euclidean Gaussian directly on the manifold state. Process noise is modeled as \(w_k \sim \mathcal N(0,Q_k)\) and injected through the local tangent-space update

$$
x_{k+1}\;=\;x_k\boxplus\bigl(f(x_k,u_k)\Delta t + w_k\bigr).
$$

The framework states that uncertainty is always represented as a Gaussian in \(T_{x_k}\mathcal M\), and the Mahalanobis norm uses a covariance \(\Sigma_k\) in that tangent space [2510.04278].

For Lie groups, the retraction and inverse error operators are specified as

$$
x\boxplus v = x\Exp(v),
$$

and

$$
x\boxminus y = \Log(x^{-1}y).
$$

These operators provide the geometric machinery for expressing residuals, priors, and reference-tracking errors without reverting to over-parameterized Euclidean coordinates. This suggests that the framework is intended to preserve intrinsic geometry throughout the prediction horizon rather than only at the dynamics level. The same operators appear in the objective term \(\|x_k\boxminus x_k^r\|_Q^2\), linking state estimation style residuals with MPC cost construction [2510.04278].

A common misconception in manifold control is that a manifold-aware formulation merely replaces one coordinate chart with another. FactorMPC is more specific: the representation of the state, the definition of residuals, and the Gaussian uncertainty model are all posed through manifold operators and tangent-space covariance structure. In the source material, this geometric consistency is one of the stated reasons for improved behavior relative to Euclidean formulations on nonlinear manifolds [2510.04278].

## 4. Safety-critical obstacle avoidance via CBF and vCBF factors

FactorMPC incorporates safety-critical obstacle avoidance directly into the factor graph through control barrier function factors. The safe set is defined by

$$
h_i(x_k)\;=\; d_{\rm obs}(x_k)\;-\;d_{\rm safe}\;\ge 0,
$$

and the Lie-derivative safety condition is

$$
\dot h_i(x_k,u_k) + \alpha\,h_i(x_k)\;\ge\;0,
$$

with \(\alpha(h)=\alpha h\) [2510.04278].

The distance-based CBF factor residual is

$$
r_{i,k}^{\rm CBF}(x_k)
= \max\bigl(\,-\alpha\,h_i(x_k) \;-\; \nabla_x h_i(x_k)\,f(x_k),\;0\bigr).
$$

The framework extends this construction with a velocity-extended CBF, denoted vCBF, which adds relative velocity along the obstacle normal \(n_i\). The corresponding function is

$$
h_i^{\rm v}(x_k,u_k)
= \frac1{d_{\rm safe}-\|p_b^w-p_o\|}
\;+\;\gamma\,n_i^\top(v_b^w-v_o^w),
$$

and its residual is

$$
r_{i,k}^{\rm vCBF}(x_k,u_k)
= \max\bigl(\,-\dot h_i^{\rm v}(x_k,u_k)-\alpha\,h_i^{\rm v}(x_k),\,0\bigr).
$$

The summary states that the Jacobian of this residual with respect to \(u_k\) is derived in closed form. It also characterizes the velocity-extended, on-manifold CBF-based obstacle avoidance factors as intended for safety-critical applications [2510.04278].

In the reported quadrotor experiments, static cylinder and moving ball scenarios were used, and the quadrotor never violated \(d_{\rm safe}\). The paper summary describes this as guaranteed safety in those demonstrated scenarios. A careful reading suggests that the guarantee is tied to the modeled CBF conditions and the experimental setup reported in the paper, rather than constituting a universal guarantee for arbitrary modeling error or solver failure [2510.04278].

## 5. Solver architecture, software toolkit, and reported performance

FactorMPC is implemented on top of GTSAM. The solver uses GTSAM’s nonlinear Gauss–Newton on manifolds and iSAM2 for incremental updates, with Levenberg–Marquardt damping when factors become ill-conditioned, such as when \(\theta_i \to \pi/2\) in rotation [2510.04278]. The software is distributed as an open-source toolkit at:

`https://github.com/RoboticsPolyu/FactorMPC`

The implementation is described as plug-and-play. The provided summary states that each factor—such as `DynamicsFactor`, `CBFactor`, `vCBFFactor`, and `BoundaryFactor`—derives from `NoiseModelFactor`. The typical integration pattern is to create a `NonlinearFactorGraph`, add priors, dynamics factors, bound factors, control-rate factors, vCBF factors for obstacles, and reference factors, then optimize with a `LevenbergMarquardtOptimizer` [2510.04278].

```cpp
NonlinearFactorGraph graph;
// 1) initial prior
graph.add(PriorFactor<NavState>(X(0), x_init, priorNoise));
// 2) for k=0..N-1 add:
graph.add(DynamicsFactor(X(k), U(k), X(k+1), dynNoise));
graph.add(ControlBoundFactor(U(k), u_min, u_max, boundNoise));
graph.add(ControlRateFactor(U(k),U(k-1), rateNoise));
for each obstacle i:
  graph.add(vCBFFactor(X(k),U(k),obs_i,alpha,gamma,cbfNoise));
graph.add(ReferenceFactor(X(k), x_ref[k], refNoise));
// 3) optimize
Values init = initializeValues();
LevenbergMarquardtOptimizer optimizer(graph, init, params);
Values result = optimizer.optimize();
```

To integrate a new robot, the summary lists four required specifications: the state manifold type and \(\boxplus,\boxminus\) operators, the discrete dynamics model \(f(x,u)\), obstacle descriptions for CBF factors, and solver parameters such as horizon \(N\), weights \(Q,R,\alpha\), and related terms [2510.04278].

The reported real-time performance is explicit. The typical MPC loop runs at 100 Hz, and the factor-graph solve takes approximately \(5\) ms on a laptop, with 99.6% of solves under \(10\) ms even with CBFs active. In the quadrotor experiment summary, the average computation time is \(5.4\) ms, the maximum is less than \(10\) ms at a 100 Hz control rate, and the RMS tracking error over an eight-figure trajectory is smaller than the differential-flatness baseline (DFBC) [2510.04278].

## 6. Position within the MPC literature

FactorMPC belongs to a line of work that treats MPC as a structured optimization problem, but it differs from classical linear-quadratic MPC methods in both state representation and solver architecture. In a standard linear, discrete-time setting, the system is written as

$$
x_{k+1} = A_k x_k + B_k u_k,
$$

with a quadratic horizon cost, and the dominant online computation is often the Newton-step solve via Riccati recursion [1407.6898]. The paper “A Parallel Riccati Factorization Algorithm with Applications to Model Predictive Control” describes the classical backward Riccati recursion and a tree-based parallelization that reduces the serial \(O(N)\) factorization cost to \(O(\log N)\) parallel time when sufficient processing units are available [1407.6898].

This comparison clarifies the scope of FactorMPC. The Riccati-based framework in [1407.6898] is tailored to equality-constrained linear MPC with quadratic costs and exploits the special structure of that setting. FactorMPC, by contrast, is formulated for manifold-valued states, nonlinear dynamics, tangent-space Gaussian uncertainty, and inequality factors including distance-based CBF and velocity-extended vCBF terms [2510.04278]. The two approaches therefore address different structural regimes of MPC.

A plausible implication is that FactorMPC should be understood less as a replacement for Riccati methods in their native linear-quadratic domain than as an alternative sparse optimization framework for problems where geometry and safety constraints dominate the modeling requirements. The source material directly supports the claim that its key advantages arise from manifold consistency, modular factors, and sparse nonlinear optimization rather than from a condensed linear-quadratic factorization strategy [2510.04278].

Within that framing, FactorMPC is notable for connecting graphical-model methodology with safety-critical MPC. The paper explicitly describes the work as bridging graphical models with safety-critical MPC, and the resulting framework is characterized as scalable and geometrically consistent for integrated planning and control [2510.04278].

Source: https://www.emergentmind.com/topics/factormpc