Closed Veng97 closed 1 year ago
Hello @Veng97 and happy new year, sorry but I just saw your request! However, this is something that is currently not available, but for further expansion, it could be possible to provide the index of the current horizon step as a parameter of the function handle.
In this way, you can refer to any disturbance or parameter needed. IMO with respect to the LMPC in this case we don't need to clearly defined disturbances, references, parameters etc. I would say, it's something that must be delegated to the implementation of the lambdas.
Something like that:
auto stateEq = [&](
mpc::cvec<TVAR(num_states)>& dx,
mpc::cvec<TVAR(num_states)> x,
mpc::cvec<TVAR(num_inputs)> u, size_t p) {
dx(0) = ((1.0 - (x(1) * x(1))) * x(0)) - x(1) + u(0);
dx(1) = x(0);
};
where p is the horizon step.
The solution mentioned above will be available in the next release, cheers!
See release 0.2.0
For my task i need to be able to specify online parameters in some way within the model itself. Specifically i need the ability to set the curvature for a cross-track-error model. This requires adding an additional horizon variable, e.g:
The new variable, v, can be used for online parameter settings along the entire prediction horizon. This would also allow updating parameters with online estimates of disturbances or model parameters.