What am i doing wrong with ros::timer in rqt?
Hello,
i have some problems with making the ros::timer work. Usually if i need a timer within a class i add these three lines to the header:
void timerCallback(const ros::TimerEvent& event);
ros::Timer m_timer;
ros::NodeHandle m_nh;
and in the cpp file i add this line for example to the constructor:
m_timer = m_nh.createTimer(ros::Duration(1), &MyClass::timerCallback, this);
Last but not least i add a callback function to the cpp:
void MyClass::timerCallback(const ros::TimerEvent& event)
{
// something that has to be done frequently
ROS_INFO("Beep");
}
Unfortunatly it does not work this way in an rqt plugin. For some reason the callback function is never thrown. Please help me with that. I'm using ROS Hydro on Kubuntu 12.04.