GepocUS / Spcies

Suite of Predictive Controllers for Industrial Embedded Systems. A Matlab toolbox for automatic code generation of solvers for MPC controllers.
Apache License 2.0
14 stars 2 forks source link

Compilation error if dimensions of state or inputs are one #15

Closed pablokrupa closed 3 years ago

pablokrupa commented 3 years ago

This error in general happens if the dimension of a variable that should be defined as an array is 1. In this case, the decVar functions declare a scalar, which results in a compilation error when due to it being accessed as an array in the code (i.e., with [i]).

This is a problem because it means that the toolbox does not currently work for SISO systems, nor for systems with a single inputs.

To solver this, we need to rethink how variables are declared. In particular, which should be the fields of the dictionary passed to the decVar function. And if they should be so restricted to only having 5 fields, as is currently the case.

pablokrupa commented 3 years ago

This issue was fixed in 92f5f9b4f321912eb0afe1439d101f998dfcf8ad. I will close the issue once these changes have been merged into the main branch.

pablokrupa commented 3 years ago

This issue is now fixed in the master branch.