Time Functions

ROS.Duration — Method
Duration(sec::Int, nsec::Int)

Constructor, creates a Duration.

source
ROS.Rate — Method
Rate(frequency::Number)

Constructor, creates a Rate.

source
ROS.Rate — Method
Rate(duration)

Constructor, creates a Rate from a Duration.

source
ROS.Time — Method
Time(sec::Int, ncsec::Int)

Constructor, creates Time.

source
ROS.cycleTime — Method
cycleTime(rate)

Get the actual run time of a cycle from start to sleep.

source
ROS.expectedCycleTime — Method
expectedCycleTime(rate)

Get the expected cycle time – one over the frequency passed in to the constructor.

source
ROS.isValid — Method
isValid(time)

Returns whether or not the current time source is valid. Simulation time is valid if it is non-zero.

source
ROS.now — Method
now(time)

Retrieve the current time. If ROS clock time is in use, this returns the time according to the ROS clock. Otherwise returns the current wall clock time.

source
ROS.reset — Method
reset(rate)

Sets the start time for the rate to now.

source
ROS.setNow — Method
setNow(time, now) = @cxx t->setNow(now)

Set now to now time.

source
ROS.sleep — Method
sleep(duration)

Sleep for the amount of time specified by this Duration. If a signal interrupts the sleep, resleeps for the time remaining.

source
ROS.sleep — Method
sleep(rate)

Sleeps for any leftover time in a cycle. Calculated from the last time sleep, reset, or the constructor was called.

source
ROS.toSec — Method
toSec(duration)

Turn Duration into floating point seconds.

source
ROS.toSec — Method
toSec(time)

Turn Time into floating point seconds.

source