how to use ros::AdvertiseServiceOptions with member functions as callback?

asked 2019-06-15 14:55:44 -0500

Hi,

I want to have a dedicated callback queue for my services. the callback of the service is a member function

how do I use ros::AdvertiseServiceOptions with member functions

i tried:

boost::function<bool(typename pcmatch::getObjPoseRequest&, typename pcmatch::getObjPoseResponse&)> fp;
fp = boost::bind(&MyViewer::getObjPoseCB, this, _1, _2);

and:

boost::function<bool(typename pcmatch::getObjPose::RequestType, typename pcmatch::getObjPose::ResponseType)> fp;
fp = boost::bind(&MyViewer::getObjPoseCB, this, _1, _2);

to get a function pointer I could use with:

ros::AdvertiseServiceOptions serviceOpts =
        ros::AdvertiseServiceOptions::create(
            "getObjPose",
            fp,
            ros::VoidPtr(),
            &serviceCallbackQueue_);

but i get the error "no matching function for call to 'create' -- could not infer template argument 'Service' "

edit retag flag offensive close merge delete