Defining constraint functions


I’ve been going thru several examples in the acados_matlab_octave folder. I noticed that in the race_cars example, the constraint a_lat is specifically defined as a Function. This is the first time I’ve seen this, when is a function required (constraints or other)?

I also get the following error running it:
Error using main (line 264)
acados returned status 4 in closed loop iteration 8. Exiting.

seems to not


do you mean this function?

This function is stored here only for convenience (in the main file it is later on used for plotting). In general, acados distinguishes between linear and nonlinear constraints, cf. the acados problem formulation.

So depending on your problem formulation you may formulate linear constraints – via the matrices C, D and corresponding lower and upper bounds – or nonlinear constraints – by providing a CasADi expression for h.