idyntree: Simulink controller not running on Windows when using sdl 1.2.52, working with sdl 1.2.15

EDIT by @traversaro: for people only looking for the workaround, the workaround is to rename the file C:\Program Files\MATLAB\R2021b\bin\win64\SDL2.dll to C:\Program Files\MATLAB\R2021b\bin\win64\SDL2.dll.back and restart MATLAB.

Trying to run a Simulink controller on Windows, using iDynTree::Visualizer, the compilation is successfull but the controller crashes during starting with the following error: SDL_SetWindowResizable missing in SDL2 library

Simulink error message
Mamba env packages
# Name                    Version                   Build  Channel
ace                       7.0.6                h0e60522_0    conda-forge
assimp                    5.2.3                hc2aa0de_1    conda-forge
asttokens                 2.0.5              pyhd8ed1ab_0    conda-forge
backcall                  0.2.0              pyh9f0ad1d_0    conda-forge
backports                 1.0                        py_2    conda-forge
backports.functools_lru_cache 1.6.4              pyhd8ed1ab_0    conda-forge
blockfactory              0.8.3               h0e60522_50    robotology
blosc                     1.21.1               hcbbf2c4_0    conda-forge
boost-cpp                 1.74.0               h9f4b32c_8    conda-forge
bullet-cpp                3.21                 h2e25243_1    conda-forge
bzip2                     1.0.8                h8ffe710_4    conda-forge
c-compiler                1.4.2                h8ffe710_0    conda-forge
ca-certificates           2021.10.8            h5b45459_0    conda-forge
cairo                     1.16.0            h15b3021_1010    conda-forge
cfitsio                   4.1.0                h5a969a9_0    conda-forge
clangdev                  5.0.0                   flang_3    conda-forge
cmake                     3.23.1               h39d44d4_0    conda-forge
colorama                  0.4.4              pyh9f0ad1d_0    conda-forge
compilers                 1.4.2                h57928b3_0    conda-forge
console_bridge            1.0.2                h5362a0b_1    conda-forge
cppzmq                    4.8.1                h4324990_0    conda-forge
curl                      7.83.0               h789b8ee_0    conda-forge
cxx-compiler              1.4.2                h2d74725_0    conda-forge
dartsim                   6.12.1               h9f8fb06_3    conda-forge
decorator                 5.1.1              pyhd8ed1ab_0    conda-forge
dirent                    1.21                          0    conda-forge
dlfcn-win32               1.3.0                h0e60522_0    conda-forge
eigen                     3.4.0                h2d74725_0    conda-forge
executing                 0.8.3              pyhd8ed1ab_0    conda-forge
expat                     2.4.8                h39d44d4_0    conda-forge
fcl                       0.7.0                hbf27b1e_0    conda-forge
ffmpeg                    4.3.1                ha925a31_0    conda-forge
flang                     5.0.0           he025d50_20180525    conda-forge
flang_win-64              5.0.0           h13ae965_20180526    conda-forge
flann                     1.9.1             h075982a_1010    conda-forge
font-ttf-dejavu-sans-mono 2.37                 hab24e00_0    conda-forge
font-ttf-inconsolata      3.000                h77eed37_0    conda-forge
font-ttf-source-code-pro  2.038                h77eed37_0    conda-forge
font-ttf-ubuntu           0.83                 hab24e00_0    conda-forge
fontconfig                2.14.0               hce3cb01_0    conda-forge
fonts-conda-ecosystem     1                             0    conda-forge
fonts-conda-forge         1                             0    conda-forge
fortran-compiler          1.4.2                h9655429_0    conda-forge
freeglut                  3.2.2                h0e60522_1    conda-forge
freeimage                 3.18.0               h6676e37_8    conda-forge
freetype                  2.10.4               h546665d_1    conda-forge
freexl                    1.0.6                ha8e266a_0    conda-forge
gazebo                    11.10.2              hc81694e_2    conda-forge
gazebo-yarp-plugins       4.3.0               h6b60dcb_50    robotology
geos                      3.10.2               h39d44d4_0    conda-forge
geotiff                   1.7.1                h38b14a8_1    conda-forge
gettext                   0.19.8.1          ha2e2712_1008    conda-forge
gsl                       2.7                  hdfb1a43_0    conda-forge
gts                       0.7.6                h7c369d9_2    conda-forge
hdf4                      4.2.15               h0e5069d_3    conda-forge
hdf5                      1.12.1          nompi_h2a0e4a3_104    conda-forge
icu                       69.1                 h0e60522_0    conda-forge
icub-firmware-shared      1.24.0              h0e60522_50    robotology
icub-main                 1.24.1          py39hc46dcd5_50    robotology
icub-models               1.23.3           py39h415ef7b_1    conda-forge
idyntree                  5.1.0            py39h69073d3_2    conda-forge
idyntree-matlab-bindings  5.1.0               h0e60522_50    robotology
imath                     3.1.5                h12d4b20_0    conda-forge
intel-openmp              2022.0.0          h57928b3_3663    conda-forge
ipopt                     3.14.5               hf6be2e5_0    conda-forge
ipython                   8.2.0            py39hcbf5309_0    conda-forge
irrlicht                  1.8.5                h739eaf8_2    conda-forge
jasper                    2.0.33               h77af90b_0    conda-forge
jbig                      2.1               h8d14728_2003    conda-forge
jedi                      0.18.1           py39hcbf5309_1    conda-forge
jpeg                      9e                   h8ffe710_1    conda-forge
jsoncpp                   1.9.5                h2d74725_1    conda-forge
jxrlib                    1.1                  h8ffe710_2    conda-forge
kealib                    1.4.14               h8995ca9_3    conda-forge
krb5                      1.19.3               h1176d77_0    conda-forge
lcms2                     2.12                 h2a16943_0    conda-forge
lerc                      3.0                  h0e60522_0    conda-forge
libblas                   3.9.0              14_win64_mkl    conda-forge
libcblas                  3.9.0              14_win64_mkl    conda-forge
libccd                    2.1                  h0e60522_1    conda-forge
libclang                  13.0.1          default_h81446c8_0    conda-forge
libcurl                   7.83.0               h789b8ee_0    conda-forge
libdeflate                1.10                 h8ffe710_0    conda-forge
libffi                    3.4.2                h8ffe710_5    conda-forge
libflang                  5.0.0           h6538335_20180525    conda-forge
libgdal                   3.4.2                hd0657f4_6    conda-forge
libglib                   2.70.2               h3be07f2_4    conda-forge
libiconv                  1.16                 he774522_0    conda-forge
libignition-cmake2        2.12.1               h0e60522_0    conda-forge
libignition-common3       3.13.2               h9bd54ec_2    conda-forge
libignition-fuel-tools4   4.4.0                h3fac903_7    conda-forge
libignition-math6         6.10.0               h0e60522_0    conda-forge
libignition-msgs5         5.9.0                hc835698_0    conda-forge
libignition-tools1        1.4.1                h0e60522_2    conda-forge
libignition-transport8    8.1.0               h819de12_11    conda-forge
libjpeg-turbo             2.1.1                h8ffe710_0    conda-forge
libkml                    1.3.0             h9859afa_1014    conda-forge
liblapack                 3.9.0              14_win64_mkl    conda-forge
liblapacke                3.9.0              14_win64_mkl    conda-forge
libnetcdf                 4.8.1           nompi_h1cc8e9d_102    conda-forge
libode                    0.16.2              h415ef7b_10    conda-forge
libopenblas               0.3.20          pthreads_hc469a61_0    conda-forge
libopencv                 4.5.5            py39hb20b4e8_9    conda-forge
libosqp                   0.6.2                h0e60522_3    conda-forge
libpng                    1.6.37               h1d00b33_2    conda-forge
libpq                     14.2                 hfcc5ef8_0    conda-forge
libprotobuf               3.20.1               h7755175_0    conda-forge
libraw                    0.20.2               hee1bdec_1    conda-forge
librttopo                 1.1.0                hb1df466_9    conda-forge
libsdformat               9.3.0                h0e60522_5    conda-forge
libsodium                 1.0.18               h8d14728_1    conda-forge
libspatialite             5.0.1               h36c16d9_15    conda-forge
libssh2                   1.10.0               h680486a_2    conda-forge
libtiff                   4.3.0                hc4061b1_3    conda-forge
libusb                    1.0.26             h8ffe710_100    conda-forge
libwebp                   1.2.2                h57928b3_0    conda-forge
libwebp-base              1.2.2                h8ffe710_1    conda-forge
libxcb                    1.13              hcd874cb_1004    conda-forge
libxml2                   2.9.13               hf5bbc77_0    conda-forge
libzip                    1.8.0                hfed4ece_1    conda-forge
libzlib                   1.2.11            h8ffe710_1014    conda-forge
llvm-meta                 5.0.0                         0    conda-forge
lz4-c                     1.9.3                h8ffe710_1    conda-forge
m2w64-gcc-libgfortran     5.3.0                         6    conda-forge
m2w64-gcc-libs            5.3.0                         7    conda-forge
m2w64-gcc-libs-core       5.3.0                         7    conda-forge
m2w64-gmp                 6.1.0                         2    conda-forge
m2w64-libwinpthread-git   5.0.0.4634.697f757               2    conda-forge
make                      4.3                  h3d2af85_1    conda-forge
matplotlib-inline         0.1.3              pyhd8ed1ab_0    conda-forge
meshcat-python            0.3.2              pyhd8ed1ab_0    conda-forge
metis                     5.1.0             h0e60522_1006    conda-forge
mkl                       2022.0.0           h0e2418a_796    conda-forge
msys2-conda-epoch         20160418                      1    conda-forge
mumps-seq                 5.2.1               hb3f9cae_11    conda-forge
ninja                     1.10.2               h2d74725_1    conda-forge
numpy                     1.22.3           py39h0948cea_2    conda-forge
octomap                   1.9.7                h5362a0b_0    conda-forge
ogre                      1.10.12              hab73eff_8    conda-forge
openal-soft               1.21.1               h2d74725_0    conda-forge
openblas                  0.3.20          pthreads_h543f93c_0    conda-forge
openexr                   3.1.5                hab3b255_0    conda-forge
openjpeg                  2.4.0                hb211442_1    conda-forge
openmp                    5.0.0                    vc14_1    conda-forge
openssl                   1.1.1n               h8ffe710_0    conda-forge
osqp-eigen                0.7.0                h0e60522_0    conda-forge
parso                     0.8.3              pyhd8ed1ab_0    conda-forge
pcre                      8.45                 h0e60522_0    conda-forge
pickleshare               0.7.5                   py_1003    conda-forge
pillow                    9.1.0            py39ha53f419_2    conda-forge
pip                       22.0.4             pyhd8ed1ab_0    conda-forge
pixman                    0.40.0               h8ffe710_0    conda-forge
pkg-config                0.29.2            h2bf4dc2_1008    conda-forge
poppler                   22.01.0              h24fffdf_2    conda-forge
poppler-data              0.4.11               hd8ed1ab_0    conda-forge
postgresql                14.2                 h1c22c4f_0    conda-forge
proj                      9.0.0                h1cfcee9_1    conda-forge
prompt-toolkit            3.0.29             pyha770c72_0    conda-forge
pthread-stubs             0.4               hcd874cb_1001    conda-forge
pugixml                   1.11.4               h0e60522_0    conda-forge
pure_eval                 0.2.2              pyhd8ed1ab_0    conda-forge
pygments                  2.12.0             pyhd8ed1ab_0    conda-forge
pyngrok                   5.1.0              pyhd8ed1ab_0    conda-forge
python                    3.9.12          h9a09f29_1_cpython    conda-forge
python_abi                3.9                      2_cp39    conda-forge
pyyaml                    6.0              py39hb82d6ee_4    conda-forge
pyzmq                     22.3.0           py39he46f08e_2    conda-forge
qpoases                   3.2.1                h0e60522_0    conda-forge
qt                        5.12.9               h556501e_6    conda-forge
qwt                       6.2.0                hc28b1ea_2    conda-forge
robot-testing-framework   2.0.1                h0e60522_0    conda-forge
ruby                      2.7.2                h1d9c0f5_8    conda-forge
sdl                       1.2.52               h0e60522_1    conda-forge
sdl2                      2.0.22               h0e60522_0    conda-forge
setuptools                62.1.0           py39hcbf5309_0    conda-forge
simbody                   3.7                  hade3207_3    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
snappy                    1.1.8                ha925a31_3    conda-forge
sqlite                    3.38.2               h8ffe710_0    conda-forge
stack_data                0.2.0              pyhd8ed1ab_0    conda-forge
tbb                       2021.5.0             h2d74725_1    conda-forge
tbb-devel                 2021.5.0             h2d74725_1    conda-forge
tiledb                    2.8.2                h5689973_0    conda-forge
tiny-process-library      2.0.4                h0e60522_0    conda-forge
tinyxml                   2.6.2                h2d74725_2    conda-forge
tinyxml2                  9.0.0                h0e60522_2    conda-forge
tk                        8.6.12               h8ffe710_0    conda-forge
tornado                   6.1              py39hb82d6ee_3    conda-forge
traitlets                 5.1.1              pyhd8ed1ab_0    conda-forge
tzdata                    2022a                h191b570_0    conda-forge
u-msgpack-python          2.7.1              pyh9f0ad1d_0    conda-forge
ucrt                      10.0.20348.0         h57928b3_0    conda-forge
urdfdom                   2.3.5                h2d74725_0    conda-forge
urdfdom_headers           1.0.6                h5362a0b_2    conda-forge
vc                        14.2                 hb210afc_6    conda-forge
vs2015_runtime            14.29.30037          h902a5da_6    conda-forge
vs2017_win-64             19.16.27033          hb90652a_6    conda-forge
vswhere                   3.0.1                h57928b3_0    conda-forge
wb-toolbox                5.5.0               h0e60522_50    robotology
wcwidth                   0.2.5              pyh9f0ad1d_2    conda-forge
wheel                     0.37.1             pyhd8ed1ab_0    conda-forge
whole-body-controllers    2.5.6               h0e60522_50    robotology
whole-body-estimators     0.6.1               h0e60522_50    robotology
xerces-c                  3.2.3                h0e60522_4    conda-forge
xorg-libxau               1.0.9                hcd874cb_0    conda-forge
xorg-libxdmcp             1.1.3                hcd874cb_0    conda-forge
xz                        5.2.5                h62dcd97_1    conda-forge
yaml                      0.2.5                h8ffe710_2    conda-forge
yarp                      3.6.0           py39h2bb6a00_50    robotology
ycm-cmake-modules         0.14.0               h0e60522_0    conda-forge
zeromq                    4.3.4                h0e60522_1    conda-forge
zlib                      1.2.11            h8ffe710_1014    conda-forge
zstd                      1.5.2                h6255e5f_0    conda-forge
zziplib                   0.13.69              h1d00b33_1    conda-forge

