43 const double controlError =
50 "Cannot run at the expected rate: actual_rate=%.03f Hz " 51 "desired_rate=%.03f Hz",
62 if (validRateEstimate)
87 const double measuredPeriod = t_now -
m_lastTic;
mrpt::system::CTicTac m_tic
double Tac() noexcept
Stops the stopwatch.
bool sleep()
Sleeps for some time, such as the return of this method is 1/rate (seconds) after the return of the p...
double m_followErrorRatioForWarning
void setRate(const double rate_hz)
Changes the object loop rate (Hz)
bool internalUpdateRateEstimate()
Versatile class for consistent logging and management of output messages.
mrpt::system::CRateTimer m_ratetimer
the one control acts on
#define MRPT_LOG_THROTTLE_WARN_FMT(_PERIOD_SECONDS, _FMT_STRING,...)
void setRate(const double rate_hz)
Changes the object loop rate (Hz)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
double rate() const
Gets current rate (Hz)
double m_currentEstimatedRate
#define ASSERT_ABOVE_(__A, __B)
CControlledRateTimer(const double rate_hz=1.0)
Ctor: specifies the desired rate (Hz)
void Tic() noexcept
Starts the stopwatch.
double m_lastControlError
T saturate_val(const T &value, const T sat_min, const T sat_max)
Like saturate() but it returns the value instead of modifying the variable.
bool sleep()
Sleeps for some time, such as the return of this method is 1/rate (seconds) after the return of the p...