diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-02-08 16:06:47 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-02-08 19:19:06 +0100 |
commit | 9518808799cd34f3cd1497cdac5c163c1cbaf72b (patch) | |
tree | e3d58c1c63b6675daa086f7f4ed3cc36c11113ed /logic | |
parent | 6f878a4c46a4947bb34cbdb566a9d07b676ecc48 (diff) |
add post-invert, rename invert to pre-invert
Requested by: a few people
Diffstat (limited to 'logic')
-rw-r--r-- | logic/pipeline.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/logic/pipeline.cpp b/logic/pipeline.cpp index 2f88c8b1..2e8efe55 100644 --- a/logic/pipeline.cpp +++ b/logic/pipeline.cpp @@ -349,7 +349,7 @@ Pose pipeline::apply_center(const centering_state mode, Pose value) const for (int i = 0; i < 6; i++) // don't invert after reltrans // inverting here doesn't break centering - if (m(i).opts.invert) + if (m(i).opts.invert_pre) value(i) = -value(i); return value; @@ -391,7 +391,7 @@ Pose pipeline::maybe_apply_filter(const Pose& value) const Pose pipeline::apply_zero_pos(Pose value) const { for (int i = 0; i < 6; i++) - value(i) += m(i).opts.zero * (m(i).opts.invert ? -1 : 1); + value(i) += m(i).opts.zero * (m(i).opts.invert_pre ? -1 : 1); return value; } @@ -504,6 +504,10 @@ ok: last_value = value; value = apply_zero_pos(value); + for (int i = 0; i < 6; i++) + if (m(i).opts.invert_post) + value(i) = -value(i); + libs.pProtocol->pose(value, raw); QMutexLocker foo(&mtx); |