We are using acados to generate OCPs where we need fairly large tables as part of the problem formulation. We also require the ability to parameterize the OCP with the table data, but here we run into some rather annoying limitations.
In casadi we can represent the table data as a spline, either using the interpolant function or the Bspline function directly.
The interpolant function automatically calculates the BSpline coefficients from the table data but as our tables have mutliple dimensions and are quite large this can take several minutes. We can specify this function with the table data being MX symbols and parameterize the OCP in the standard acados manner. Unfortunately acados assumes that the whole parameter vector can change for each OCP solve and the spline fitting is therefore performed at each time-step. This method is therefore not suitable for a real-time implementation.
Using the bspline function in casadi we can specify the spline coefficients directly, but this casadi function does not support that the coefficients are MX symbols and as a result we cannot parameterize the OCP using pre-computed coefficients.
We are therefore looking into two different solution.
- An alternative Bspline implementation where we can specify the coefficients as MX parameters
- Some way of specifying parameters which cannot change once the OCP has been initialized. In this way we could perform the spline fitting only once when the OCP is first initialized.
Does anyone have experience solving a similar problem or maybe some idea on how we most efficiently can solve this problem?