Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

Hi. You would have to pass "this" pointer also as an argument when defining the serviceserver object like so,

//Service Node

this->my_service = this->rosNode->advertiseService("/add_server", &JointController::addd, this);

Please refer this link as it explains using member functions of classes as callback functions. http://wiki.ros.org/roscpp_tutorials/Tutorials/UsingClassMethodsAsCallbacks

Hope this helps.