59 void setRate(
const double rate_hz);
mrpt::system::CTicTac m_tic
A class for calling sleep() in a loop, such that the amount of sleep time will be computed to make th...
double estimatedRate() const
Gets the latest estimated run rate (Hz), which comes from actual period measurement, low-pass filtered.
A high-performance stopwatch, with typical resolution of nanoseconds.
double lowPassParam_a0() const
Low-pass filter a0 value [default=0.9]: estimation = a0*input + (1-a0)*former_estimation.
void lowPassParam_a0(double v)
void controllerParam_Kp(double v)
double m_followErrorRatioForWarning
A class for calling sleep() in a loop, such that the amount of sleep time will be computed to make th...
void setRate(const double rate_hz)
Changes the object loop rate (Hz)
bool internalUpdateRateEstimate()
Versatile class for consistent logging and management of output messages.
double controllerParam_Ti() const
PI controller Ti parameter [default=0.0194].
double estimatedRateRaw() const
Last actual execution rate measured (Hz), without low-pass filtering.
mrpt::system::CRateTimer m_ratetimer
the one control acts on
double controllerParam_Kp() const
PI controller Kp parameter [default=1.0].
#define ASSERT_ABOVEEQ_(__A, __B)
void followErrorRatioToRaiseWarning(double v)
double rate() const
Gets current rate (Hz)
double m_currentEstimatedRate
#define ASSERT_ABOVE_(__A, __B)
virtual ~CControlledRateTimer()=default
Dtor.
double followErrorRatioToRaiseWarning() const
Get/set ratio threshold for issuing a warning (via COutputLogger interface) if the achieved rate is n...
CControlledRateTimer(const double rate_hz=1.0)
Ctor: specifies the desired rate (Hz)
#define ASSERT_BELOWEQ_(__A, __B)
double m_lastControlError
double actualControlledRate() const
Gets the actual controller output: the rate (Hz) of the internal CRateTimer object.
bool sleep()
Sleeps for some time, such as the return of this method is 1/rate (seconds) after the return of the p...
void controllerParam_Ti(double v)