compilation error in ros action server code
Hello,
I am using below code to implement a simple_action_server:
#include <ros/ros.h>
#include <actionlib/server/simple_action_server.h>
#include <robot_calibration_msgs/GripperLedCommandAction.h>
typedef actionlib::SimpleActionServer<robot_calibration_msgs::GripperLedCommandAction> led_actn_srvr_t;
class led_action
{
ros::NodeHandle nh;
led_actn_srvr_t ls;
std::string action_name;
public:
led_action(std::string name):
ls(nh, name, boost::bind(&led_action::execute_cb, this, _1), false),
action_name(name)
{
ls.start();
}
void execute_cb(const robot_calibration_msgs::GripperLedCommandActionConstPtr &action)
{
}
};
int main(int argc, char** argv)
{
return 0;
}
While compiling this code, I am getting below error:
/usr/include/boost/bind/mem_fn_template.hpp:184:7: note: no known conversion for argument 1 from ‘led_action*’ to ‘led_action&’
I searched for the solution of this compilation issue, but not able to figure out the problem.
Can someone please help to solve this problem.
Saurabh