Me and @gabrielenava also tried to use iDynTree commands from Matlab Command Window and they are not working, returning the same error related to the iDynTree MEX file.

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 1
  • Comments: 33 (18 by maintainers)

Most upvoted comments

Still have to try, for now I can confirm that executing this code:

viz = iDynTree.Visualizer()
viz.init()
viz.draw()
viz.close()
viz.init()
viz.draw()
viz.close()

the visualizer opens only the first time when using sdl 1.2.52, while it opens and closes twice when using sdl 1.2.15.

Which commands did you tried? For sure those are much easier to use to reproduce the problem.

We tried to run a matlab script reporting the same error with iDynTree::StringVector.

Does the solution of downgrade sdl to version 1.2.15 works also in that case?

Yes, the problem seems to be fixed in the mamba environment created for the robotology source installation.

In the environment created for the robotology binaries installation when executing mamba install sdl=1.2.15 I receive this error:

Encountered problems while solving:
  - package yarp-3.6.0-py39h2bb6a00_50 requires sdl >=1.2.52,<1.3.0a0, but none of the providers can be installed

I have the same problem on MATLAB R2023b with all toolbox installed, the SDL2 version installed there is: SDL2.zip .

I also experience this error:

>> ver

-----------------------------------------------------------------------------------------------------
MATLAB Version: 9.11.0.1873467 (R2021b) Update 3
MATLAB License Number: 40875934
Operating System: Microsoft Windows 11 Enterprise Version 10.0 (Build 22000)
Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
-----------------------------------------------------------------------------------------------------
MATLAB                                                Version 9.11        (R2021b)
Simulink                                              Version 10.4        (R2021b)
5G Toolbox                                            Version 2.3         (R2021b)
AUTOSAR Blockset                                      Version 2.5         (R2021b)
Aerospace Blockset                                    Version 5.1         (R2021b)
Aerospace Toolbox                                     Version 4.1         (R2021b)
Antenna Toolbox                                       Version 5.1         (R2021b)
Audio Toolbox                                         Version 3.1         (R2021b)
Automated Driving Toolbox                             Version 3.4         (R2021b)
Bioinformatics Toolbox                                Version 4.15.2      (R2021b)
Communications Toolbox                                Version 7.6         (R2021b)
Computer Vision Toolbox                               Version 10.1        (R2021b)
Control System Toolbox                                Version 10.11       (R2021b)
Curve Fitting Toolbox                                 Version 3.6         (R2021b)
DDS Blockset                                          Version 1.1         (R2021b)
DSP System Toolbox                                    Version 9.13        (R2021b)
Data Acquisition Toolbox                              Version 4.4         (R2021b)
Database Toolbox                                      Version 10.2        (R2021b)
Datafeed Toolbox                                      Version 6.1         (R2021b)
Deep Learning HDL Toolbox                             Version 1.2         (R2021b)
Deep Learning Toolbox                                 Version 14.3        (R2021b)
Econometrics Toolbox                                  Version 5.7         (R2021b)
Embedded Coder                                        Version 7.7         (R2021b)
Filter Design HDL Coder                               Version 3.1.10      (R2021b)
Financial Instruments Toolbox                         Version 3.3         (R2021b)
Financial Toolbox                                     Version 6.2         (R2021b)
Fixed-Point Designer                                  Version 7.3         (R2021b)
Fuzzy Logic Toolbox                                   Version 2.8.2       (R2021b)
GPU Coder                                             Version 2.2         (R2021b)
Global Optimization Toolbox                           Version 4.6         (R2021b)
HDL Coder                                             Version 3.19        (R2021b)
HDL Verifier                                          Version 6.4         (R2021b)
Image Acquisition Toolbox                             Version 6.5         (R2021b)
Image Processing Toolbox                              Version 11.4        (R2021b)
Instrument Control Toolbox                            Version 4.5         (R2021b)
LTE Toolbox                                           Version 3.6         (R2021b)
Lidar Toolbox                                         Version 2.0         (R2021b)
MATLAB Coder                                          Version 5.3         (R2021b)
MATLAB Compiler                                       Version 8.3         (R2021b)
MATLAB Compiler SDK                                   Version 6.11        (R2021b)
MATLAB Report Generator                               Version 5.11        (R2021b)
Mapping Toolbox                                       Version 5.2         (R2021b)
Mixed-Signal Blockset                                 Version 2.1         (R2021b)
Model Predictive Control Toolbox                      Version 7.2         (R2021b)
Model-Based Calibration Toolbox                       Version 5.11        (R2021b)
Motor Control Blockset                                Version 1.3         (R2021b)
Navigation Toolbox                                    Version 2.1         (R2021b)
OPC Toolbox                                           Version 5.0.3       (R2021b)
Optimization Toolbox                                  Version 9.2         (R2021b)
Parallel Computing Toolbox                            Version 7.5         (R2021b)
Partial Differential Equation Toolbox                 Version 3.7         (R2021b)
Phased Array System Toolbox                           Version 4.6         (R2021b)
Powertrain Blockset                                   Version 1.10        (R2021b)
Predictive Maintenance Toolbox                        Version 2.4         (R2021b)
RF Blockset                                           Version 8.2         (R2021b)
RF PCB Toolbox                                        Version 1.0         (R2021b)
RF Toolbox                                            Version 4.2         (R2021b)
ROS Toolbox                                           Version 1.4         (R2021b)
Radar Toolbox                                         Version 1.1         (R2021b)
Reinforcement Learning Toolbox                        Version 2.1         (R2021b)
Risk Management Toolbox                               Version 1.10        (R2021b)
Robotics System Toolbox                               Version 3.4         (R2021b)
Robust Control Toolbox                                Version 6.11        (R2021b)
Satellite Communications Toolbox                      Version 1.1         (R2021b)
Sensor Fusion and Tracking Toolbox                    Version 2.2         (R2021b)
SerDes Toolbox                                        Version 2.2         (R2021b)
Signal Integrity Toolbox                              Version 1.0         (R2021b)
Signal Processing Toolbox                             Version 8.7         (R2021b)
SimBiology                                            Version 6.2         (R2021b)
SimEvents                                             Version 5.11        (R2021b)
Simscape                                              Version 5.2         (R2021b)
Simscape Driveline                                    Version 3.4         (R2021b)
Simscape Electrical                                   Version 7.6         (R2021b)
Simscape Fluids                                       Version 3.3         (R2021b)
Simscape Multibody                                    Version 7.4         (R2021b)
Simulink 3D Animation                                 Version 9.3         (R2021b)
Simulink Check                                        Version 5.2         (R2021b)
Simulink Code Inspector                               Version 4.0         (R2021b)
Simulink Coder                                        Version 9.6         (R2021b)
Simulink Compiler                                     Version 1.3         (R2021b)
Simulink Control Design                               Version 6.0         (R2021b)
Simulink Coverage                                     Version 5.3         (R2021b)
Simulink Design Optimization                          Version 3.10        (R2021b)
Simulink Design Verifier                              Version 4.6         (R2021b)
Simulink Desktop Real-Time                            Version 5.13        (R2021b)
Simulink PLC Coder                                    Version 3.5         (R2021b)
Simulink Real-Time                                    Version 7.2         (R2021b)
Simulink Report Generator                             Version 5.11        (R2021b)
Simulink Requirements                                 Version 1.8         (R2021b)
Simulink Test                                         Version 3.5         (R2021b)
SoC Blockset                                          Version 1.5         (R2021b)
Spreadsheet Link                                      Version 3.4.6       (R2021b)
Stateflow                                             Version 10.5        (R2021b)
Statistics and Machine Learning Toolbox               Version 12.2        (R2021b)
Symbolic Math Toolbox                                 Version 9.0         (R2021b)
System Composer                                       Version 2.1         (R2021b)
System Identification Toolbox                         Version 9.15        (R2021b)
Text Analytics Toolbox                                Version 1.8         (R2021b)
UAV Toolbox                                           Version 1.2         (R2021b)
Vehicle Dynamics Blockset                             Version 1.7         (R2021b)
Vehicle Network Toolbox                               Version 5.1         (R2021b)
Vision HDL Toolbox                                    Version 2.4         (R2021b)
WLAN Toolbox                                          Version 3.3         (R2021b)
Wavelet Toolbox                                       Version 6.0         (R2021b)
Wireless HDL Toolbox                                  Version 2.3         (R2021b)

