Is there any way to use yarp callbacks when using the java swig library?
I am not very confident that the answer is yes, but who knows…
Hi kaouete. Yes, some yarp callbacks are usable via java swig. Since supporting callbacks requires some overhead, we've been "turning on" support for callbacks selectively. If you let me know which callback you are interested in, I can check whether it has been enabled, and turn it on if needed. You can read about callbacks in swig (supported by a feature called "directors") here: http://www.swig.org/Doc1.3/Java.html#java_directors
To control what callbacks are supported requires modifying $YARP_ROOT/example/swig/yarp.i (search for director).
Ok, I am happy to have asked !
I will play with this and see if it is sufficient or if I need something else (and why).
Thank you for your answer, I will close this request when all is ok.
So, it looks like what I am interested in is not yet enabled with directors.
What I would like is to be able to use callbacks on BufferedPortBottle. Tell me if I missed something :)
For BufferedPortBottle, don't try to use the onRead method directly. Instead make an instance of the BottleCallback class, and call port.useCallback(the_callback_instance). See the second method described in this thread:
Hope this helps, P
It works perfectly, thank you for your support.