error while using class method as callback in cpp
Hi, i'm actually trying to use my own class method as callback of a topic. I do it like this
First i created a publisher :
ros::Publisher topicDirection = n.advertise<std_msgs::Float64>("commandeDir", 1);
then i subscribe to this topic (commandeDir) with :
Servo pwmDir();
ros::Subscriber topicDir = n.subscribe("commandeDir", 1, &Servo::commande(const std_msgs::Float64& msg), pwmDir);
and my function looks like this :
void Servo::commande(const std_msgs::Float64& msg)
{
//.......
}
it throw me this error :
/opt/ros/indigo/include/ros/message_traits.h:138:31: error: ‘__s_getDataType’ is not a member of ‘int’
return M::__s_getDataType().c_str();
i don't get what i am doing wrong ?