From 829b046649d3de6a37dd0983f3e3beb8f033e19e Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 26 Sep 2016 15:54:58 +0200 Subject: gui: remove several user-visible settings - dynamic pose is now enable iff current model is cap - dynamic pose timeout is now always 500 ms - fov is now always 75 --- gui/options-dialog.cpp | 28 ++- gui/settings.ui | 321 +++++++++++++++----------------- gui/wizard.cpp | 3 +- gui/wizard.h | 2 +- tracker-pt/ftnoir_tracker_pt.cpp | 16 +- tracker-pt/ftnoir_tracker_pt_settings.h | 8 +- tracker-pt/point_tracker.h | 4 +- 7 files changed, 174 insertions(+), 208 deletions(-) diff --git a/gui/options-dialog.cpp b/gui/options-dialog.cpp index d57b9f35..cc85319c 100755 --- a/gui/options-dialog.cpp +++ b/gui/options-dialog.cpp @@ -45,9 +45,9 @@ OptionsDialog::OptionsDialog(main_settings& main, connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel())); tie_setting(main.tray_enabled, ui.trayp); - + tie_setting(main.center_at_startup, ui.center_at_startup); - + tie_setting(pt.camera_mode, ui.camera_mode); tie_setting(pt.threshold, ui.threshold_slider); @@ -58,36 +58,32 @@ OptionsDialog::OptionsDialog(main_settings& main, tie_setting(pt.t_MH_x, ui.tx_spin); tie_setting(pt.t_MH_y, ui.ty_spin); tie_setting(pt.t_MH_z, ui.tz_spin); - - tie_setting(pt.fov, ui.camera_fov); - + tie_setting(pt.model_used, ui.model_used); - + connect(ui.ewma_slider, SIGNAL(valueChanged(int)), this, SLOT(update_ewma_display(int))); connect(ui.rotation_slider, SIGNAL(valueChanged(int)), this, SLOT(update_rot_display(int))); connect(ui.rot_dz_slider, SIGNAL(valueChanged(int)), this, SLOT(update_rot_dz_display(int))); connect(ui.translation_slider, SIGNAL(valueChanged(int)), this, SLOT(update_trans_display(int))); connect(ui.trans_dz_slider, SIGNAL(valueChanged(int)), this, SLOT(update_trans_dz_display(int))); - + tie_setting(acc.rot_threshold, ui.rotation_slider); tie_setting(acc.trans_threshold, ui.translation_slider); tie_setting(acc.ewma, ui.ewma_slider); tie_setting(acc.rot_deadzone, ui.rot_dz_slider); tie_setting(acc.trans_deadzone, ui.trans_dz_slider); - + update_rot_display(ui.rotation_slider->value()); update_trans_display(ui.translation_slider->value()); update_ewma_display(ui.ewma_slider->value()); update_rot_dz_display(ui.rot_dz_slider->value()); update_trans_dz_display(ui.trans_dz_slider->value()); - - tie_setting(pt.dynamic_pose, ui.dynamic_pose); - tie_setting(pt.init_phase_timeout, ui.init_phase_timeout); + tie_setting(pt.auto_threshold, ui.auto_threshold); - + connect(&timer,SIGNAL(timeout()), this,SLOT(poll_tracker_info())); connect( ui.tcalib_button,SIGNAL(toggled(bool)), this,SLOT(startstop_trans_calib(bool)) ); - + timer.start(100); tie_setting(main.tcomp_p, ui.tcomp_enable); @@ -106,7 +102,7 @@ OptionsDialog::OptionsDialog(main_settings& main, tie_setting(main.a_x.src, ui.src_x); tie_setting(main.a_y.src, ui.src_y); tie_setting(main.a_z.src, ui.src_z); - + tie_setting(main.camera_yaw, ui.camera_yaw); tie_setting(main.camera_pitch, ui.camera_pitch); tie_setting(main.camera_roll, ui.camera_roll); @@ -121,7 +117,7 @@ OptionsDialog::OptionsDialog(main_settings& main, ui.center_text->setText(kopts_to_string(main.key_center)); ui.toggle_text->setText(kopts_to_string(main.key_toggle)); ui.zero_text->setText(kopts_to_string(main.key_zero)); - + ui.start_tracking_text->setText(kopts_to_string(main.key_start_tracking)); ui.stop_tracking_text->setText(kopts_to_string(main.key_stop_tracking)); ui.toggle_tracking_text->setText(kopts_to_string(main.key_toggle_tracking)); @@ -190,7 +186,7 @@ void OptionsDialog::startstop_trans_calib(bool start) ui.tcalib_button->setChecked(false); return; } - + if (start) { qDebug()<<"TrackerDialog:: Starting translation calibration"; diff --git a/gui/settings.ui b/gui/settings.ui index 59c98e96..3f4ca1c6 100755 --- a/gui/settings.ui +++ b/gui/settings.ui @@ -245,29 +245,34 @@ Camera - + Device - - - - Dynamic pose resolution + + + + + 16 + 0 + - - - - - + Mode + + + 10 + 0 + + 640x480, 75 Hz @@ -290,54 +295,6 @@ - - - - Mode - - - - - - - - 56° - - - - - 75° - - - - - - - - Field of view - - - - - - - Dynamic pose timeout - - - - - - - ms - - - 1 - - - 10000 - - - @@ -519,6 +476,115 @@ + + + + Camera offset + + + + + + <html><head/><body><p>Specify an angle for off-center camera as a basis for which direction is which, avoiding axis interconnect. Also see <a href="https://github.com/opentrack/opentrack/wiki/choosing-camera-offset"><span style=" text-decoration: underline; color:#0000ff;">description on wiki</span></a>.</p></body></html> + + + Qt::AlignJustify|Qt::AlignVCenter + + + true + + + 2 + + + true + + + + + + + QGroupBox +{ + border: 0; +} + + + + + + Roll + + + + + + + + 80 + 0 + + + + -180 + + + 180 + + + + + + + + 80 + 0 + + + + -180 + + + 180 + + + + + + + Pitch + + + + + + + + 80 + 0 + + + + -180 + + + 180 + + + + + + + Yaw + + + + + + + + + @@ -559,6 +625,12 @@ + + + 0 + 0 + + QComboBox::AdjustToMinimumContentsLength @@ -732,115 +804,6 @@ - - - - Camera offset - - - - - - <html><head/><body><p>Specify an angle for off-center camera as a basis for which direction is which, avoiding axis interconnect. Also see <a href="https://github.com/opentrack/opentrack/wiki/choosing-camera-offset"><span style=" text-decoration: underline; color:#0000ff;">description on wiki</span></a>.</p></body></html> - - - Qt::AlignJustify|Qt::AlignVCenter - - - true - - - 2 - - - true - - - - - - - QGroupBox -{ - border: 0; -} - - - - - - Roll - - - - - - - - 80 - 0 - - - - -180 - - - 180 - - - - - - - - 80 - 0 - - - - -180 - - - 180 - - - - - - - Pitch - - - - - - - - 80 - 0 - - - - -180 - - - 180 - - - - - - - Yaw - - - - - - - - - @@ -1747,8 +1710,27 @@ tabWidget + bind_center + bind_toggle + bind_zero + bind_start + bind_stop + bind_toggle_tracking center_at_startup trayp + camera_mode + auto_threshold + threshold_slider + mindiam_spin + maxdiam_spin + camera_yaw + camera_pitch + camera_roll + model_used + tx_spin + ty_spin + tz_spin + tcalib_button tcomp_enable tcomp_rz src_yaw @@ -1763,6 +1745,11 @@ invert_y src_z invert_z + ewma_slider + rotation_slider + rot_dz_slider + translation_slider + trans_dz_slider diff --git a/gui/wizard.cpp b/gui/wizard.cpp index 7e394858..4075e695 100644 --- a/gui/wizard.cpp +++ b/gui/wizard.cpp @@ -3,7 +3,7 @@ #include "tracker-pt/ftnoir_tracker_pt_settings.h" #include "filter-accela/ftnoir_filter_accela.h" -Wizard::Wizard() : QWizard(nullptr) +Wizard::Wizard(QWidget* parent) : QWizard(parent) { ui.setupUi(this); connect(this, SIGNAL(accepted()), this, SLOT(set_data())); @@ -66,7 +66,6 @@ void Wizard::set_data() pt.threshold = 31; pt.min_point_size = 1.5; pt.max_point_size = 50; - pt.fov = 1; pt.camera_mode = 0; pt.model_used = m; pt.b->save(); diff --git a/gui/wizard.h b/gui/wizard.h index 9d359172..bb518788 100644 --- a/gui/wizard.h +++ b/gui/wizard.h @@ -12,7 +12,7 @@ class Wizard : public QWizard Q_OBJECT Ui_wizard ui; public: - Wizard(); + Wizard(QWidget* parent = nullptr); enum Model { Cap = 0, ClipRight = 1, ClipLeft = 2 }; enum { ClipRightX = 135, ClipLeftX = -135 }; diff --git a/tracker-pt/ftnoir_tracker_pt.cpp b/tracker-pt/ftnoir_tracker_pt.cpp index 8b0075d1..04d5b526 100755 --- a/tracker-pt/ftnoir_tracker_pt.cpp +++ b/tracker-pt/ftnoir_tracker_pt.cpp @@ -58,17 +58,7 @@ void Tracker_PT::reset_command(Command command) bool Tracker_PT::get_focal_length(double& ret) { - int fov_; - switch (s.fov) - { - default: - case 0: - fov_ = 56; - break; - case 1: - fov_ = 75; - break; - } + static constexpr const double fov_ = 75; QMutexLocker l(&camera_mtx); CamInfo info; @@ -135,8 +125,8 @@ void Tracker_PT::run() point_tracker.track(points, PointModel(s), fx, - s.dynamic_pose, - s.init_phase_timeout, + s.model_used == PointModel::Cap, + 500, info.res_x, info.res_y); ever_success = true; diff --git a/tracker-pt/ftnoir_tracker_pt_settings.h b/tracker-pt/ftnoir_tracker_pt_settings.h index d2f19276..72816f98 100644 --- a/tracker-pt/ftnoir_tracker_pt_settings.h +++ b/tracker-pt/ftnoir_tracker_pt_settings.h @@ -18,11 +18,8 @@ struct settings_pt : opts value min_point_size, max_point_size; value t_MH_x, t_MH_y, t_MH_z; - value fov, camera_mode; - value model_used; + value camera_mode, model_used; - value dynamic_pose; - value init_phase_timeout; value auto_threshold; settings_pt() : @@ -33,11 +30,8 @@ struct settings_pt : opts t_MH_x(b, "model-centroid-x", 0), t_MH_y(b, "model-centroid-y", 0), t_MH_z(b, "model-centroid-z", 0), - fov(b, "camera-fov", 1), camera_mode(b, "camera-mode", 0), model_used(b, "model-used", 0), - dynamic_pose(b, "dynamic-pose-resolution", true), - init_phase_timeout(b, "init-phase-timeout", 500), auto_threshold(b, "automatic-threshold", false) {} }; diff --git a/tracker-pt/point_tracker.h b/tracker-pt/point_tracker.h index 77c07125..e3ad81b6 100644 --- a/tracker-pt/point_tracker.h +++ b/tracker-pt/point_tracker.h @@ -55,6 +55,8 @@ class PointModel { friend class PointTracker; public: + enum { Cap = 0, ClipRight = 1, ClipLeft = 2 }; + static constexpr int N_POINTS = 3; cv::Vec3d M01; // M01 in model frame @@ -80,8 +82,6 @@ public: void set_model(settings_pt& s) { - enum { Cap = 0, ClipRight = 1, ClipLeft = 2 }; - switch (s.model_used) { default: -- cgit v1.2.3