@traversaro

-----------------------------------------------------------------------------------------------------
MATLAB Version: 9.13.0.2126072 (R2022b) Update 3
Operating System: Microsoft Windows 10 Pro Version 10.0 (Build 19045)
Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
-----------------------------------------------------------------------------------------------------
MATLAB                                                Version 9.13        (R2022b)
Simulink                                              Version 10.6        (R2022b)
5G Toolbox                                            Version 2.5         (R2022b)
AUTOSAR Blockset                                      Version 3.0         (R2022b)
Aerospace Blockset                                    Version 5.3         (R2022b)
Aerospace Toolbox                                     Version 4.3         (R2022b)
Antenna Toolbox                                       Version 5.3         (R2022b)
Audio Toolbox                                         Version 3.3         (R2022b)
Automated Driving Toolbox                             Version 3.6         (R2022b)
Bioinformatics Toolbox                                Version 4.16.1      (R2022b)
Bluetooth Toolbox                                     Version 1.1         (R2022b)
Communications Toolbox                                Version 7.8         (R2022b)
Computer Vision Toolbox                               Version 10.3        (R2022b)
Control System Toolbox                                Version 10.12       (R2022b)
Curve Fitting Toolbox                                 Version 3.8         (R2022b)
DDS Blockset                                          Version 1.3         (R2022b)
DSP HDL Toolbox                                       Version 1.1         (R2022b)
DSP System Toolbox                                    Version 9.15        (R2022b)
Data Acquisition Toolbox                              Version 4.6         (R2022b)
Database Toolbox                                      Version 10.4        (R2022b)
Datafeed Toolbox                                      Version 6.3         (R2022b)
Deep Learning HDL Toolbox                             Version 1.4         (R2022b)
Deep Learning Toolbox                                 Version 14.5        (R2022b)
Econometrics Toolbox                                  Version 6.1         (R2022b)
Embedded Coder                                        Version 7.9         (R2022b)
Filter Design HDL Coder                               Version 3.1.12      (R2022b)
Financial Instruments Toolbox                         Version 3.5         (R2022b)
Financial Toolbox                                     Version 6.4         (R2022b)
Fixed-Point Designer                                  Version 7.5         (R2022b)
Fuzzy Logic Toolbox                                   Version 3.0         (R2022b)
GPU Coder                                             Version 2.4         (R2022b)
Global Optimization Toolbox                           Version 4.8         (R2022b)
HDL Coder                                             Version 4.0         (R2022b)
HDL Verifier                                          Version 7.0         (R2022b)
Image Acquisition Toolbox                             Version 6.7         (R2022b)
Image Processing Toolbox                              Version 11.6        (R2022b)
Industrial Communication Toolbox                      Version 6.1         (R2022b)
Instrument Control Toolbox                            Version 4.7         (R2022b)
LTE Toolbox                                           Version 3.8         (R2022b)
Lidar Toolbox                                         Version 2.2         (R2022b)
MATLAB Coder                                          Version 5.5         (R2022b)
MATLAB Compiler                                       Version 8.5         (R2022b)
MATLAB Compiler SDK                                   Version 7.1         (R2022b)
MATLAB Report Generator                               Version 5.13        (R2022b)
Mapping Toolbox                                       Version 5.4         (R2022b)
Medical Imaging Toolbox                               Version 1.0         (R2022b)
Mixed-Signal Blockset                                 Version 2.3         (R2022b)
Model Predictive Control Toolbox                      Version 8.0         (R2022b)
Model-Based Calibration Toolbox                       Version 5.13        (R2022b)
Motor Control Blockset                                Version 1.5         (R2022b)
Navigation Toolbox                                    Version 2.3         (R2022b)
Optimization Toolbox                                  Version 9.4         (R2022b)
Parallel Computing Toolbox                            Version 7.7         (R2022b)
Partial Differential Equation Toolbox                 Version 3.9         (R2022b)
Phased Array System Toolbox                           Version 4.8         (R2022b)
Powertrain Blockset                                   Version 1.12        (R2022b)
Predictive Maintenance Toolbox                        Version 2.6         (R2022b)
RF Blockset                                           Version 8.4         (R2022b)
RF PCB Toolbox                                        Version 1.2         (R2022b)
RF Toolbox                                            Version 4.4         (R2022b)
ROS Toolbox                                           Version 1.6         (R2022b)
Radar Toolbox                                         Version 1.3         (R2022b)
Reinforcement Learning Toolbox                        Version 2.3         (R2022b)
Requirements Toolbox                                  Version 2.1         (R2022b)
Risk Management Toolbox                               Version 2.1         (R2022b)
Robotics System Toolbox                               Version 4.1         (R2022b)
Robust Control Toolbox                                Version 6.11.2      (R2022b)
Satellite Communications Toolbox                      Version 1.3         (R2022b)
Sensor Fusion and Tracking Toolbox                    Version 2.4         (R2022b)
SerDes Toolbox                                        Version 2.4         (R2022b)
Signal Integrity Toolbox                              Version 1.2         (R2022b)
Signal Processing Toolbox                             Version 9.1         (R2022b)
SimBiology                                            Version 6.4         (R2022b)
SimEvents                                             Version 5.13        (R2022b)
Simscape                                              Version 5.4         (R2022b)
Simscape Battery                                      Version 1.0         (R2022b)
Simscape Driveline                                    Version 3.6         (R2022b)
Simscape Electrical                                   Version 7.8         (R2022b)
Simscape Fluids                                       Version 3.5         (R2022b)
Simscape Multibody                                    Version 7.6         (R2022b)
Simulink 3D Animation                                 Version 9.5         (R2022b)
Simulink Check                                        Version 6.1         (R2022b)
Simulink Code Inspector                               Version 4.2         (R2022b)
Simulink Coder                                        Version 9.8         (R2022b)
Simulink Compiler                                     Version 1.5         (R2022b)
Simulink Control Design                               Version 6.2         (R2022b)
Simulink Coverage                                     Version 5.5         (R2022b)
Simulink Design Optimization                          Version 3.12        (R2022b)
Simulink Design Verifier                              Version 4.8         (R2022b)
Simulink Desktop Real-Time                            Version 5.15        (R2022b)
Simulink PLC Coder                                    Version 3.7         (R2022b)
Simulink Real-Time                                    Version 8.1         (R2022b)
Simulink Report Generator                             Version 5.13        (R2022b)
Simulink Test                                         Version 3.7         (R2022b)
SoC Blockset                                          Version 1.7         (R2022b)
Spreadsheet Link                                      Version 3.4.8       (R2022b)
Stateflow                                             Version 10.7        (R2022b)
Statistics and Machine Learning Toolbox               Version 12.4        (R2022b)
Symbolic Math Toolbox                                 Version 9.2         (R2022b)
System Composer                                       Version 2.3         (R2022b)
System Identification Toolbox                         Version 10.0        (R2022b)
Text Analytics Toolbox                                Version 1.9         (R2022b)
UAV Toolbox                                           Version 1.4         (R2022b)
Vehicle Dynamics Blockset                             Version 1.9         (R2022b)
Vehicle Network Toolbox                               Version 5.3         (R2022b)
Vision HDL Toolbox                                    Version 2.6         (R2022b)
WLAN Toolbox                                          Version 3.5         (R2022b)
Wavelet Toolbox                                       Version 6.2         (R2022b)
Wireless HDL Toolbox                                  Version 2.5         (R2022b)
Wireless Testbench                                    Version 1.1         (R2022b)

