Changing MPC parameters after using code generation #594
-
Hi. Using the Python mpc example I was able to generate a C code using code generator. After compile the source code, it generates an executable. How can I modify the example, in C code, in a way I can be able to modify the initial condition of the MPC? And how can I print the actions of the controller? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You can look at the documentation for the C interface for the functions that are available: https://osqp.org/docs/release-0.6.3/interfaces/C.html#c-interface. In general, for embedded code the functions you'll probably use the most would be:
|
Beta Was this translation helpful? Give feedback.
You can look at the documentation for the C interface for the functions that are available: https://osqp.org/docs/release-0.6.3/interfaces/C.html#c-interface.
In general, for embedded code the functions you'll probably use the most would be:
osqp_warm_start*
- Change where the initial point the solver starts from on the next runosqp_update_*
- Update various parts of the problem (e.g. lower/upper bounds, linear portion of the cost, etc.)osqp_update_P/osqp_update_A
- Update the matrices (only available if you enable embedded mode 2, matrix update)osqp_update_rho
- Change the rho parameter (only available if you enable embedded mode 2, matrix update)If you want to change the settings, …