Why does /clock slow down under 65% CPU load?
On Ubuntu 16.04, with 8 cores and lots of nodelets.
Measuring /clock
with rostopic hz /clock
and using rosbag play --rate xx
, I see that:
--rate CPU load /clock
0.5 40% 50 Hz
1.0 65% 38 Hz
2.0 85% 9 Hz
I know ROS doesn't claim to be real-time, but normal-speed playback shouldn't be slowing down the clock as the CPU has plenty of cycles to spare, it appears.
This affects running the program live, as we have a ros::Timer()
that slows down, mucking up everything else down the chain. Using a stop-watch, at --rate 2.0
the BAG file plays back at double speed, but why isn't /clock
keeping up?