sorry but I cant attach a zip file with SDL2.ddl

Exactly, the error is thrown by the viz.run() returning false in the robot Visualizer used by the Simulink controller.

Interesting, so that means that viz.run is returning false?

As expected, when running the controller a second consecutive time after stopping it, the controller terminates with this error:

An error occurred while running the simulation and the simulation was terminated

Caused by: Closing visualizer.

I found out that there was a wrong path in the matlab initialization script for the simulink controller, now it runs with both the environments (sdl 1.2.15 and 1.2.52).

Interesting, this does not seems related at all to SDL2 or to the problem we had.

By the way, just to make a test you can try if everything works if you rename /c/Program Files/MATLAB/R2021b/bin/win64/SDL2.dll in /c/Program Files/MATLAB/R2021b/bin/win64/SDL2.dll.backup, even if I am afraid that then you will experience https://github.com/robotology/idyntree/issues/986 .

From https://it.mathworks.com/matlabcentral/answers/394532-incorrectly-linked-libsdl2-so?s_tid=srchtitle I would expect that some MATLAB toolbox installs a vendored SDL library, but I do not have anything like that in my system.

To debug the situation on systems where we have this problem, I think I found a simple way.

@antonellopaolino @gabrielenava when you can execute in the MATLAB Command Line the lines:

