Table of Contents
Fetching ...

L4acados: Learning-based models for acados, applied to Gaussian process-based predictive control

Amon Lahr, Joshua Näf, Kim P. Wabersich, Jonathan Frey, Pascal Siehl, Andrea Carron, Moritz Diehl, Melanie N. Zeilinger

TL;DR

L4acados provides a pragmatic pathway to integrate learning-based dynamics into real-time MPC by supplying external sensitivities to the acados solver, enabling scalable, RTI-compatible optimization with learning residuals. The framework demonstrates substantial speedups vs CasADi-based approaches and extends GP-MPC via zoRO to real-time hardware, including miniature racing and a full-scale vehicle. The combination of batched Python sensitivities, RTI compatibility, and modular GP handling yields a practical toolkit for uncertainty-aware, learning-enhanced control in automotive and robotic applications. Overall, the work advances real-time, learning-enabled MPC by bridging ML models with embedded optimal control software and validating on tangible hardware.

Abstract

Incorporating learning-based models, such as artificial neural networks or Gaussian processes, into model predictive control (MPC) strategies can significantly improve control performance and online adaptation capabilities for real-world applications. Still, enabling state-of-the-art implementations of learning-based models for MPC is complicated by the challenge of interfacing machine learning frameworks with real-time optimal control software. This work aims at filling this gap by incorporating external sensitivities in sequential quadratic programming solvers for nonlinear optimal control. To this end, we provide L4acados, a general framework for incorporating Python-based dynamics models in the real-time optimal control software acados. By computing external sensitivities via a user-defined Python module, L4acados enables the implementation of MPC controllers with learning-based residual models in acados, while supporting parallelization of sensitivity computations when preparing the quadratic subproblems. We demonstrate significant speed-ups and superior scaling properties of L4acados compared to available software using a neural-network-based control example. Last, we provide an efficient and modular real-time implementation of Gaussian process-based MPC using L4acados, which is applied to two hardware examples: autonomous miniature racing, as well as motion control of a full-scale autonomous vehicle for an ISO lane change maneuver.

L4acados: Learning-based models for acados, applied to Gaussian process-based predictive control

TL;DR

L4acados provides a pragmatic pathway to integrate learning-based dynamics into real-time MPC by supplying external sensitivities to the acados solver, enabling scalable, RTI-compatible optimization with learning residuals. The framework demonstrates substantial speedups vs CasADi-based approaches and extends GP-MPC via zoRO to real-time hardware, including miniature racing and a full-scale vehicle. The combination of batched Python sensitivities, RTI compatibility, and modular GP handling yields a practical toolkit for uncertainty-aware, learning-enhanced control in automotive and robotic applications. Overall, the work advances real-time, learning-enabled MPC by bridging ML models with embedded optimal control software and validating on tangible hardware.

Abstract

Incorporating learning-based models, such as artificial neural networks or Gaussian processes, into model predictive control (MPC) strategies can significantly improve control performance and online adaptation capabilities for real-world applications. Still, enabling state-of-the-art implementations of learning-based models for MPC is complicated by the challenge of interfacing machine learning frameworks with real-time optimal control software. This work aims at filling this gap by incorporating external sensitivities in sequential quadratic programming solvers for nonlinear optimal control. To this end, we provide L4acados, a general framework for incorporating Python-based dynamics models in the real-time optimal control software acados. By computing external sensitivities via a user-defined Python module, L4acados enables the implementation of MPC controllers with learning-based residual models in acados, while supporting parallelization of sensitivity computations when preparing the quadratic subproblems. We demonstrate significant speed-ups and superior scaling properties of L4acados compared to available software using a neural-network-based control example. Last, we provide an efficient and modular real-time implementation of Gaussian process-based MPC using L4acados, which is applied to two hardware examples: autonomous miniature racing, as well as motion control of a full-scale autonomous vehicle for an ISO lane change maneuver.

Paper Structure

This paper contains 28 sections, 32 equations, 7 figures, 2 tables.

Figures (7)

  • Figure 1: Real-time Gaussian process-based MPC (GP-MPC) implementation with L4acados applied to autonomous miniature racing; uncertainty-aware predictions of the open-loop state trajectory are shown in red. L4acados enables efficient and parallelized external sensitivity computations of general learning-based dynamics models. The modular and open-source GP-MPC implementation supports arbitrary GPyTorch GP models, fast covariance propagation, and various data processing strategies for online learning.
  • Figure 2: Flow diagram of SQP iterations in L4acados. By using the acados Python interface to get/set the model sensitivities in each SQP iteration, L4acados enables learning-based models for real-time optimal control with acados.
  • Figure 3: Comparison of computation times for sensitivity evaluation for neural-network residual models between L4acados and acados with L4CasADi or CasADi (NaiveL4CasADi). Already for small horizon lengths and moderate learning-based-model complexities, L4acados shows considerable speedups compared with using acados with L4CasADi or CasADi.
  • Figure 4: Hardware platforms. Using L4acados, the zoGPMPC method is deployed on (a) a 1:24 miniature race car (\ref{['sec:GPMPC_CRS']}) and (b) a full-scale test vehicle (\ref{['sec:GPMPC_Bosch']}).
  • Figure 5: Distance between miniature race car and centerline in closed-loop simulations. Augmented with real-world data, the uncertainty-aware GP model reduces conservatism to cautiously improve driving performance.
  • ...and 2 more figures