GaPT: Gaussian Process Toolkit for Online Regression with Application to Learning Quadrotor Dynamics

Francesco Crocetti, Jeffrey Mao, Alessandro Saviolo, Gabriele Costante, Giuseppe Loianno

Gaussian Processes (GPs) are highly valued in robotics for their ability to provide both predictions and principled uncertainty estimates. However, their practical application in real-time systems has been historically limited by a cubic computational complexity ($O(n^3)$) relative to the number of data points. As a robot collects more data to improve its model, the computational burden eventually exceeds the real-time constraints of the system. This paper introduces the Gaussian Process Toolkit (GaPT), a framework designed to overcome this "computational wall" by reformulating GPs into a linear state-space form, enabling $O(n)$ inference.

The Challenge of Real-Time Regression

For autonomous systems like quadrotors, learning "residual dynamics"—the complex aerodynamic effects not captured by first-principles physics models—is crucial for high-performance flight. While GPs are ideal for this task, the $O(n^3)$ scaling of standard GP inference means that a drone's onboard computer quickly becomes overwhelmed as the dataset grows. Existing approximations often sacrifice data or are difficult to implement in the high-performance C++ environments required for flight control. GaPT addresses these issues to make GPs practical for Size, Weight, and Power (SWaP) constrained aerial robots.

Methodology: From Kernels to State-Space

The core innovation of GaPT is the systematic conversion of stationary GP kernels into a Linear State Space Model (LSSM). This conversion allows the system to treat the GP as a sequential "trend of motion" rather than a global correlation between all points. The process involves four key steps:

  1. Spectral Decomposition: Utilizing Bochner’s Theorem to represent stationary kernels (like RBF, Matern, or Periodic) in the frequency domain as spectral densities.
  2. SDE Approximation: Approximating these densities using Taylor series expansions to form a Stochastic Differential Equation (SDE).
  3. State-Space Realization: Converting the SDE into a state-space form defined by matrices A, H, and L.
  4. Sequential Inference: Implementing a Kalman Filter-like approach to process data points sequentially. This reduces complexity from $O(n^3)$ to $O(n)$, allowing for real-time execution.

The toolkit is designed for a seamless robotics workflow: users can train hyperparameters in Python and then export the resulting model as a standalone C++ function that can be dropped directly into existing optimization and control loops.

Experimental Evaluation

The authors evaluated GaPT using a real-world dataset of quadrotor dynamics featuring unfiltered, noisy data from agile maneuvers. The training was conducted on a circular flight path, while validation was performed on parabolic and Lemniscate (figure-eight) trajectories to test generalization.

Key Results: * Massive Speedup: For a dataset of 6,000 points, GaPT performed inference in 4.54 ms, compared to 167.43 ms for GPyTorch. This 37x improvement makes real-time execution on embedded hardware feasible. * Linear Scaling: While standard GP inference time explodes as data points increase, GaPT’s computation time remains nearly linear. * Accuracy: In the "Extended Lemniscate" validation test, the Multiple-Input Single-Output (MISO) GaPT achieved a Root Mean Square Error (RMSE) of 0.3176, significantly better than the standard GP's 0.4698.

Insights and Future Work

Interestingly, the state-space approximation (SSGP) often outperformed the "exact" GP on validation sets. The authors suggest that the state-space structure induces a prior that focuses on the data trend, helping the model ignore noise that might cause a standard GP to overfit. Furthermore, GaPT’s MISO capability allows it to capture high-frequency aerodynamic effects, such as rotor-to-rotor interactions, by including motor speeds as inputs.

While currently limited to stationary kernels, future work will explore non-stationary kernels, "Deep State-Space Models," and the integration of GaPT into Model Predictive Control (MPC) for more aggressive autonomous maneuvers.

Summary updated

BibTeX
@inproceedings{crocetti2023gapt,
  author = {Francesco Crocetti and Jeffrey Mao and Alessandro Saviolo and Gabriele Costante and Giuseppe Loianno},
  title = {{GaPT: Gaussian Process Toolkit for Online Regression with Application to Learning Quadrotor Dynamics}},
  booktitle = {IEEE International Conference on Robotics and Automation},
  year = {2023},
  url = {https://openreview.net/forum?id=vzY2ohonoG},
}
Figure