-
Notifications
You must be signed in to change notification settings - Fork 194
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
Add bindings for Multiple Analog Sensors interfaces #1756
Add bindings for Multiple Analog Sensors interfaces #1756
Conversation
@traversaro , I'm still completing the last point (impacting IVector_fromTo_matlab.i), but you can already review the other changes in the current commits. |
Please add few lines in the changelog |
Please rebase over the latest |
By the way, the conflicts are probably due to #1757 , i.e. |
@nunoguedelha Regarding the files added within the PR, I'd like to share a small concern. #698 was open due to a new file This PR adds |
I am not 100% sure, but I guess it should be sufficient to add all the files that we want to install to https://github.com/robotology/yarp/blob/devel/bindings/CMakeLists.txt#L91 . All the installation logic should be there, I would expect the Windows installer to just collect what is installed by the CMake install target and put in the installer. |
@jgvictores see robotology/yarp-packaging. Per /windows/README.txt:
|
- small refactoring of main header MultipleAnalogSensorsInterfaces.h defining the insterfaces - added main header to yarp/dev/all.h for a proper inclusion of the interfaces definitions in the mex source files yarpXXX_wrap.cxx - include main interfaces header in `yarp.i` and wrapped the cast functions `(PolyDriver*)->view(<sensor_interface*>)` for each one of the interfaces - extended the interface `IThreeAxisGyroscopes` for wrapping the methods hard to handle by Swig
- all extensions are done as for `IThreeAxisGyroscopes`, and using a Swig macro defined in `macrosForMultipleAnalogSensors.i` - all wrappers for casting from PolyDriver to specific device interfaces are now generated through a Swig macro.
Completed the extension of the classes std::vector<double>, std::vector<bool>, std::vector<int>, yarp::sig::Vector with these wrappers.
f8260a7
to
a71047a
Compare
@traversaro @PeterBowman Thanks for the clarifications. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I will merge it as soon as the test passes, thanks!
Should https://github.com/nunoguedelha/yarp/blob/feature/addMultipleAnalogSensorsBindings/bindings/CMakeLists.txt#L91 be changed from: foreach(f CMakeLists.txt yarp.i README.md) to: foreach(f CMakeLists.txt yarp.i README.md macrosForMultipleAnalogSensors.i matlab/vectors_fromTo_matlab.i) or similar? |
So is it needed an additional change in |
That's what I've understood from the comments above. : ) |
Yep, @nunoguedelha can you do the modification? |
…from the build material (typically for such files to be found by the windows installer)
Sure, done. |
Merged, thanks! |
Confirming that
Can't test it by myself, but I'm curious about the following lines (introduced by this PR): Lines 452 to 455 in 4bca59c
There is no |
@PeterBowman @jgvictores this is indeed a real issue and is being addressed. The bindings used to be generated using directly the
this flag is defined directly in the Mex library source file |
The issue mentioned by @PeterBowman is blocking robotology/yarp-matlab-bindings#35 . |
Motivation
After the integration of the multiple analog sensors interfaces and respective devices (refer to #1526, #1586, #1676) we need to access those interfaces from scripting languages like Matlab, and so, create the respective bindings.
On top of that, some redundant code is cluttering the SWIG interface file
yarp.i
, which can be avoided by using the appropriate macros.Description
Added bindings for Multiple Analog Sensors interfaces :
MultipleAnalogSensorsInterfaces.h
defining the interfacesyarpXXX_wrap.cxx
yarp.i
and wrapped the cast functions(PolyDriver*)->view(<sensor_interface*>)
for each one of the interfacesDid some refactoring in the SWIG interface file
yarp.i
for reducing redundant code :macrosForMultipleAnalogSensors.i
std::vector<double>
,std::vector<bool>
,std::vector<int>
.(
std::vector<std::string>
is a bit more tricky and was left out for now.)