robotology / wb-toolbox

Simulink toolbox to rapidly prototype robot controllers
https://robotology.github.io/wb-toolbox/
GNU Lesser General Public License v2.1
24 stars 17 forks source link

Libraries does not show up in Library Browser with robotology-superbuild on Ubuntu 20.04 with MATLAB R2020b #219

Closed traversaro closed 3 years ago

traversaro commented 3 years ago

I installed via robotology-superbuild with apt dependencies the library on Ubuntu 20.04 with MATLAB R2020b, and the library does not appear on the Library Browser: Screenshot_2021-05-26_14-49-04

Note that MATLAB Whole-Body Simulator and Whole-Body Controllers instead appear correctly.

The output of path command is;

>> path

        MATLABPATH

    /home/straversaro/Documents/MATLAB
    /home/straversaro/src/isaac_ws/robotology-superbuild/build/install/mex
    /home/straversaro/src/isaac_ws/robotology-superbuild/build/install/mex/+wbc/simulink
    /home/straversaro/src/isaac_ws/robotology-superbuild/build/install/mex/+wbc/examples
    /home/straversaro/src/isaac_ws/robotology-superbuild/build/install/share/WBToolbox
    /home/straversaro/src/isaac_ws/robotology-superbuild/build/install/share/WBToolbox/images
    /home/straversaro/matlab
    /tmp/Editor_evwvv
traversaro commented 3 years ago

As a first step, I will implement import_library script in https://github.com/robotology/wb-toolbox/issues/214 and run an import_library/export_library cycle to check if this fixes something.

traversaro commented 3 years ago

With the latest robotology-superbuild Stable branches (cloned this morning) I started debugging the issue.

I only installed WBToolbox (via make WBToolbox, on a clean superbuild) and the issue is indeed still there: Screenshot_2021-05-28_08-56-39

By opening the library it seems that EnableLBRepository is enabled:

>> gcs

ans =

    'WBToolboxLibrary'

>> get_param(gcs, 'EnableLBRepository')

ans =

    'on'
traversaro commented 3 years ago

I added a print in slblocks.m to check if that file is correctly found, and it is:

% Copyright (C) 2018 Istituto Italiano di Tecnologia (IIT). All rights reserved.
% This software may be modified and distributed under the terms of the
% GNU Lesser General Public License v2.1 or any later version.

function blkStruct = slblocks

fprintf('Running slblocks for WBToolbox\n')

% Name of the .mdl file
Browser.Library   = 'WBToolboxLibrary';
Browser.Name      = 'WholeBodyToolbox';
Browser.IsFlat    =  0;

blkStruct.Browser =  Browser;

And indeed when I refresh the library, on the Matlab command line the message is printed (once):

>> 
Running slblocks for WBToolbox
>> 
traversaro commented 3 years ago

I tried to save the .slx again with MATLAB as a 2020b slx, and indeed now it is loaded in the Library Browser. Interesting, when it is working the code in the slblocks.m file is executed two times:

>> 
Running slblocks for WBToolbox
Running slblocks for WBToolbox
>> 
traversaro commented 3 years ago

I tried to manually export the working .slx as R2014b, and indeed it is not working again. I will try to export it via export_libraries and check instead in that case.

traversaro commented 3 years ago

I re-exported as R2014b on Linux as well, and it is continuing not to work. So I suspect something effectively changed on them model at some point. I am trying to backtrack (to quickly debug that, slLibraryBrowser from MATLAB directly launches the library browser):

Based on this, the issue was introduced for some reason in https://github.com/robotology/wb-toolbox/issues/211 .

traversaro commented 3 years ago

Based on this, the issue was introduced for some reason in #211 .

My theory is that the new holder block for some reason (it uses some option not present in 2014b?) creates problems to the load of the library when the library is encoded in 2014b, as they are not problems if I encode it as 2020b . To verify this, I will try to export it to various versions and check when it works.

traversaro commented 3 years ago

To verify this, I will try to export it to various versions and check when it works.

I tried with R2016b, and indeed it works. I think that to quickly fix the issue, this could be a nice solution.