Skip to content

Commit

Permalink
FilteredDerivative: set initialised to false if sample interval is in…
Browse files Browse the repository at this point in the history
…valid

Signed-off-by: RomanBapst <[email protected]>
  • Loading branch information
RomanBapst committed May 31, 2024
1 parent 66199c9 commit 5f4c7e0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lib/mathlib/math/filter/FilteredDerivative.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ class FilteredDerivative
if (_initialized) {
if (_sample_interval > FLT_EPSILON) {
_alpha_filter.update((sample - _previous_sample) / _sample_interval);

} else {
_initialized = false;
}

} else {
Expand Down

0 comments on commit 5f4c7e0

Please sign in to comment.