ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

how can i register a callback for an action client

asked 2017-02-05 10:09:33 -0500

nvog1993 gravatar image

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.

edit retag flag offensive close merge delete

Comments

you can post your code or error messages then we can help you more

FrozenCh gravatar image FrozenCh  ( 2017-02-05 20:13:15 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-02-01 23:00:16 -0500

Sascha_92 gravatar image

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).

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2017-02-05 10:09:33 -0500

Seen: 507 times

Last updated: Feb 05 '17