Skip to content
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

Error using yarp fromMatlab with MATLAB bindings #515

Closed
lnobile opened this issue Nov 17, 2020 · 9 comments
Closed

Error using yarp fromMatlab with MATLAB bindings #515

lnobile opened this issue Nov 17, 2020 · 9 comments

Comments

@lnobile
Copy link
Collaborator

lnobile commented Nov 17, 2020

Hello to everybody,
I recently installed the robotology-superbuild with the intention to use the MATLAB bindings for YARP.
I enabled:
ROBOTOLOGY_USES_MATLAB ON
ROBOTOLOGY_NOT_USE_SIMULINK ON
Since I don't need to use Simulink but only MATLAB.
I set the MATLAB path as described and I believe I followed all the listed instructions.
Hovever, when running the test code:

yarpVec = yarp.Vector();
yarpVec.fromMatlab([1;2;3]);
yarpVec.toMatlab()

I get the following error:

Error using yarpMEX
The error message identifier is invalid.
Error in yarp.Vector/fromMatlab (line 163)
      [varargout{1:nargout}] = yarpMEX(2590, self, varargin{:});
Error in SwigRef/subsref (line 33)
        [varargout{1:nargout}] = builtin('subsref',self,s);
Error in test (line 2)
yarpVec.fromMatlab([1;2;3]);

My system config:
MATLAB 2020a Update 2
YARP-3.4
Ubuntu 18.04

Speaking with @traversaro , this may be due to the new MATLAB version

@traversaro
Copy link
Member

Can you try to comment the fromMatlab version to check if it is a problem just of that?

I also suggest to enable ROBOTOLOGY_USES_DYNAMICS to check if there is the same problem with iDynTree bindings, that also contain a similar fromMatlab function.

@lnobile
Copy link
Collaborator Author

lnobile commented Nov 17, 2020

I commented the fromMatlab line and it seems to be the only problem.
When I try to compile with ROBOTOLOGY_USES_DYNAMICS ON i get the following error:

[ 80%] Building CXX object sources/Simulink/CMakeFiles/Simulink.dir/src/SimulinkBlockInformation.cpp.o
In file included from /home/lucanobile/src/robot/robotology-superbuild/robotology/BlockFactory/sources/Simulink/src/SimulinkBlockInformation.cpp:14:0:
/home/lucanobile/src/robot/robotology-superbuild/robotology/BlockFactory/sources/Simulink/include/BlockFactory/Simulink/Private/SimulinkBlockInformationImpl.h:15:10: fatal error: simstruc.h: No such file or directory
#include <simstruc.h>

Is this due to the fact that I don't have Simulink?

@traversaro traversaro changed the title Error using yarpMEX with MATLAB bindings Error using yarp fromMatlab with MATLAB bindings Nov 17, 2020
@traversaro
Copy link
Member

When I try to compile with ROBOTOLOGY_USES_DYNAMICS ON i get the following error:

[ 80%] Building CXX object sources/Simulink/CMakeFiles/Simulink.dir/src/SimulinkBlockInformation.cpp.o
In file included from /home/lucanobile/src/robot/robotology-superbuild/robotology/BlockFactory/sources/Simulink/src/SimulinkBlockInformation.cpp:14:0:
/home/lucanobile/src/robot/robotology-superbuild/robotology/BlockFactory/sources/Simulink/include/BlockFactory/Simulink/Private/SimulinkBlockInformationImpl.h:15:10: fatal error: simstruc.h: No such file or directory
#include <simstruc.h>

Is this due to the fact that I don't have Simulink?

Thanks, this is indeed a bug in the ROBOTOLOGY_NOT_USE_SIMULINK, that is not really used a lot and is tricky to test in CI due to MATLAB/Simulink being proprietary software. This should be fixed by #516 .

@traversaro
Copy link
Member

I commented the fromMatlab line and it seems to be the only problem.

Interesting, if that is the only problem one workaround is to use the some other methods to fill the vector (if you need this functionality) otherwise you can try to use the functionality of MATLAB/yarp that you wanted to use and see if there are other problems.

@lnobile
Copy link
Collaborator Author

lnobile commented Nov 17, 2020

I will try to use the other functionalities and in case I need to fill the vector I will use other methods, thanks for the advice!

@traversaro
Copy link
Member

Thanks, let's keep this issue open in any case as even if it a problem for which quick workarounds are possible, we eventually need to fix it. Furthermore, if you could provide your feedback on #516 it would be great.

@lnobile
Copy link
Collaborator Author

lnobile commented Nov 17, 2020

Thanks, let's keep this issue open in any case as even if it a problem for which quick workarounds are possible, we eventually need to fix it. Furthermore, if you could provide your feedback on #516 it would be great.

Just tested and now works, approved ;)

@traversaro
Copy link
Member

Fixes for this issue are provided in:

@traversaro
Copy link
Member

The issue was solved by the linked PRs. If the issue is still present, please re-open the issue, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants