-
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
Align WBT and BlockFactory #168
Align WBT and BlockFactory #168
Conversation
c79004b
to
1585307
Compare
toolbox/library/CMakeLists.txt
Outdated
LIST_PREFIX WBT | ||
SOURCES src/QpOases.cpp | ||
HEADERS include/WBToolbox/Block/QpOases.h) | ||
if(${qpOASES_FOUND}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this change, qpOASES blocks are compiled even if WBT_USES_QPOASES
is not enabled. I am afraid this may be confusing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want this to be the behaviour (not a big fan of it to be honest), problably it would make sense to just remove those variables then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mmh I didn't realized I used the _FOUND
here, my mistake. If you see in the bottom of this file, the WBT_USES_
variables are used again. Thanks!
toolbox/library/CMakeLists.txt
Outdated
# Other | ||
list(APPEND WBT_BLOCKS "RealTimeSynchronizer") | ||
|
||
if(${ICUB_FOUND}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
blockInfo->getOutputPortMatrixSize(OutputIndex::Jacobian).first, | ||
blockInfo->getOutputPortMatrixSize(OutputIndex::Jacobian).second); | ||
blockInfo->getOutputPortMatrixSize(OutputIndex::Jacobian).rows, | ||
blockInfo->getOutputPortMatrixSize(OutputIndex::Jacobian).cols); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was really necessary! I regretted using pairs
and tuples
in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments on the WBT_USES_**
options
Due to the change of the installed library name due to the usage of CMake utilities provided by BlockFactory.
After robotology/blockfactory#33 some datatypes and interface methods changed
1585307
to
99fc2c3
Compare
Done. For what concern the temporary CI fix, I would keep it in this PR, regenerate the docker images after merging, and then revert the commit. |
@@ -5837,14 +5837,14 @@ Library { | |||
} | |||
Block { | |||
BlockType S-Function | |||
Name "Yarp Read" | |||
Name "YarpRead" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even if WB-Toolbox will always ship the manually written .slx
/.mdl
, I think this space removal is good for eventual consistency with blockfactory libraries generated by robotology/blockfactory#10 .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For sure less error prone, it was a trivial change, just some sed
magic. Lucky us that we use mdl and not slx.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OT: To be honest I am still confused on the role of mdl
and slx
in WBToolbox. The .slx
model include .mdl
one, but has support for the images? We could use the mdl
also in the example of BlockFactory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should try again substituting the slx
with the mdl
also in the installed tree.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So let me recap:
- The file that you mantain is the
<something>.mdl
- Then you save it to
.slx
, using theexport_library.m
script, and that is the file that you are installing so that it can be found by Simulink
is this correct?
I do not think the .slx
file is a big problem for WB-Toolbox, but just as thought experiment: why we do not run the export_library.m
script as part of the build project to create the .slx
in the build directory, and then we install as any build artefact?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to finish this discussion, installing the mdl
is not optimal and can create problems after an update. If the user resaves the library in slx
, and afterwards the mdl
is updated after an upstream change, the slx
does not get updated automatically and there is no warning to the user. This means that the user thinks to have the latest update from the repository but instead he / she is running an old version. This marks installing mdl
not an option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some while ago I stored some information on the export process here (a bit unusual but there was no website at the moment):
wb-toolbox/matlab/CMakeLists.txt
Lines 9 to 14 in 368119e
# The logic about library development is the following: | |
# | |
# * Developers should edit the library (e.g. changing block's masks) stored in the | |
# matlab/library/WBToolboxLibrary_repository.mdl file. | |
# * Developers should export the changes using the export_library custom target. | |
# * Users will use the files installed from the exported/ folder. |
why we do not run the export_library.m script as part of the build project to create the .slx in the build directory, and then we install as any build artefact?
Usually the mdl
is exported with the matlab version of the maintainer of the library (:hand:). If users have an old version of Matlab they cannot convert a model / library created with a newer version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool. I finally got it, I think. So if we did not wanted to commit a .slx
we could first save the mantainer's .mdl
to a mdl
compatible with 2014b:
save_system(libraryName, 'WBToolboxLibrary', 'ExportToVersion', 'R2014B_MDL');
and then convert it to R2014B_SLX
just during the build on the user's machine, before its install, to support correctly the EnableLBRepository
option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The .slx
/.mdl
discussion should not block the merge.
Merged, thanks. |
This PR contains the modification required to work with the current
master
branch of BlockFactory.