ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
I think what you are seeing is actually expected behaviour.
From the documentation of cycleTime()
(here):
Get the actual run time of a cycle from start to sleep.
So apparently your while-loop body takes 0.0005
seconds to execute.
2 | No.2 Revision |
I think what you are seeing is actually expected behaviour.
From the documentation of cycleTime()
(here):
Get the actual run time of a cycle from start to sleep.
So apparently your while-loop body takes 0.0005
seconds to execute.
In other words: cycle time != number of iterations per second, but total time per iteration.
3 | No.3 Revision |
I think what you are seeing is actually expected behaviour.
From the documentation of cycleTime()
(here):
Get the actual run time of a cycle from start to sleep.
See also here for where this is calculated in rostime/rate.cpp
:
set the actual amount of time the loop took in case the user wants to know
So apparently your while-loop body takes 0.0005
seconds to execute.
In other words: cycle time != number of iterations per second, but total time perper iteration iteration..
4 | No.4 Revision |
I think what you are seeing is actually expected behaviour.
From the documentation of cycleTime()
(here):
Get the actual run time of a cycle from start to sleep.
See also here for where this is calculated in rostime/rate.cpp
:
set the actual amount of time the loop took in case the user wants to know
So apparently your while-loop body takes 0.0005
seconds to execute.execute. loop_rate.sleep()
will just suspend your task/thread for the remainder of the second.
In other words: cycle time != number of iterations per second, but total time per iteration.