summaryrefslogtreecommitdiffhomepage
path: root/FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp
diff options
context:
space:
mode:
authorWim Vriend <facetracknoir@gmail.com>2013-01-02 18:54:06 +0000
committerWim Vriend <facetracknoir@gmail.com>2013-01-02 18:54:06 +0000
commitc681889ab4c37bfd0f049177459b7fda380fda51 (patch)
treef6072db0b2328b4df9e5214e3578baa43792b48e /FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp
parent9593aa9c3c231add3dadabf0a1ea9f8182f88a79 (diff)
Added 'enable axis' parameters to the Trackers. Added 'none' to filter-listbox.
git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@203 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb
Diffstat (limited to 'FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp')
-rw-r--r--FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp38
1 files changed, 30 insertions, 8 deletions
diff --git a/FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp b/FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp
index 13522863..412d35d4 100644
--- a/FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp
+++ b/FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp
@@ -109,7 +109,16 @@ void Tracker::apply(const TrackerSettings& settings)
sleep_time = settings.sleep_time;
point_tracker.dt_reset = settings.reset_time / 1000.0;
draw_frame = settings.video_widget;
+
+ bEnableRoll = settings.bEnableRoll;
+ bEnablePitch = settings.bEnablePitch;
+ bEnableYaw = settings.bEnableYaw;
+ bEnableX = settings.bEnableX;
+ bEnableY = settings.bEnableY;
+ bEnableZ = settings.bEnableZ;
+
t_MH = settings.t_MH;
+ qDebug()<<"Tracker::apply ends";
}
void Tracker::reset()
@@ -189,12 +198,19 @@ bool Tracker::GiveHeadPoseData(THeadPoseData *data)
Matx33f R = X_CH.R * X_CH_0.R.t();
Vec3f t = X_CH.t - X_CH_0.t;
- // get translation
- data->x = t[0] / 10.0; // convert to cm
- data->y = t[1] / 10.0;
- data->z = t[2] / 10.0;
+ // get translation(s)
+ if (bEnableX) {
+ data->x = t[0] / 10.0; // convert to cm
+ }
- // translate rotatation matrix from opengl (G) to roll-pitch-yaw (R) frame
+ if (bEnableY) {
+ data->y = t[1] / 10.0;
+ }
+ if (bEnableZ) {
+ data->z = t[2] / 10.0;
+ }
+
+ // translate rotation matrix from opengl (G) to roll-pitch-yaw (R) frame
// -z -> x, y -> z, x -> -y
Matx33f R_RG( 0, 0,-1,
-1, 0, 0,
@@ -208,9 +224,15 @@ bool Tracker::GiveHeadPoseData(THeadPoseData *data)
alpha = atan2( R(1,0), R(0,0));
gamma = atan2( R(2,1), R(2,2));
- data->yaw = rad2deg * alpha;
- data->pitch = -rad2deg * beta; // this is what ftnoir expects?
- data->roll = rad2deg * gamma;
+ if (bEnableYaw) {
+ data->yaw = rad2deg * alpha;
+ }
+ if (bEnablePitch) {
+ data->pitch = -rad2deg * beta; // this is what ftnoir expects?
+ }
+ if (bEnableRoll) {
+ data->roll = rad2deg * gamma;
+ }
}
return true;
}