Go to the documentation of this file.
58 : options_(std::move(other.options_))
59 , sleepStartTime_(other.sleepStartTime_)
60 , sleepEndTime_(other.sleepEndTime_)
61 , stepTime_(other.stepTime_)
62 , numTimeSteps_(other.numTimeSteps_)
63 , numWarnings_(other.numWarnings_)
64 , numErrors_(other.numErrors_)
65 , lastWarningPrintTime_(other.lastWarningPrintTime_)
66 , lastErrorPrintTime_(other.lastErrorPrintTime_)
67 , awakeTime_(other.awakeTime_)
68 , awakeTimeMean_(other.awakeTimeMean_)
69 , awakeTimeM2_(other.awakeTimeM2_)
126 <<
"Number of errors: " <<
numErrors_ <<
".");
177 return std::numeric_limits<double>::quiet_NaN();
189 return std::numeric_limits<double>::quiet_NaN();
201 return std::numeric_limits<double>::quiet_NaN();
221 time.tv_nsec +=
static_cast<long int>(duration *
N_SEC_PER_SEC);
Rate(const std::string &name, const double timeStep)
std::atomic< clockid_t > clockId_
Linux clock ID.
std::atomic< bool > enforceRate_
Boolean indicating whether the rate should be enforced.
std::string name_
Name for printing.
unsigned int numWarnings_
Counter storing how many times a time step took longer than the warning threshold.
#define ROS_ERROR_STREAM(args)
double awakeTime_
Most recent time which elapsed between subsequent calls of sleep().
RateOptions options_
Rate options.
timespec lastWarningPrintTime_
Point in time when the last warning message was printed.
double awakeTimeMean_
Mean of the time which elapsed between subsequent calls of sleep().
std::atomic< double > maxTimeStepFactorError_
If the awake time is bigger than the time step multiplied by this factor, it counts as an error.
std::atomic< double > maxTimeStepFactorWarning_
If the awake time is bigger than the time step multiplied by this factor, it counts as an warning.
#define ROS_WARN_STREAM(args)
double getAwakeTimeMean() const
unsigned int numTimeSteps_
Counter storing how many times sleep has been called.
double awakeTimeM2_
Helper variable to compute the variance of the time step which elapsed between subsequent calls of sl...
timespec sleepEndTime_
Point in time when the most recent sleep() ended.
double getAwakeTime() const
double getAwakeTimeStdDev() const
unsigned int numErrors_
Counter storing how many times a time step took longer than the error threshold, not considering warn...
static void addDuration(timespec &time, const double duration)
std::atomic< double > timeStep_
Time step in seconds.
timespec lastErrorPrintTime_
Point in time when the last error message was printed.
static constexpr double SEC_PER_N_SEC
Factor storing seconds per nanoseconds.
static constexpr long int N_SEC_PER_SEC
Factor storing nanoseconds per seconds.
double getAwakeTimeVar() const
static double getDuration(const timespec &start, const timespec &end)
timespec sleepStartTime_
Point in time when the most recent sleep() started.
bota_worker
Author(s):
autogenerated on Sat Apr 15 2023 02:53:50