- The paper introduces RK-MPC, a novel framework that integrates a physics-based template with a data-driven residual model to enhance quadruped locomotion.
- It employs Extended Dynamic Mode Decomposition with Control to learn compact residual dynamics, resulting in lower prediction errors and stable closed-loop performance.
- Validated in simulation and hardware tests, the method demonstrates real-time feasibility and improved resilience against terrain-induced disturbances.
Residual Koopman Model Predictive Control for Quadruped Locomotion in Offroad Environments
Introduction and Motivation
The paper presents Residual Koopman Model Predictive Control (RK-MPC), a rigorous data-driven predictive control framework tailored for quadruped locomotion in offroad, contact-rich environments. RK-MPC leverages Koopman operator theory to blend the advantages of physically consistent template models with sample-efficient, lifted residual dynamics, addressing the longstanding conflict between model fidelity and real-time tractability in convex MPC for legged robots.
Classical physics-based MPC approaches maintain robust constraint handling but degrade when exposed to unmodeled terrain interactions, compliance, and contact uncertainty due to their reliance on limited-fidelity models. Conversely, end-to-end learning approaches (e.g., deep reinforcement learning) can adapt to complex environments but lack the predictive, constraint-aware structure and require extensive data, while learning-based model augmentation (e.g., Gaussian process or neural net residuals) is often brittle and computationally costly in legged systems. Koopman operator theory offers a linear embedding of nonlinear dynamics within infinite-dimensional observable spaces, enabling data-driven construction of convex predictive models suitable for MPC; however, its application to legged locomotion is hampered by the curse of dimensionality, dictionary selection, and lack of guarantees for rotation consistency and multi-step error control.
Residual Koopman Modeling Framework
RK-MPC addresses the shortcomings of fully lifted Koopman modeling by introducing a residual architecture. Rather than replacing the nominal template (a linearized single rigid-body (SRB) model), the framework learns a compact deterministic linear predictor for the modeling error—i.e., the residual between measured state evolution and the nominal SRB prediction—using Extended Dynamic Mode Decomposition with Control (EDMDc) in the space of lifted residual observables.
Figure 1: The SRB template captures dominant quadruped centroidal dynamics via net ground reaction forces; residuals model unmodeled effects due to terrain and contact variability.
Figure 2: The residual Koopman framework augments nominal model predictions with a data-driven correction in the lifted observable space.
By focusing learning on the centroidal twist residuals, the approach maintains interpretability (model corrections are explicit and compact), reduces dictionary size, and mitigates the risk of unbounded error propagation that plagues direct full-state lifting. Theoretical guarantees are provided: under mild Lipschitz continuity and bounded residual approximation conditions (Theorem 1), the multi-step state prediction error grows at most exponentially with horizon and residual model error, a property not shared by generic monomial EDMD approaches.
RK-MPC Control Stack and Hierarchical Execution
RK-MPC is embedded within a structured, computationally efficient hierarchical stack. High-level velocity commands are mapped to joint torques and positions via a global planner, finite-state machine for gait and contact scheduling, footstep planner, and joint-level controllers.
Figure 3: The RK-MPC locomotion stack translates high-level commands through hierarchical modules down to stance foot GRFs, tractable convex optimization, and onboard execution.
Residual Koopman learning is incorporated by propagating both nominal SRB and lifted residual states across the prediction horizon within the convex QP formulation, with planner-supplied contacts and exogenous scheduling. The structure ensures compatibility with standard friction and unilateral contact constraints through per-foot GRF decision variables, a necessity for physical deployability.
Dataset Generation and Model Identification
RK-MPC residual models are learned offline using a broad dataset collected in simulation (Gazebo), spanning randomized terrain geometries, friction coefficients, and diverse velocity/gait references to robustly excite the relevant state space.
Figure 4: Training data spans randomized base velocities, terrain friction values, and gait sequences to maximize coverage of physically relevant local dynamics.
Residuals are calculated between measured and nominally predicted centroidal states, lifted via a low-degree polynomial (monomial) dictionary, and fit using ridge-regularized least squares. Notably, sample efficiency analysis indicates that reliable residual models are achievable with modest data volumes (1k–10k transitions), in strong contrast to deep neural approaches or full-state polynomial lifts.
Extensive comparisons are performed between the proposed residual Koopman model, the baseline nonlinear SRB, high-degree polynomial EDMD, and SE(3)-aware lifting (EDMD–SE(3)). The residual Koopman predictor displays:
- Substantially lower prediction RMSE across all twist channels compared to monomial EDMD, which diverges rapidly in open-loop rollouts due to the lack of physical structure and poor extrapolation properties
- Attitude consistency superior to EDMD–SE(3), which is susceptible to rotation drift and geodesic error accumulation due to the lack of SO(3) constraint enforcement in the lifted state propagation
- Robust behavior under varying amounts of training data and polynomial degree, benefiting from low-dimensional lifting and an explicit physics-based template
Figure 5: Residual Koopman prediction outperforms full EDMD baselines and nonlinear SRB—demonstrated in trajectory tracking, per-channel RMSE, SO(3) geodesic error, sample-efficiency, and degree sweeps.
RK-MPC Simulation and Benchmarking
In closed-loop Gazebo evaluation, RK-MPC consistently achieves reliable long-horizon tracking (over 10 laps) of highly curved velocity references, matching or exceeding nonlinear SRB-MPC baseline accuracy while requiring only convex QP solves (sub-ms median solution times).
Figure 6: RK-MPC demonstrates superior tracking fidelity, attitude stability, and solution time compared to both nonlinear SRB-MPC and SE(3)-KMPC baselines.
When compared to SE(3)-KMPC, RK-MPC avoids the latter's instability—caused by internal rotation drift in the lifted state—which leads to rapid simulation failure. Using the corrected prediction reduces tracking RMSE in both linear and angular channels and ensures the feasibility and real-time capability of the closed-loop invocation.
Hardware Validation: Robustness, Gait, and Environmental Generalization
The RK-MPC stack is deployed in real time (500 Hz) on Unitree Go1 hardware, evaluated under a diverse suite of conditions—randomized and smooth planar velocity tracking, debris traversal, push recovery, multi-gait schedules, and challenging unstructured outdoor terrains (ice, snow, grass, gravel):
Figure 7: Onboard RK-MPC tracks randomized and smooth planar velocity commands; measured and commanded trajectories remain highly aligned.
Figure 8: Debris traversal and push recovery trials show resilient, rebounding attitude and velocity performance in the face of substantial disturbances.
Figure 9: A residual Koopman model trained on trot data generalizes successfully to crawl gait, tracking stance phases and force allocation consistently.
Figure 10: RK-MPC enables blind locomotion on diverse off-road terrains, gracefully handling slippage (ice), high compliance (grass), and consistent tracking on snow and gravel.
Across all settings, RK-MPC maintains stable, accurate walking without recourse to exteroceptive sensing, leveraging the inherently interpretable, compact residual corrections for terrain adaptation and disturbance rejection.
Theoretical and Practical Implications
RK-MPC offers a structured, hardware-validated pathway for merging first-principles template modeling and sample-efficient data-driven correction in contact-rich, high-DOF robotic systems. Theoretical analysis establishes provable multi-step error bounds for the residual approach that are not attainable with naive full-state lifting. Practically, RK-MPC runs at high rates on embedded platforms, ensuring its viability for field deployment on quadrupeds.
The method provides robustness against dictionary selection and mitigates SO(3) drift by segregating the learning task to the physically meaningful error channels rather than the complete configuration space. Its adoption enables extensibility towards robust and adaptive variants, e.g., online residual updates, incremental adaptation, and constraint-tightened tube-MPC via uncertainty propagation in the residual lift.
Future Directions
Immediate avenues include online adaptive refinement of the residual model for handling actuator aging, payload shifts, and terrain adaptation, as well as robust MPC schemes integrating set-based guarantees against bounded residual uncertainty. The RK-MPC paradigm is amenable to hierarchical deployment with perception modules (e.g., terrain classifier-aided adaptive parameterization) and transfer to other morphological platforms, e.g., bipedal and soft robots, with suitable template and dictionary adaptation.
Conclusion
Residual Koopman MPC represents a principled and practically validated advance in data-driven predictive control for quadruped locomotion. By augmenting physically derived template models with structured, lifted corrective predictions, RK-MPC achieves the dual objectives of robustness to unmodeled environmental variations and real-time feasibility required for off-road deployment. The methodology offers a compelling architecture for unifying model-based and learning-based control in advanced robotic locomotion.