From 9e702a479ef172e816f8d0e319891ef7c6bea503 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Wed, 20 Nov 2024 22:07:05 +0000 Subject: [PATCH] Fix bug in memory old outputs --- include/control_filters/rate_limiter.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/control_filters/rate_limiter.hpp b/include/control_filters/rate_limiter.hpp index 16a93fd7..6e002c03 100644 --- a/include/control_filters/rate_limiter.hpp +++ b/include/control_filters/rate_limiter.hpp @@ -132,8 +132,9 @@ bool RateLimiter::update(const T & data_in, T & data_out) } T v = data_in; limiter->limit(v, v0, v1, static_cast(parameters_.sampling_interval)); + // shift the values for the next update call v1 = v0; - v0 = data_in; + v0 = v; // use the limited value data_out = v; return true; }