summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-10-06 15:15:12 +0200
committerStanislaw Halik <sthalik@misaki.pl>2022-10-10 10:31:57 +0200
commitd63bbbb164dd3285f3ea8f22a568fdcd381da612 (patch)
tree876d4db6b8c8084ae54e36967d4a8dd9d7bda022
parentb25624892d4e5b12a953e2936e59d2af5d654b21 (diff)
filter/accela: fix accidentally clamping position data
Introduced in: 7252c001 Tested by: @Pieloth Issue: #1349
-rw-r--r--filter-accela/ftnoir_filter_accela.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/filter-accela/ftnoir_filter_accela.cpp b/filter-accela/ftnoir_filter_accela.cpp
index d3464f7b..940ac50c 100644
--- a/filter-accela/ftnoir_filter_accela.cpp
+++ b/filter-accela/ftnoir_filter_accela.cpp
@@ -154,7 +154,8 @@ void accela::filter(const double* input, double *output)
{
output[k] *= dt;
output[k] += last_output[k];
- if (fabs(output[k]) > half_turn) output[k] -= copysign(full_turn, output[k]);
+ if (k >= Yaw && fabs(output[k]) > half_turn)
+ output[k] -= copysign(full_turn, output[k]);
last_output[k] = output[k];
}