summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt/ftnoir_tracker_pt.h
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-08-04 15:36:51 +0200
committerStanislaw Halik <sthalik@misaki.pl>2018-08-04 13:40:26 +0000
commita1356d3811ec57161f48e586f21c618f99a0b841 (patch)
tree770ec149eb429e71b1b1ef7d7550bb129a18f64d /tracker-pt/ftnoir_tracker_pt.h
parent299fb737fe711d00654ec5afe4cc2afdc742f279 (diff)
tracker/pt: fix center with dynamic pose set
It was necessary to center _twice_ in order to reset dynamic pose. Put a spinlock around the code.
Diffstat (limited to 'tracker-pt/ftnoir_tracker_pt.h')
-rw-r--r--tracker-pt/ftnoir_tracker_pt.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/tracker-pt/ftnoir_tracker_pt.h b/tracker-pt/ftnoir_tracker_pt.h
index 31bdc6bb..8cf609c3 100644
--- a/tracker-pt/ftnoir_tracker_pt.h
+++ b/tracker-pt/ftnoir_tracker_pt.h
@@ -39,7 +39,7 @@ class Tracker_PT : public QThread, public ITracker
public:
template<typename t> using pointer = pt_pointer<t>;
- Tracker_PT(pointer<pt_runtime_traits> const& pt_runtime_traits);
+ explicit Tracker_PT(pointer<pt_runtime_traits> const& pt_runtime_traits);
~Tracker_PT() override;
module_status start_tracker(QFrame* parent_window) override;
void data(double* data) override;
@@ -76,6 +76,7 @@ private:
std::atomic<unsigned> point_count { 0 };
std::atomic<bool> ever_success { false };
+ std::atomic_flag center_flag = ATOMIC_FLAG_INIT;
static constexpr inline f rad2deg = f(180/M_PI);
//static constexpr float deg2rad = float(M_PI/180);
@@ -83,4 +84,4 @@ private:
} // ns pt_impl
-using pt_module::Tracker_PT;
+using Tracker_PT = pt_module::Tracker_PT;