35 #ifndef CONTROL_TOOLBOX__FILTERS_H 36 #define CONTROL_TOOLBOX__FILTERS_H 45 static inline const T&
clamp(
const T &a,
const T &b,
const T &c)
47 return std::min<T>(std::max<T>(b, a), c);
52 static inline double exponentialSmoothing(
double current_raw_value,
double last_smoothed_value,
double alpha)
54 return alpha*current_raw_value + (1-alpha)*last_smoothed_value;
static const T & clamp(const T &a, const T &b, const T &c)
static double exponentialSmoothing(double current_raw_value, double last_smoothed_value, double alpha)