Problem with ros::Timer [closed]
Hello
I have trouble creating a timer in Ros. I defined a class in which one of its members is the timer callback. To create it, in the constructor of the class I put the following:
timer = nh.createTimer(ros::Duration(0.1), &summit_xl_path_planning::PathPlanningSpin, this);
("timer" is a ros::Timer
member of the class)
And then define the callback as below:
void summit_xl_path_planning::PathPlanningSpin(const ros::TimerEvent& e)
{
...
}
Finally in the main summit_xl_path_planning I create a class, to make things work. I run the node using rosrun.
The problem is that I never get to run the timer. The program compiles. When I run everything I put in the constructor is done, but then nothing else happens. I have reviewed the tutorials thousands of times, but I can not see I'm doing wrong. Can anybody help?
I'm using Ubuntu 12.04 and Fuerte.
Thanks in advance and best regards