Nonlinear Terminal Constraints Issue

Hi,

I’m having some difficulty with a parameterized nonlinear terminal constraint. I have pulled and installed the latest acados updates as of this morning, and for reference I’m working with a simple kinematic vehicle model driving around a track.

Here, xp, yp are my position state variables, and x_e, y_e are parameters I pass in for a target point ahead on the track. If I try to bound the euclidean distance to a small circle around that target point then the terminal solution is almost always outside the constraint. I have this set using:

ocp.model.con_h_expr_e = ( (xp - x_e) ** 2 + (yp - y_e) ** 2 ) ** 0.5
ocp.constraints.lh_e = np.array([0.])
ocp.constraints.uh_e = np.array([0.1])

It acts as though it is actually lower bounded by uh_e here, as the distance values are almost always greater than 0.1 (EDIT: occasionally I do see a value within the constraints though). I don’t have these set as soft constraints, so there should be no slack. I also saw these on the interfaces documentation that seem swapped:
image

image

Any ideas on what might be happening or what I’m doing wrong here?

Thanks,
Ben

Hi,

I fixed uh_e, lh_e error in the documentation, thanks for spotting.
In the code it should behave as expected…

About your problem:
Are you using SQP_RTI?
If so it would makes sense that your constraint is not satisfied.

Respectively, if you are using SQP, the solver should terminate with an error status.

Cheers,
Jonathan

Yes I am using SQP_RTI. Thanks for the reminder… I had forgotten aboutsome of the RTI scheme properties.
(And I was previously using an equality terminal constraint which did always seem to be satisfied, so was expecting the same after switching over to the inequality constraint.)

Thanks,
Ben