system('"C:\Program Files\Git\usr\bin\which.exe" SDL.dll');
system('"C:\Program Files\Git\usr\bin\which.exe" SDL2.dll');

In my system and environment, the output is:

>> system('"C:\Program Files\Git\usr\bin\which.exe" SDL.dll');
system('"C:\Program Files\Git\usr\bin\which.exe" SDL2.dll');
/c/Users/STraversaro/AppData/Local/mambaforge/envs/test985/Library/bin/SDL.dll
/c/Users/STraversaro/AppData/Local/mambaforge/envs/test985/Library/bin/SDL2.dll

I suspect that in the system where we have a problem a SDL2.dll different from the one in the environment is found.

I tried with idyntree-model-view and it is working fine:

idyntree-model-view -m %CONDA_PREFIX%\Library\share\iCub\robots\iCubGazeboV3\model.urdf

So, this is actually a MATLAB-related problem or something related to your setup @antonellopaolino (perhaps a strange SDL2 dll found somewhere). If you are able to write/provide a self-contained MATLAB script that reproduces the problem that would simplifies the reproducing and eventual resolution of the problem. See https://stackoverflow.com/help/minimal-reproducible-example .

I think it’s Matlab-related, since @gabrielenava reproduced the same error on his laptop following the mamba installation, moreover iDynTree works from Windows command prompt (I reproduced your test and it works), but if I try to run a simple script with your same configuration

a = iDynTree.StringVector()

the output is

Invalid MEX-file 'C:\Users\apaolino\AppData\Local\mambaforge\envs\test\Library\mex\iDynTreeMEX.mexw64': A dynamic link library (DLL) initialization routine failed.

Error in iDynTree.StringVector (line 57)
        tmp = iDynTreeMEX(36, varargin{:});

Error in testscript (line 1)
a = iDynTree.StringVector()

Which is actually happening with sdl=1.2.52 but it doesn’t happen when running the same code installing sdl=1.2.15 (I changed just this package).

Me and @gabrielenava also tried to use iDynTree commands from Matlab Command Window and they are not working, returning the same error related to the iDynTree MEX file.

Which commands did you tried? For sure those are much easier to use to reproduce the problem. Does the solution of downgrade sdl to version 1.2.15 works also in that case?