robotology-dependencies / qpoases Goto Github PK
View Code? Open in Web Editor NEWFork of the qpOASES to experiment with some improvements on the build system.
License: GNU Lesser General Public License v2.1
Fork of the qpOASES to experiment with some improvements on the build system.
License: GNU Lesser General Public License v2.1
As discussed with @traversaro, this repository should be moved to robotology-dependencies
cc-issue: robotology/robotology.github.io#2
See local fix #7 .
See the similar issue simbody/simbody#510 .
@francesco-romano I guess you are not planning to add cmake support for building other bindings, so I guess we can go on and submit our modification upstream (better rpath support and matlab bindings compiled in cmake) so we can drop this fork.
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:
min |u|^2
s.t. Au = 0
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:
ERROR: Division by zero
->ERROR: Abnormal termination due to TQ factorisation
->ERROR: Determination of step direction failed
->ERROR: Abnormal termination due to TQ factorisation
->ERROR: Initialisation failed! QP could not be solved!
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:
A = [ 0 0 0 1.0000 -0.0000 0.0000 0 0 0 0 0 0 0 0 0 0 0 -0.0000 1.0000 0.0003 -0.0000 0.0000 1.0000 0 0 0 0 0 0
0 0 0 -0.0000 1.0000 0.0000 0 0 0 0 0 0 0 0 0 0 0 -1.0000 -0.0000 0.0001 -1.0000 1.0000 -0.0000 0 0 0 0 0 0
0 0 0 0.0000 0.0000 1.0000 0 0 0 0 0 0 0 0 0 0 0 0.0001 -0.0003 1.0000 0.0001 -0.0001 -0.0000 0 0 0 0 0 0
0 0 0 1.0000 -0.0000 0.0000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 -0.0000 1.0000 0.0000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0.0000 0.0000 1.0000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ]
The matrix is full rank, as it is possible to see by looking at the singular values after SVD decomposition:
sigma = [ 2.0743
1.8478
1.6180
0.8350
0.7654
0.6180 ]
Also, relaxing the problem with inequality constraints of the form:
min |u|^2
s.t. -eps < Au < eps
eps >0
did not solve the issue. As an additional information, note that in case the problem is unfeasible the error from qpOASES is different.
The same problem reported in robotology/blockfactory#44 seems to be occuring also for this repo.
In the build system that we added to qpOASES in this fork, we are installing the qpOASES.m file, but this can create problems if the wrong directory is added to the matlab path, see robotology/whole-body-controllers#10 (comment) . We should investigate what is the proper way to process that qpOASES.m file.
I've encountered this problem calling qpOASES in Matlab2019a (Ubuntu 18.04).
The error message was:
Invalid MEX-file '~/robotology-superbuild/build/install/mex/qpOASES.mexa64': Gateway function is missing
@traversaro solved the problem commenting these lines:
set_target_properties(${${prefix}_NAME}
PROPERTIES
CXX_VISIBILITY_PRESET "hidden"
C_VISIBILITY_PRESET "hidden"
VISIBILITY_INLINES_HIDDEN "hidden"
)
in robotology-superbuild/external/qpOASES/cmake/FindMatlab.cmake
As the probability of the improvements in the CMake being merged upstream is really low, I think it would improve maintainability to strictly separate the raw files coming from the qpOASES tarball, and our own CMake files. In this way, updating to a new qpOASES should be simpler. One possibility is event to fetch the source code during the configuration phase using CMake's FetchContent module.
I think this projects would be a good example:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.