summaryrefslogtreecommitdiffhomepage
path: root/opentrack
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2014-10-27 07:58:43 +0100
committerStanislaw Halik <sthalik@misaki.pl>2014-10-27 07:58:43 +0100
commit8287c6ef473c7a33a45c708586ab68282df63e9d (patch)
treeced4689cf036a16c2f5de47894baeed6d7f68a73 /opentrack
parent56a78f48547081a1b20977596d842dadb710210e (diff)
Send origin pose to protocol on stopping
Requested-by: @Antmax
Diffstat (limited to 'opentrack')
-rw-r--r--opentrack/tracker.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/opentrack/tracker.cpp b/opentrack/tracker.cpp
index 24482bfc..7e6919a3 100644
--- a/opentrack/tracker.cpp
+++ b/opentrack/tracker.cpp
@@ -103,8 +103,6 @@ void Tracker::t_compensate(const cv::Matx33d& rmat, const double* xyz, double* o
void Tracker::logic()
{
- libs.pTracker->data(newpose);
-
if (enabledp)
for (int i = 0; i < 6; i++)
final_raw(i) = newpose[i];
@@ -196,6 +194,7 @@ void Tracker::run() {
{
t.start();
+ libs.pTracker->data(newpose);
logic();
double q = sleep_ms * 1000L;
@@ -204,6 +203,16 @@ void Tracker::run() {
usleep((long)q);
}
+ {
+ // do one last pass with origin pose
+ for (int i = 0; i < 6; i++)
+ newpose[i] = 0;
+ logic();
+ // filter may inhibit exact origin
+ Pose p;
+ libs.pProtocol->pose(p);
+ }
+
#if defined(_WIN32)
(void) timeEndPeriod(1);
#endif