summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_tracker_aruco
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2014-07-11 20:07:57 +0200
committerStanislaw Halik <sthalik@misaki.pl>2014-07-11 20:07:57 +0200
commit578f1fbba96fe238430605907abf0e98e035cf20 (patch)
treeef280c78b1687fec92e794023de236fddc0d4e20 /ftnoir_tracker_aruco
parent4dc41d3d8642d90d52b667dd05b4f99735f83a37 (diff)
rm explicit switch, use timer state
Diffstat (limited to 'ftnoir_tracker_aruco')
-rw-r--r--ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp8
-rw-r--r--ftnoir_tracker_aruco/ftnoir_tracker_aruco.h1
2 files changed, 3 insertions, 6 deletions
diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp
index 756278cd..c3c8170c 100644
--- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp
+++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp
@@ -457,7 +457,6 @@ extern "C" FTNOIR_TRACKER_BASE_EXPORT ITrackerDialog* CALLING_CONVENTION GetDial
TrackerControls::TrackerControls()
{
tracker = nullptr;
- calibrating = false;
calib_timer.setInterval(100);
ui.setupUi(this);
setAttribute(Qt::WA_NativeWindow, true);
@@ -487,19 +486,18 @@ TrackerControls::TrackerControls()
void TrackerControls::toggleCalibrate()
{
- if (!calibrating)
+ if (!calib_timer.isActive())
{
calibrator.reset();
calib_timer.start();
} else {
cleanupCalib();
}
- calibrating = !calibrating;
}
void TrackerControls::cleanupCalib()
{
- if (calibrating)
+ if (calib_timer.isActive())
{
calib_timer.stop();
auto pos = calibrator.get_estimate() * .1;
@@ -511,7 +509,7 @@ void TrackerControls::cleanupCalib()
void TrackerControls::update_tracker_calibration()
{
- if (calibrating && tracker)
+ if (calib_timer.isActive() && tracker)
{
cv::Matx33f r;
cv::Vec3f t;
diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h
index f1fcc326..f2207aef 100644
--- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h
+++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h
@@ -91,7 +91,6 @@ private:
Tracker* tracker;
settings s;
TranslationCalibrator calibrator;
- bool calibrating;
QTimer calib_timer;
private slots:
void doOK();