-
Notifications
You must be signed in to change notification settings - Fork 17
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
Set/expose qpOASES's setToReliable option? #202
Comments
This issue may be interesting for anyone using the WB-Toolbox for solving QP problems. |
From my side this sounds good. I'd recommend current users that have the qpOASES block in their Simulink Models to try this change. The modification should be straightforward as @traversaro pointed out: wb-toolbox/toolbox/library/src/QpOases.cpp Lines 320 to 322 in 99156c7
qpOASES::Options problemOptions;
problemOptions.setToReliable(); // < -- HERE
pImpl->sqProblem->setOptions(problemOptions); |
I think I forgot @CarlottaSartore @VenusPasandi @valentino-razza in this list, sorry for that. For avoiding that, let's tag @robotology/iit-dynamic-interaction-control : if anyone arrived here with this mention and never had to solve a Quadratic Programming problem in Simulink using WB-Toolbox's QpOases block, feel free to ignore this mention. If instead you are using that block and you are experiencing strange QP failures, this may be due to the options that we are using for the qpOASES solver, and fixing them may be relatively easy, just trying the modification suggested by @diegoferigo in #202 (comment) . Note that it probably still make sense to eventually investigate #180, but this modification of qpOASES is probably much faster (it can be done in ~10 minutes). |
I did a preliminary test switching to this option, everything compiled fine and the following is the output of the profiler: QP not failingIn this case the QP is not failing with As computational time, the difference seems to be small QP failingI tested also in a configuration where the QP was failing with |
Thanks @lrapetti ! What is the size of the QP problem in your case? For a problem that in the past we found that it was not working in qpOASES even if it was feasible, you can find it in the .mat file attached to the failing example in coin-or/qpOASES#85 (comment) . |
Hessian: 48x48 |
Cool, I think that is definitely is "big" w.r.t. to classical uses of the QpOases block in WB-Toolbox. At this point, if there is no particular performance problems, I think it make sense to enable the setReliable mode by default. |
Actually 152x48, but with half dummy lines 0≤0 |
I would remove those. It screws up the detection of the active contacts and the constraint matrix gets singular. |
sure, I was forced to do it in order to have fixed-size signals entering the block (alternative would be instantiating multiple QP blocks, but for the time being I was not experiencing particular problems with the dummy constraints).
Anyway, I know what I will say is a bit vague, but today I saw some "strange" and "jumpy" output from the QP when I will try to document more this observation repeating the same scenario, but I just want to say we probably should test further before enabling |
Thanks @lrapetti ! If you are able to log the time series of QP instances (i.e. cost matrices and constraint matrices) it would be useful also for testing them on OSQP. |
Side note: on this simulation with feet contact handling, having dummy lines with zeros was causing the QP to fail. For handling toggling contact constraints (feet touching or not the ground), I had to toggle the boundaries of the QP problem variable. |
This problem was not occurring with the OSQP (bindings). |
cc @CarlottaSartore another quick check that we could do is enable this option. @lrapetti do you happen to still have around the branch with the option changed? |
No, but it was set just by adding one line as @diegoferigo was pointing above (#202 (comment)) |
Today, I have tried again to set that option (moving to the branch in #208) on a "stable" simulink model, and I didn't encounter any problem. In particular, I have tested again a "big" model with 3 qpOASES blocks (two solving the same problem, and one solving a larger problem), and there seems to be no computational time increase (it is actually taking less time on DefaultReliable |
Summary
The qpOASES QP solver with default options sometimes mark as unfeasible problems that are feasible, see coin-or/qpOASES#85 . However, from coin-or/qpOASES#85 (comment) and https://raw.githubusercontent.com/coin-or/qpOASES/master/doc/manual.pdf page 30, it seems that there is a
setToReliable
option that should make the QP solver more reliable and the expense of computational speed.Motivation
If this option is present, could it make sense to set them in https://github.com/robotology/wb-toolbox/blob/master/toolbox/library/src/QpOases.cpp#L320 or expose them?
Additional context
Related issues:
The text was updated successfully, but these errors were encountered: