Error:
/home/bostan/ROS/gam_driver/amtec_driver/ros/src/amtec_driver.cpp:173: error: no matching function for call to ‘ros::NodeHandle::advertiseService(const char [5], bool (PowercubeChainNode::)(int), PowercubeChainNode const)’
/opt/ros/cturtle/ros/core/roscpp/include/ros/node_handle.h:1022: note: candidates are: ros::ServiceServer ros::NodeHandle::advertiseService(ros::AdvertiseServiceOptions&)
main file class info:
class PowercubeChainNode
{
//
public:
/// create a handle for this node, initialize node
ros::NodeHandle n_;
---
---
---
// declaration of service servers
ros::ServiceServer srvServer_Init_;
ros::ServiceServer srvServer_Stop_;
ros::ServiceServer srvServer_Recover_;
ros::ServiceServer srvServer_SetOperationMode_;
ros::ServiceServer srvServer_SetDefaultVel_;
----
----
----
// implementation of service servers
srvServer_Init_ = n_.advertiseService("init", &PowercubeChainNode::srvCallback_Init, this);
srvServer_Stop_ = n_.advertiseService("stop", &PowercubeChainNode::srvCallback_Stop, this);
srvServer_Recover_ = n_.advertiseService("recover", &PowercubeChainNode::srvCallback_Recover, this);
srvServer_SetOperationMode_ = n_.advertiseService("set_operation_mode", &PowercubeChainNode::srvCallback_SetOperationMode, this);
srvServer_SetDefaultVel_ = n_.advertiseService("set_default_vel", &PowercubeChainNode::srvCallback_SetDefaultVel, this);
-----
-----
-----
}
relevant methods from "NodeHandle" class
template<class T, class MReq, class MRes>
ServiceServer advertiseService(const std::string& service, bool(T::*srv_func)(MReq &, MRes &), T *obj)
{
AdvertiseServiceOptions ops;
ops.template init<MReq, MRes>(service, boost::bind(srv_func, obj, _1, _2));
return advertiseService(ops);
}
-------------------------------------------------------------------------------------------
template<class T, class MReq, class MRes>
ServiceServer advertiseService(const std::string& service, bool(T::*srv_func)(ServiceEvent<MReq, MRes>&), T *obj)
{
AdvertiseServiceOptions ops;
ops.template initBySpecType<ServiceEvent<MReq, MRes> >(service, boost::bind(srv_func, obj, _1));
return advertiseService(ops);
}
------------------------------------------------------------------------------------------
template<class T, class MReq, class MRes>
ServiceServer advertiseService(const std::string& service, bool(T::*srv_func)(MReq &, MRes &), const boost::shared_ptr<T>& obj)
{
AdvertiseServiceOptions ops;
ops.template init<MReq, MRes>(service, boost::bind(srv_func, obj.get(), _1, _2));
ops.tracked_object = obj;
return advertiseService(ops);
}
---------------------------------------------------------------------------------------
template<class T, class MReq, class MRes>
ServiceServer advertiseService(const std::string& service, bool(T::*srv_func)(ServiceEvent<MReq, MRes>&), const boost::shared_ptr<T>& obj)
{
AdvertiseServiceOptions ops;
ops.template initBySpecType<ServiceEvent<MReq, MRes> >(service, boost::bind(srv_func, obj.get(), _1));
ops.tracked_object = obj;
return advertiseService(ops);
}
-------------------------------------------------------------------------------------------
template<class MReq, class MRes>
ServiceServer advertiseService(const std::string& service, bool(*srv_func)(MReq&, MRes&))
{
AdvertiseServiceOptions ops;
ops.template init<MReq, MRes>(service, srv_func);
return advertiseService(ops);
}
--------------------------------------------------------------------------------
template<class MReq, class MRes>
ServiceServer advertiseService(const std::string& service, bool(*srv_func)(ServiceEvent<MReq, MRes>&))
{
AdvertiseServiceOptions ops;
ops.template initBySpecType<ServiceEvent<MReq, MRes> >(service, srv_func);
return advertiseService(ops);
}
----------------------------------------------------------------------------------------
template<class MReq, class MRes>
ServiceServer advertiseService(const std::string& service, const boost::function<bool(MReq&, MRes&)>& callback, const VoidConstPtr& tracked_object = VoidConstPtr())
{
AdvertiseServiceOptions ops;
ops.template init<MReq, MRes>(service, callback);
ops.tracked_object = tracked_object;
return advertiseService(ops);
}
-----------------------------------------------------------------------
template<class S>
ServiceServer advertiseService(const std::string& service, const boost::function<bool(S&)>& callback, const VoidConstPtr& tracked_object = VoidConstPtr())
{
AdvertiseServiceOptions ops;
ops.template initBySpecType<S>(service, callback);
ops.tracked_object = tracked_object;
return advertiseService(ops);
}
--------------------------------------------------------------
ServiceServer advertiseService(AdvertiseServiceOptions& ops);