Possible Error for cost_z_e in ocp_create.c

Hey guys,

I was generating C code for a MPC which should run on a dSPACE Scalexio RT system. I am using matlab.
I got the error using ocp_create: error setting cost_z_e, wrong dimension.
after looking into the ocp_create.c file, I saw that the dimension being compared to is ns. This seemd wrong to me, since it is cost_z_e not cost_z, etc. after changing this to ns_e, everything worked fine.

The same error ocurred for cost_zl_e and cost_zu_e , changed these as well (lines 1406 and 1421).

Did I do a mistake before with the dimensions or how is this supposed to be?

greets, thanks for your work,
Alex

Hi Alex,

indeed these dimension checks were wrong.
Thanks for reporting!
I just pushed the fix you suggested.


If you want to suggest another fix, please feel encouraged to submit a pull request yourself!

Best,
Jonathan

a good feeling to help a tiny bit. :slight_smile:

I will have a look, I am just getting used to github and open source developement.

greets

1 Like