Now, I'm not using timers in these programs, so I cannot say what is the
influence of the 1ms wait in timer_manager.h. I have not looked at the
code in details, but it look like this wait could be advantageously
replaced by the following code:
int remaining_time = std::max((int)((sleep_end.toSec() -
current.toSec())*1000),0);
timers_cond_.timed_wait(lock,
boost::posix_time::milliseconds(std::min(50,remaining_time)));
Is there any reason to verify that the time is not going backward at
1kHz?
This is unfortunately not possible because of the ROS clock used
in simulation. If simulated time is going faster than normal time you
end up missing timer events. Building up a predictive model of how
fast time is actually moving is possible, but not high priority.
Josh