Any ideas what has changed in ocp_set and could result in a segfault?
There are no additional error messages in Matlab or on the console. The violation only occurs when I use the Template-Solver for Matlab, it works with the normal Matlab-Interface. But since I use the Template-Solver in a C++ application I also need to test it in Matlab.
thanks for reporting this!
Actually nothing changed in the ocp_set function between the latest acados version and 0.1.4.
However, there were a few changes in the template based interface.
It might be that something needs to be adapted for the interaction of the templated solver with Matlab.
Just to check:
Did you remove the Matlab build folder in your Matlab example folder?
If so:
In which call to ocp_set does this happen?
which field are you passing?
If you can share the code to reproduce the error with me that might be the easiest.
it is now clear to me what the issue is.
It was introduced here, when adding the option to have a separate cost term at the initial stage: https://github.com/acados/acados/pull/684
This will make the solver crash with ocp.set('p', p, N-1);
if a cost module other than linear least squares are used.
I thought about that again, and there was a relatively easy fix.
Can you test your code with the branch corresponding to this PR? https://github.com/acados/acados/pull/700