summaryrefslogtreecommitdiffhomepage
path: root/logic/pipeline.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-12-29 16:03:46 +0100
committerStanislaw Halik <sthalik@misaki.pl>2017-12-29 16:03:46 +0100
commita30b031eaa5cee9c8033679e2d628531ee2b0831 (patch)
tree6b78599e3d61f8db6899c4098614311e59ccbf6c /logic/pipeline.cpp
parent3467e2bec9babc944ccdbebbbecfa246efa382e3 (diff)
logic/pipeline: don't emit data on disabled axis
Issue: #707
Diffstat (limited to 'logic/pipeline.cpp')
-rw-r--r--logic/pipeline.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/logic/pipeline.cpp b/logic/pipeline.cpp
index 776d13bb..bab7f5e1 100644
--- a/logic/pipeline.cpp
+++ b/logic/pipeline.cpp
@@ -129,11 +129,13 @@ void pipeline::logic()
}
Pose value, raw;
+ bool disabled[6];
for (int i = 0; i < 6; i++)
{
auto& axis = m(i);
int k = axis.opts.src;
+ disabled[i] = k == 6;
if (k < 0 || k >= 6)
value(i) = 0;
else
@@ -326,6 +328,11 @@ void pipeline::logic()
for (int i = 0; i < 3; i++)
value(i) += neck(i) + rel(i);
+ // relative translation can move it
+ for (unsigned k = 0; k < 6; k++)
+ if (disabled[k])
+ value(k) = 0;
+
nanp |= is_nan(neck) | is_nan(rel) | is_nan(value);
}