This repository contains the code accompanying our recent ICRA paper: Data-Driven Spectral Submanifold Reduction for Nonlinear Optimal Control of High-Dimensional Robots. We learn low-dimensional, faithful control dynamics of high degree-of-freedom (DOF) mechanical systems on attracting, invariant manifolds called Spectral Submanifolds 1. This work extends recent work on learning autonomous dynamics of nonlinearizable systems to the control setting.2
- SSMLearn: Repo has a stand-alone version installed in
ext/
folder. This could potentially be deprecated, so we recommend users to install the latest version. - Soft Robot Control: Required to generate data from SOFA simulation of soft robots.
- To get started, in Matlab run
install.m
. - Go to the
ROM/
folder and rungenerateSSMmodel.mlx
to generate a discrete and continuous-time SSMRc model based on our datasetdataDecayObs
, which can be downloaded here. - The generated model must then be imported into the
examples/hardware/SSMmodels
folder of thesoft-robot-control
repo. Follow the instructions on the corresponding repo to run the controller.
- To parameterize the autonomous manifold, we must first collect
decaying
data trajectories from either a simulation environment (e.g., SOFA for soft robot applications) or from hardware experiments.- To use the
consolidateSSMTrainData.m
function (which consolidates the individual training data into appropriate matlab cell format), the individual training data must be saved as.mat
files. Seehw_train.mlx
for working example.
- To use the
- Once the individual raw trajectory files are consolidated into the appropriate cell format (i.e., cell column 1 := time, cell column 2 := decay trajectory), the transients from the dataset is truncated to ensure the training trajectories are near the invariant manifold. See
ROM/generateSSMmodel.mlx
,ROM/mainObsCDS.mlx
, orROM/mainObsDDS.mlx
for an example.- Discrete-time model:
ROM/mainObsCDS.mlx
- Continuous-time model:
ROM/mainObsDDS.mlx
- Both:
ROM/generateSSMmodel.mlx
- Discrete-time model:
- Below is a visual depiction of this process on our soft robot example.
- Examples for learning the autonomous dynamics is located in
ROM/generateSSMmodel.mlx
,ROM/mainObsCDS.mlx
, orROM/mainObsDDS.mlx
. - PCA is used to approximate the spectral subspace and determines the dimension of the invariant manifold.
- The polynomial order of the approximation is chosen as a hyperparameter as a tradeoff to increase the accuracy of the parameterization and mitigate overfitting.
- To learn the effect of actuation, we must correlate the effect of actuation on the reduced dynamics. Thus, we must collect state transition data under the influence of control inputs as shown in the figure above. Again, this can be collected from either a simulator or experiments.
- Code for regressing the reduced order actuation matrix is located in
ROM/generateSSMmodel.mlx
.
Footnotes
-
Haller, George, and Sten Ponsioen. "Nonlinear normal modes and spectral submanifolds: existence, uniqueness and use in model reduction." Nonlinear dynamics 86.3 (2016): 1493-1534. ↩
-
Cenedese, Mattia, et al. "Data-driven modeling and prediction of non-linearizable dynamics via spectral submanifolds." Nature communications 13.1 (2022): 1-13. ↩