Robotics StackExchange | Archived questions

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

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 !

Asked by rkitect on 2015-07-16 17:38:50 UTC

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.

Asked by gvdhoorn on 2015-07-17 10:24:42 UTC

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

Asked by tfoote on 2015-07-19 07:50:12 UTC

Answers