35 #ifndef CONTROL_TOOLBOX__DITHER_HPP_
36 #define CONTROL_TOOLBOX__DITHER_HPP_
43 #include "rcutils/logging_macros.h"
74 bool init(
const double & amplitude,
const double & seed)
76 if (amplitude < 0.0) {
77 RCUTILS_LOG_ERROR(
"Dither amplitude not set properly. Amplitude must be >0.");
81 amplitude_ = amplitude;
84 generator_.seed(
static_cast<unsigned int>(seed));
92 static double generateRandomSeed()
94 std::random_device rdev{};
95 return static_cast<double>(rdev());
101 bool has_saved_value_;
102 std::mt19937 generator_;