-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible bug in qpOASES when using equality constraints #4
Comments
The first step I would consider is to update the qpOASES version, as we are currently an outdated fork : #1 . |
It is worth to check the commit history of qpOASES: |
It is also worth checking directly the code: Line 4592 in 6fd1bfa
|
We took a look at the code, and apparently that error is thrown when at least one element of the anti diagonal of a so-called matrix TT is in modulus less than a tolerance. We dig a big further to understand what TT is, and apparently it is macro with which they access a vector called T (apparently it is the row wise vectorisation of TT). We weren't able to discern how T was filled. |
To update qpOASES, you just need to get the latest version from https://projects.coin-or.org/qpOASES/wiki/QpoasesDownload and extract it in the repo, with the exception of the CMake files. As you may notice by this comparison: |
Yes, let's try to update qpOASES anyways. Just as a curiosity: did you try to approximate the matrix |
From the last part of the original issue, it seems that the answer to this question is yes, and it not solved the problem. |
This problem could be related : https://projects.coin-or.org/qpOASES/ticket/69 . |
I'm trying to update qpOASES. I downloaded the latest version from here. I modified/added the configuration files according to 6fa1e4f...master. I did only one modification with respect to our branch. In the CMakeLists.txt, I selected the package version 3.2.0. I'll test the new qpOASES now. |
Related PR: #5 |
I completed the update. On matlab, this is the mex file I'm reading: in the install folder, the mex files have the number However, the bug is still there. It is sufficient to run the test above: We can anyway update, but this didn't solve the issue. |
Yes, let's proceed with the update anyway. |
It we understood that this is a problem in qpOASES, the first step would be to open a ticket in qpOASES bug tracker: https://projects.coin-or.org/qpOASES/report . |
@gabrielenava @S-Dafarra |
Not yet. I can take care of this the next week. |
Error reported: see https://projects.coin-or.org/qpOASES/ticket/85 |
Six months passed, and it doesn't seem to me they replied to the issue I opened. |
Indeed, if the upstream does not solve the problem, we are not able to solve it either and there are better alternatives (OSQP?) we should simply stop using qpOASES and start using only OSQP. cc @diegoferigo @kourosh @gabrielenava @S-Dafarra @GiulioRomualdi |
Adding the support of OSQP into wb-toolbox is quite easy, and it can be done in more or less one day even from someone not familiar with the toolbox. The block specifications (inputs / outputs) and the mask can be taken 1:1 from QpOases. Then, substituting QpOasis methods with those of OSQP should do the job. |
Sometimes osqp generates a solution that is outside the boundary. I've noticed this behaviour when the problem is ill conditioned. @MiladShafiee |
Thanks a lot, this seems to be a bug in OSQP. If we have the specific instance, we can report the problem to OSQP developers. |
Yes, in this case qpOASES found the solution without problem |
Do we have instances of the optimization problems, so that we can submit them to OSQP? |
As I remember during debugging the code, we reached to certain point that we assured that code is correct but osqp gave us some solutions that weren’t inside the feasible area and we were looking for some bugs and when we changed the solver the problem solved! We should try it again with osqp to see now it reproduces that bug or no! Because we changed it a lot after that point! |
@diegoferigo @GiulioRomualdi @MiladShafiee for future discussions of problems or features of OSQP w.r.t. to all our repo, feel free to move the discussion to robotology/robotology-superbuild#239, that is more related to this issue, where this issue is dealing with the specific problem in qpOASES described in https://projects.coin-or.org/qpOASES/ticket/85 . |
The qpOASES issue tracker has been moved to GitHub, and now the issue is tracked in coin-or/qpOASES#85 . |
It is possible that this problem can be solved by simply changing the option with which we call qpOASES, see coin-or/qpOASES#85 and robotology/wb-toolbox#202 . However, as the issue is tracked in coin-or/qpOASES#85 I think we can close the issue. |
It seems there is a bug inside the qpOASES algorithm when performing a constrained optimization with equality constraints. In particular, consider the following optimization problem:
where u is a [29 * 1] vector and A is a [6 * 29] matrix with rank 6. In theory, this problem is well posed and the solution is u = 0.
However, for some valid constraint matrices A qpOASES cannot find a solution, and returns the following error:
Attached to this script there is a matlab code with an example. The constraint matrix is stored in a .mat file (attached to the issue, too) and is of the form:
The matrix is full rank, as it is possible to see by looking at the singular values after SVD decomposition:
Also, relaxing the problem with inequality constraints of the form:
did not solve the issue. As an additional information, note that in case the problem is unfeasible the error from qpOASES is different.
testQPOASES.zip
The text was updated successfully, but these errors were encountered: