Functions | |
void | delay (double seconds) |
Wait for a certain number of seconds. | |
double | now () |
Return the current time in seconds, relative to an arbitrary starting point. | |
void | yield () |
The calling thread releases its remaining quantum upon calling this function. | |
void | useSystemClock () |
Configure YARP to use system time (this is the default). | |
void | useNetworkClock (const std::string &clock, const std::string &localPortName="") |
Configure YARP to read time from a specified topic. | |
void | useCustomClock (Clock *clock) |
Configure YARP clients to use a custom clock source provided by the user. | |
bool | isClockInitialized () |
Check if YARP clock is initialized. | |
bool | isSystemClock () |
Check if YARP is providing system time. | |
bool | isNetworkClock () |
Check if YARP is providing network time. | |
bool | isCustomClock () |
Check if YARP is using a user-defined custom time. | |
yarpClockType | getClockType () |
std::string | clockTypeToString (yarpClockType type) |
Converts clock type enum into string. | |
bool | isValid () |
Check if time is valid (non-zero). | |
std::string yarp::os::Time::clockTypeToString | ( | yarpClockType | type | ) |
Wait for a certain number of seconds.
This may be fractional.
seconds | the duration of the delay, in seconds |
yarpClockType yarp::os::Time::getClockType | ( | ) |
bool yarp::os::Time::isClockInitialized | ( | ) |
bool yarp::os::Time::isCustomClock | ( | ) |
bool yarp::os::Time::isNetworkClock | ( | ) |
bool yarp::os::Time::isSystemClock | ( | ) |
bool yarp::os::Time::isValid | ( | ) |
double yarp::os::Time::now | ( | ) |
Configure YARP clients to use a custom clock source provided by the user.
The Clock source must implement the yarp::os::Clock interface. This function check clock->isValid() to verify the source is working properly.
Possible causes of failure are: clock pointer invalid or isValid() false.
Throws assert in case of failure
void yarp::os::Time::useNetworkClock | ( | const std::string & | clock, |
const std::string & | localPortName = "" |
||
) |
Configure YARP to read time from a specified topic.
The same effect can also be achieved using the YARP_CLOCK environment variable. Topic should provide two integers, time in seconds followed by residual in nanoseconds. If yarp is configured according to Using YARP with ROS, then ROS /clock topic will work.
return true on success, false on failure. Possible causes of failure are invalid port name or address conflict.
Throws assert in case of failure
void yarp::os::Time::useSystemClock | ( | ) |