Closed traversaro closed 2 years ago
Note for the future: these kind of issues could be prevented by having the source structure corresponding exactly to the install structure, and just having a simple CMake code to install:
install(DIRECTORY <directory_containing_the_files_to_install> DESTINATION mex)
This should prevent from the structual point of view issue of these kind from happening again, and would drastically reduce the amount of CMake logic to mantain (and nobody likes complex CMake logic : ) ).
We had a meeting today on these, with this outcome:
<install_prefix>/mex/+wbs/simulink
contained the .slx files coming from different directories, so changing all of that is tricky.<install_prefix>/mex/+wbs/simulink/+MomentumVelocityControl
, so that we do not need to add any new directory to the MATLAB path, and we just need to change all the invocations of this functions from ComputeContactJacobianWithFeetContactFCN
to MomentumVelocityControl.ComputeContactJacobianWithFeetContactFCN
or similar. However, this would require to modify all the controllers, that we prefer not to do at the moment.<install_prefix>/mex/+wbs/simulink/+MomentumVelocityControl
, and document that this folder needs to be added to the matlab path.
Hi everyone, I was trying to take an internal downstream project that depends on
whole-body-controllers
and make sure that it was only using the the installed version of whole-body-controllers, to make sure that it can eventually work fine with binary distribution of the install of whole-body-controllers, such as a.zip
of the<build>/install
directory of the robotology-superbuild, or via the conda package of whole-body-controllers.However, I am encountering several issues due to the different structure between how the
whole-body-controllers
files are organized in the source directory, and how they are organized when they are installed.In particular, this project is currently adding to the MATLAB's path a lot of directories of the source repo of
whole-body-controllers
, via a snippet of code like:The Simulink controller of this repo then use directly MATLAB functions contained in
library/simulink-library/MomentumVelocityControl/src
, such as:ComputeContactJacobianWithFeetContactFCN
centroidalConversion
ComputeReferences
The problem is that this functions are installed (due to the logic in https://github.com/robotology/whole-body-controllers/blob/v2.5.5/library/simulink-library/CMakeLists.txt#L27) in the
<install_prefix>/mex/+wbc
directory, and this is particularly problematic because if you try to add this directory to the MATLAB's path, you get an error:So it is impossible to call directly this functions. One could modify all the uses of this functions to contain the
wbc.
prefix, but this will not work as well as the function have internal references that do not use thewbc.
prefix, so for example any use ofwbc.centroidalConversion
will fail with error:Because
centroidalConversion
callscentroidalTransformationT_TDot
directly.In this form, this internal project can't be migrated to just use the installed version of
whole-body-controllers
. There could several strategies to fix this, but probably it could be a good idea to have a quick chat on this. @CarlottaSartore @gabrielenavafyi @VenusPasandi @Andrea8Testa @valentino-razza @fdinatale