diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-01-16 18:44:30 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-01-16 18:44:30 +0100 |
commit | 74c9709cfe4b131d31f204816451677fd3d0e4b0 (patch) | |
tree | 8fafffcf0e98bcfb09c1e2f87bc22db35e7c2b04 | |
parent | e752bebfde4cd00cae7294027d938cfdd8d93b1e (diff) |
filter/accela: simplify value<t> cast
-rw-r--r-- | filter-accela/ftnoir_filter_accela.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/filter-accela/ftnoir_filter_accela.cpp b/filter-accela/ftnoir_filter_accela.cpp index 652fb248..5d779402 100644 --- a/filter-accela/ftnoir_filter_accela.cpp +++ b/filter-accela/ftnoir_filter_accela.cpp @@ -35,18 +35,16 @@ void accela::filter(const double* input, double *output) return; } -#define cast(x) ((x)()) - - const double rot_t = cast(s.rot_sensitivity).cur(); - const double trans_t = cast(s.trans_sensitivity).cur(); + const double rot_t = s.rot_sensitivity().cur(); + const double trans_t = s.trans_sensitivity().cur(); const double dt = t.elapsed_seconds(); t.start(); - const double RC = cast(s.ewma).cur() / 1000.; // seconds + const double RC = s.ewma().cur() / 1000.; // seconds const double alpha = dt/(dt+RC); - const double rot_dz = cast(s.rot_deadzone).cur(); - const double trans_dz = cast(s.trans_deadzone).cur(); + const double rot_dz = s.rot_deadzone().cur(); + const double trans_dz = s.trans_deadzone().cur(); const slider_value nl = s.rot_nonlinearity; for (int i = 0; i < 6; i++) |