Using GazeEvent callback in Python #317
-
@ddetommaso commented on Thu Aug 02 2018 Describe the bug TypeError: in method 'IGazeControl_registerEvent', argument 2 of type 'yarp::dev::GazeEvent &' To Reproduce import yarp
class GazeMotionDone(yarp.GazeEvent):
def __init__(self):
pass
def gazeEventCallback(self):
pass
class GazeController:
def __init__(self):
self.iGaze = None
props = yarp.Property()
props.put("device","gazecontrollerclient")
props.put("local","/gaze_client")
props.put("remote","/iKinGazeCtrl")
self.driver = yarp.PolyDriver()
self.driver.open(props)
self.iGaze = self.driver.viewIGazeControl()
a = GazeMotionDone()
self.iGaze.registerEvent(a) Expected behavior Configuration (please complete the following information):
Please let me know if I am missing something. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Hi @ddetommaso I'm not a Python user, hence cannot be of help here. Any Python/swig expert willing to chime in? |
Beta Was this translation helpful? Give feedback.
-
🔔 Gentle ping to all developers out there eager to help 😉 |
Beta Was this translation helpful? Give feedback.
-
I know that this kind of behaviors are typically implemented using the |
Beta Was this translation helpful? Give feedback.
I know that this kind of behaviors are typically implemented using the
director
's SWIG feature. I guess we should add a%feature("director") yarp::dev::GazeEvent
somewhere after the actual inclusion ofIGazeControl.h
in https://github.com/robotology/yarp/blob/b7983c941952a3aafa7de7dd4aeeb574c1865799/bindings/yarp.i#L426 , but I am not 100% sure.