Closed cmower closed 1 year ago
I can't re-create what ever the problem was and OSQPSolver seems to produce expected solutions. Closing, but will reopen if the problem comes up again.
There seems to be an issue in the OSQP interface. See the example in optas_ros, here. When using OSQP, the controller does something quite weird.
The issue seems to be in the constraint specification, i.e. how constraints were passed from OpTaS to OSQP. OpTaS represents linear constraints as follows:
k = Mx + c >= 0
a = Ax + b == 0
whereas OSQP represents linear constraints using:
l <= Qx <= u
Note, in the OSQP documentation they use A
instead of Q
here - I change it here so it doesn't conflict with the A
in the OpTaS constraint notation above.
The equivalence between these constraints is as follows:
[ M ]
Q = [ A ]
[ -A ]
[ -c ]
l = [ -b ]
[ b ]
u = infty
However, before the fix, the constraints were being passed as
Q = [ M ]
[ A ]
l = [ -c ]
[ -b ]
u = infty
which is clearly incorrect. Only part of the equality constraints were specified.
I think we can now consider this issue resolved.
Some solutions for a QP problem are perfectly fine using CasADiSovler with IPOPT, but the solutions using OSQPSolver are wrong.