Visual Servoing Platform
version 3.3.0 under development (2020-02-17)
|
Functions | |
VISP_EXPORT std::string | getDateTime (const std::string &format="%Y/%m/%d %H:%M:%S") |
VISP_EXPORT double | getMinTimeForUsleepCall () |
VISP_EXPORT double | measureTimeSecond () |
VISP_EXPORT double | measureTimeMs () |
VISP_EXPORT double | measureTimeMicros () |
VISP_EXPORT void | sleepMs (double t) |
VISP_EXPORT int | wait (double t0, double t) |
VISP_EXPORT void | wait (double t) |
Time management and measurement.
The example below shows how to synchronize a loop to a given framerate.
VISP_EXPORT std::string vpTime::getDateTime | ( | const std::string & | format | ) |
Return a string containing date and time.
[in] | format | : The string format supported by strftime() function that represents the time. The default format is the following "%Y/%m/%d %H:%M:%S" . This string contains any combination of special format specifiers given in the next table:
|
The following example shows how to use this function:
It produces the following output:
Definition at line 358 of file vpTime.cpp.
VISP_EXPORT double vpTime::getMinTimeForUsleepCall | ( | ) |
Definition at line 86 of file vpTime.cpp.
Referenced by vpRobotWireFrameSimulator::setSamplingTime(), vpSimulatorAfma6::updateArticularPosition(), and vpSimulatorViper850::updateArticularPosition().
VISP_EXPORT double vpTime::measureTimeMicros | ( | ) |
Return the time in microseconds since January 1st 1970.
Definition at line 93 of file vpTime.cpp.
References vpException::fatalError.
vpTime::measureTimeMs | ( | ) |
Return the time in milliseconds since January 1st 1970.
Definition at line 126 of file vpTime.cpp.
References vpException::fatalError.
Referenced by vpKeyPoint::computePose(), vpKeyPoint::detect(), vpKeyPoint::extract(), vpKeyPoint::match(), measureTimeSecond(), QPlot::plot(), vpQbSoftHand::setPosition(), vpSimulatorAfma6::setPosition(), vpChrono::start(), vpChrono::stop(), vpSimulatorAfma6::updateArticularPosition(), vpSimulatorViper850::updateArticularPosition(), vpSimulatorAfma6::vpSimulatorAfma6(), vpSimulatorViper850::vpSimulatorViper850(), wait(), and vpForceTorqueAtiNetFTSensor::waitForNewData().
VISP_EXPORT double vpTime::measureTimeSecond | ( | ) |
Return the measured time in seconds since January 1st 1970.
Definition at line 158 of file vpTime.cpp.
References measureTimeMs().
Referenced by vpSimulatorAfma6::getPosition(), vpSimulatorViper850::getPosition(), vpSimulatorAfma6::getVelocity(), vpSimulatorViper850::getVelocity(), and vpSickLDMRS::measure().
VISP_EXPORT void vpTime::sleepMs | ( | double | t | ) |
Sleep t miliseconds from now.
t | : Time to sleep in ms. |
Definition at line 271 of file vpTime.cpp.
References vpException::functionNotImplementedError.
Referenced by vpForceTorqueIitSensor::connected(), vpRobotBebop2::doFlatTrim(), vpPlot::navigate(), vpRobotBebop2::resetAllSettings(), vpRobotBebop2::setCameraOrientation(), vpRobotBebop2::setCameraPan(), vpRobotBebop2::setCameraTilt(), vpRobotBebop2::setExposure(), vpRobotBebop2::setPosition(), vpRobotViper650::setRobotState(), vpRobotViper850::setRobotState(), vpRobotBebop2::setStreamingMode(), vpRobotBebop2::setVideoResolution(), vpRobotBebop2::startStreaming(), vpRobotBebop2::stopStreaming(), vpRobotBebop2::takeOff(), and vpForceTorqueAtiNetFTSensor::waitForNewData().
VISP_EXPORT int vpTime::wait | ( | double | t0, |
double | t | ||
) |
Wait t miliseconds after t0 (in ms).
The waiting is done by a call to usleep() if the time to wait is greater than vpTime::minTimeForUsleepCall.
t0 | : reference time (in ms) |
t | : time to wait (in ms) |
Definition at line 173 of file vpTime.cpp.
References vpException::functionNotImplementedError, and measureTimeMs().
Referenced by vpVirtualGrabber::acquire(), vpRobotViper650::biasForceTorqueSensor(), vpRobotViper850::biasForceTorqueSensor(), vpServolens::getCameraParameters(), vpDisplayGTK::getClick(), vpDisplayGTK::getClickUp(), vpRobotWireFrameSimulator::getInternalView(), vpDisplayGTK::getKeyboardEvent(), vpSimulatorAfma6::init(), vpTemplateTrackerZone::initClick(), vpSimulator::initMainApplication(), vpPylonGrabberGigE::loadUserSet(), vpPylonGrabberUsb::loadUserSet(), vpSimulator::mainLoop(), vpClient::print(), vpServolens::reset(), vp1394TwoGrabber::resetBus(), vpPylonGrabberGigE::saveUserSet(), vpPylonGrabberUsb::saveUserSet(), vpFlyCaptureGrabber::setCameraPower(), vp1394TwoGrabber::setFormat7ROI(), vpQbSoftHand::setPosition(), vpSimulatorAfma6::setPosition(), vpForceTorqueIitSensor::startStreaming(), vpSimulatorAfma6::updateArticularPosition(), vpSimulatorViper850::updateArticularPosition(), and vpRobotBiclops::vpRobotBiclopsSpeedControlLoop().
VISP_EXPORT void vpTime::wait | ( | double | t | ) |
Wait t miliseconds from now.
The waiting is done by a call to usleep() if the time to wait is greater than vpTime::minTimeForUsleepCall.
t | : Time to wait in ms. |
Definition at line 224 of file vpTime.cpp.
References vpException::functionNotImplementedError, and measureTimeMs().