0
$\begingroup$

Rosanswers logo

I want to use the example in this tutorial and register feedback and active callbacks to pass to the boost::bind. However, i have trouble finding the proper syntax/way to register them.


Originally posted by nvog1993 on ROS Answers with karma: 1 on 2017-02-05

Post score: 0


Original comments

Comment by FrozenCh on 2017-02-05:
you can post your code or error messages then we can help you more

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Well, basically you just have to repeat the syntax given for the doneCB. As far as i understood, you need the binder because you cannot use the () operator to indicate if your function has inputs.

The first parameter references your function, the second one to which object the function belongs to. Afterwards, you just need parameters if you have inputs.

Here's n' example how i implemented this. ac.sendGoal(goal, boost::bind(&MyNode::doneCb, this, _1, _2), boost::bind(&MyNode::activeCB,this), boost::bind(&JacoClient::feedbackCb, this, _1));

If you want more details, you can check out the boost documentation ( it's quite good documented).


Originally posted by Sascha_92 with karma: 16 on 2018-02-02

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$