why is ros::duration().sleep() skipping delays ? [closed]

asked 2015-07-16 17:38:50 -0500

rkitect gravatar image

Hello

I am using ros::Duration(5).sleep() in one of my boost threads. It works fine in the first execution loop but starts skipping the delays completely after first cycle. Also I'm using ros::Rate rate(0.02); rate.sleep(); it's the same case for this method as well.

I'm using ros::AsyncSpinner spinner(4); spinner.start in my main loop and there's no other ros spin anywhere in the code. I cannot see why this would cause a problem, but still mentioning.

Any help/advice is appreciated, thanks in advance !

edit retag flag offensive reopen merge delete

Closed for the following reason Question does not follow our guidelines for questions. Please see: http://wiki.ros.org/Support for more details. by tfoote
close date 2018-01-11 20:14:49.530284

Comments

For rate.sleep() I'd say that your node application logic is taking too much time to run, essentially causing overruns of your time quota. Expected behaviour of of ros::Rate in that case is to skip the sleep.

Why ros::Duration(5).sleep() does what it does, no idea.

gvdhoorn gravatar image gvdhoorn  ( 2015-07-17 10:24:42 -0500 )edit

Please provide a way to reproduce the problem so we can look closer.

tfoote gravatar image tfoote  ( 2015-07-19 07:50:12 -0500 )edit