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)
Still have to try, for now I can confirm that executing this code:
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.
We tried to run a matlab script reporting the same error with
iDynTree::StringVector.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.15I receive this error: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:
@traversaro
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.runis returning false?As expected, when running the controller a second consecutive time after stopping it, the controller terminates with this error:
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.dllin/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:
In my system and environment, the output is:
I suspect that in the system where we have a problem a
SDL2.dlldifferent from the one in the environment is found.I think it’s Matlab-related, since @gabrielenava reproduced the same error on his laptop following the mamba installation, moreover
iDynTreeworks from Windows command prompt (I reproduced your test and it works), but if I try to run a simple script with your same configurationthe output is
Which is actually happening with
sdl=1.2.52but it doesn’t happen when running the same code installingsdl=1.2.15(I changed just this package).Which commands did you tried? For sure those are much easier to use to reproduce the problem. Does the solution of downgrade
sdlto version1.2.15works also in that case?