-
Notifications
You must be signed in to change notification settings - Fork 18
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
Failure when two QP blocks - one with inequalities and the other not - are used in the same model #192
Comments
Thanks @gabrielenava for filling this issue. The qpOASES block has quite a convoluted logic for its port due to its high number of signal. Things are even more complicated since all its signals are dynamically sized. On the fly, I cannot explain why the blocks do not work if they are both enabled in the model. I suspect that a 1D signal is treated as a vector instead of a matrix with just one row (or the other way around). Can you please provide in all the combinations few screenshots with the signal dimensions displayed (you can find the right button in the menu)? As a reference, here below you can find the logic that defines input port dimensions: wb-toolbox/toolbox/library/src/QpOases.cpp Lines 145 to 203 in 0688771
|
Can you replace the all blocks from e.g. |
Mmh ok it was worth trying. Breaking down the error message, it seems that the stack trace is the following:
The origin of the error seems to be 1, somehow the call of |
Ok I'll try. I also noted one thing I believe is important: the error message is generated when processing |
Good catch, this was not clear. Can you check under the mask if the S-Function is properly connected in the block that fails with only 4 inputs? I suspect that there's something strange going on there. |
I printed a message to check the output of Here is the result: so it exits almost immediately after detecting a port with dimensions 0. If I comment out TEST QP3, the input ports are always either of dimension 1 or 2 (even if I don't know why the check is called so many times/ the simulation lasts 1 single step time): this is the result of pressing: |
@diegoferigo @gabrielenava , I was happy to find this issue. I ran into another use case which is also failing, in this model. The model is based on floating-base-balancing-torque-control, but the configuration of the QP blocks were the same: [H, g, A, ubA] inputs for both blocks. The issue disappeared after adding the input "lbA" to both blocks. Considering a similar issue found by @Giulero , it looks like the QP block is likely to fail if we use any but the following configurations:
So the QP block logic checking the ports dimensions doesn't handle well leaving holes in the port list, i.e. "skipping" ports, if a QP block with all the inputs H, g, A, lbA, ubA, lb, ub also exists. As per this hypothesis, the following will always work:
... and the following will fail, unless no fully activated QP block exists in the same model:
|
@diegoferigo , @traversaro, I hope you don't mind, I added this to the board of element software engineering (next sprint tag), just for tracking it closer. |
As long as you remember that this repo is public and all links to private repos cannot be reached by external users (like the element you linked above), is fine for me :)
I remember having quite a lot of problems with the signal dimensions, that required dirty workarounds like adding in the simulink side extra blocks that were forcing some of the output signals sizes match some of the inputs sizes. I don't have on the fly a working Matlab setup, but if you look under the mask of the block you will surely understand what I mean (if you can, please also attach a screenshot in this issue). That workaround was working fine in the Matlab version I had at that time, I won't be surprised if it does not work reliably on new versions. |
Description
When two QP blocks are added to the same Simulink model, and one of the two uses both input boundaries and inequality constraints while the other uses only input boundaries, the model exits with an error right after startup.
Platform
iRonCub controller, simple Simulink example (attached to this issue).
Reproducibility
Here is a simple Simulink model I created to reproduce the bug:
testQPblock.zip
Screenshots
Here is an overview of the simple Simulink model
Here is the error
the error does not appear if I run only 1 QP and I comment the other, or if I run QPTest 1 (unconstrained) and QPTest 3 or QPTest 1 and QPTest 2.
Additional information
The text was updated successfully, but these errors were encountered: