ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 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.

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.

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..

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.