But once the control allocation part is involved, the solver (HPIPM) returns NaN immediately, even if the allocated thrust constraints are not violated as shown above in thrust.png.
I sincerely look forward to your suggestions. Thank you for reading and have a good day~
I think the term allocation is used in a confusing way in your post.
I changed the title of this thread to
“OCP solver fails after adding nonlinear constraint”
You will need to initialize the solver explicitly, for this problem formulation.
The default initialization is zeros, and an sqrt() constraint can not be linearized at 0.
Thank you for pointing out the problem here. I tried with a nonlinear constraint without sqrt() and it worked without initializing the solver explicitly.