createTimer queue size

asked 2019-05-24 08:49:58 -0500

twannoo10 gravatar image

updated 2019-05-24 09:06:20 -0500

gvdhoorn gravatar image

Hi all,

Currently, I have quite a big node with some threads dealing with different things. One of the threads is used in a timed callback that has to compute a solution every ## ms. I did this by creating a new callbackqueue, and creating a timed callback with:

nh.createTimer(ros::Duration(##), &MainNode::timerCallback, this)

Now, I was wondering what the queue size of this feature is (in case the previous callback was not done within the given time-frame). Does it "pile-on" the callbacks and retry them later, or does it try and forget if the callback is still in use? I am basically looking for the equivalent of the queue_size of topic subscriptions.

The goal is to set this to none, s.t. there does not pile-up a queue in case the callbacks do not run in time, but maybe it already automatically is.

edit retag flag offensive close merge delete

Comments

I am facing a similar issue. I just want to use the latest callback from the timer. All callbacks are added to the global callback queue by default if we don't mention a queue so I would assume it piles up. Were you able to figure this out?

yashtrikannad gravatar image yashtrikannad  ( 2020-03-14 02:12:30 -0500 )edit