yarp icon indicating copy to clipboard operation
yarp copied to clipboard

YARP_math bindings for python

Open Nicolasr3 opened this issue 3 years ago • 1 comments
trafficstars

Hi all,

I was wondering if it was possible to use the yarp math in python. Since I'm starting to use the Cartesian control it will be really helpful to reuses some functions (like dcm2axis and axis2dcm).

Thanks in advance

Nicola

Nicolasr3 avatar Feb 18 '22 14:02 Nicolasr3

Hi @Nicolasr3 ! It seems that YARP_math is not exposed in SWIG bindings. If you want to try to expose it yourself, the starting point is to modify the yarp.i, in particular in this points:

  • In https://github.com/robotology/yarp/blob/bddb2125cb8f45a42779f9c28435625a74006900/bindings/yarp.i#L60 add a block similar to the one present earlier for yarp_dev, yarp_sig, yarp_os
  • In https://github.com/robotology/yarp/blob/bddb2125cb8f45a42779f9c28435625a74006900/bindings/yarp.i#L432, add with %include the headers that contains the functions that you want to wrap via SWIG.

After that, you can re-compile YARP and the new functions should be exposed. It may be that such changes are welcome also upstream, but probably we may need to double check with @randaz81 .

traversaro avatar Feb 23 '22 12:02 traversaro