Hi,
I haven’t personally used the Python interface, but acados has multiple forms of constraint available. The ones you’re using are the simple state and input bounds, but you could also use the h(x,u)
(nonlinear inequality constraint). Note that, as I understand it, these are mutually exclusive, so if you do use h(x,u)
, you need to collate all your simple bounds in there as well, writing h
as one large vector-valued function.
(Side note: the problem formulation page has more details on this (types of constraints allowed, types of cost functions, etc.) if you’re interested.)
For this problem, you’ll want to set h(x,u)
as the CasADi expression, sqrt(qw**2 + qx**2 + qy**2 + qz**2)
, and then set the expression’s upper and lower bounds to 1.
You can also check out our recent discussion here about the practical difficulties of working with quats and the norm constraint: Implementing cost functions which are nonlinear in y_ref? - #7 by jcwj