summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp8
-rw-r--r--FTNoIR_Tracker_PT/ftnoir_tracker_pt.h2
-rw-r--r--ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp4
-rw-r--r--ftnoir_tracker_aruco/ftnoir_tracker_aruco.h2
-rw-r--r--ftnoir_tracker_base/ftnoir_tracker_base.h2
-rw-r--r--ftnoir_tracker_hatire/ftnoir_tracker_hat.cpp7
-rw-r--r--ftnoir_tracker_hatire/ftnoir_tracker_hat.h2
-rw-r--r--ftnoir_tracker_ht/ftnoir_tracker_ht.cpp7
-rw-r--r--ftnoir_tracker_ht/ftnoir_tracker_ht.h2
-rw-r--r--ftnoir_tracker_hydra/ftnoir_tracker_hydra.cpp4
-rw-r--r--ftnoir_tracker_hydra/ftnoir_tracker_hydra.h2
-rw-r--r--ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp10
-rw-r--r--ftnoir_tracker_joystick/ftnoir_tracker_joystick.h2
-rw-r--r--ftnoir_tracker_rift/ftnoir_tracker_rift.cpp3
-rw-r--r--ftnoir_tracker_rift/ftnoir_tracker_rift.h2
-rw-r--r--ftnoir_tracker_udp/ftnoir_tracker_udp.cpp3
-rw-r--r--ftnoir_tracker_udp/ftnoir_tracker_udp.h2
-rw-r--r--opentrack-api/opentrack.h2
-rw-r--r--opentrack-api/trackers.cpp5
19 files changed, 28 insertions, 43 deletions
diff --git a/FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp b/FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp
index 5cb7bdf3..a6aaa29c 100644
--- a/FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp
+++ b/FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp
@@ -233,12 +233,12 @@ void Tracker::StopTracker(bool exit)
#define THeadPoseData double
#endif
-bool Tracker::GiveHeadPoseData(THeadPoseData *data)
+void Tracker::GiveHeadPoseData(THeadPoseData *data)
{
{
QMutexLocker lock(&mutex);
- if (!tracking_valid) return false;
+ if (!tracking_valid) return;
FrameTrafo X_CM = point_tracker.get_pose();
FrameTrafo X_MH(Matx33f::eye(), t_MH);
@@ -280,7 +280,9 @@ bool Tracker::GiveHeadPoseData(THeadPoseData *data)
if (bEnableRoll) data[Roll] = rad2deg * gamma;
#endif
}
- return true;
+#ifndef OPENTRACK_API
+ return true;
+#endif
}
//-----------------------------------------------------------------------------
diff --git a/FTNoIR_Tracker_PT/ftnoir_tracker_pt.h b/FTNoIR_Tracker_PT/ftnoir_tracker_pt.h
index 64f282b6..5c8d35d2 100644
--- a/FTNoIR_Tracker_PT/ftnoir_tracker_pt.h
+++ b/FTNoIR_Tracker_PT/ftnoir_tracker_pt.h
@@ -44,7 +44,7 @@ public:
virtual void Initialize(QFrame *videoframe);
#ifdef OPENTRACK_API
virtual void StartTracker(QFrame* parent_window);
- virtual bool GiveHeadPoseData(double* data);
+ virtual void GiveHeadPoseData(double* data);
#else
virtual void StartTracker(HWND parent_window);
virtual void StopTracker(bool exit);
diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp
index 7581b77a..11916df5 100644
--- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp
+++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp
@@ -375,7 +375,7 @@ void Tracker::run()
}
}
-bool Tracker::GiveHeadPoseData(double *data)
+void Tracker::GiveHeadPoseData(double *data)
{
QMutexLocker lck(&mtx);
@@ -391,8 +391,6 @@ bool Tracker::GiveHeadPoseData(double *data)
data[TY] = pose[TY];
if (enableTZ)
data[TZ] = pose[TZ];
-
- return true;
}
class TrackerDll : public Metadata
diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h
index 1518ba4d..8a480d9f 100644
--- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h
+++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h
@@ -26,7 +26,7 @@ public:
Tracker();
virtual ~Tracker();
void StartTracker(QFrame* frame);
- bool GiveHeadPoseData(double *data);
+ void GiveHeadPoseData(double *data);
bool enableTX, enableTY, enableTZ, enableRX, enableRY, enableRZ;
void run();
void load_settings();
diff --git a/ftnoir_tracker_base/ftnoir_tracker_base.h b/ftnoir_tracker_base/ftnoir_tracker_base.h
index 38c24afe..e6e770ed 100644
--- a/ftnoir_tracker_base/ftnoir_tracker_base.h
+++ b/ftnoir_tracker_base/ftnoir_tracker_base.h
@@ -43,7 +43,7 @@ struct ITracker
{
virtual ~ITracker() = 0;
virtual void StartTracker( QFrame* frame ) = 0;
- virtual bool GiveHeadPoseData(double *data) = 0;
+ virtual void GiveHeadPoseData(double *data) = 0;
virtual int preferredHz() { return 66; }
};
diff --git a/ftnoir_tracker_hatire/ftnoir_tracker_hat.cpp b/ftnoir_tracker_hatire/ftnoir_tracker_hat.cpp
index b933dd14..bcef6753 100644
--- a/ftnoir_tracker_hatire/ftnoir_tracker_hat.cpp
+++ b/ftnoir_tracker_hatire/ftnoir_tracker_hat.cpp
@@ -323,7 +323,7 @@ void FTNoIR_Tracker::StartTracker(QFrame*)
#define THeadPoseData double
#endif
-bool FTNoIR_Tracker::GiveHeadPoseData(THeadPoseData *data)
+void FTNoIR_Tracker::GiveHeadPoseData(THeadPoseData *data)
{
QMutexLocker lck(&mutex);
while (dataRead.length()>=30) {
@@ -354,7 +354,7 @@ bool FTNoIR_Tracker::GiveHeadPoseData(THeadPoseData *data)
if (CptError>50) {
emit sendMsgInfo("Can't find HAT frame") ;
CptError=0;
- return false;
+ return;
}
#ifdef OPENTRACK_API
data[frame_cnt] = (long) HAT.Code;
@@ -425,9 +425,6 @@ bool FTNoIR_Tracker::GiveHeadPoseData(THeadPoseData *data)
// For debug
//data->x=dataRead.length();
//data->y=CptError;
-
- return true;
-
}
diff --git a/ftnoir_tracker_hatire/ftnoir_tracker_hat.h b/ftnoir_tracker_hatire/ftnoir_tracker_hat.h
index a1b4ecda..04c5fb61 100644
--- a/ftnoir_tracker_hatire/ftnoir_tracker_hat.h
+++ b/ftnoir_tracker_hatire/ftnoir_tracker_hat.h
@@ -29,7 +29,7 @@ public:
#ifdef OPENTRACK_API
virtual void StartTracker(QFrame*);
- virtual bool GiveHeadPoseData(double* data);
+ virtual void GiveHeadPoseData(double* data);
#else
void Initialize( QFrame *videoframe );
virtual void StartTracker(HWND parent_window);
diff --git a/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp b/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp
index c08af00b..c3c12005 100644
--- a/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp
+++ b/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp
@@ -186,10 +186,8 @@ void Tracker::StartTracker(QFrame* videoframe)
#endif
}
-bool Tracker::GiveHeadPoseData(double *data)
+void Tracker::GiveHeadPoseData(double *data)
{
- bool ret = false;
-
lck_shm.lock();
shm->timer = 0;
if (shm->frame.width > 0)
@@ -213,7 +211,6 @@ bool Tracker::GiveHeadPoseData(double *data)
data[TY] = shm->result.ty;
if (enableTZ)
data[TZ] = shm->result.tz;
- ret = true;
if (fabs(data[Yaw]) > 60 || fabs(data[Pitch]) > 50 || fabs(data[Roll]) > 40)
{
shm->pause = true;
@@ -222,8 +219,6 @@ bool Tracker::GiveHeadPoseData(double *data)
shm->pause = false;
}
lck_shm.unlock();
-
- return ret;
}
//-----------------------------------------------------------------------------
diff --git a/ftnoir_tracker_ht/ftnoir_tracker_ht.h b/ftnoir_tracker_ht/ftnoir_tracker_ht.h
index c19e2d93..475d5a6c 100644
--- a/ftnoir_tracker_ht/ftnoir_tracker_ht.h
+++ b/ftnoir_tracker_ht/ftnoir_tracker_ht.h
@@ -23,7 +23,7 @@ public:
Tracker();
virtual ~Tracker();
void StartTracker(QFrame* frame);
- bool GiveHeadPoseData(double *data);
+ void GiveHeadPoseData(double *data);
bool enableTX, enableTY, enableTZ, enableRX, enableRY, enableRZ;
ht_shm_t* shm;
private:
diff --git a/ftnoir_tracker_hydra/ftnoir_tracker_hydra.cpp b/ftnoir_tracker_hydra/ftnoir_tracker_hydra.cpp
index 86ca8888..11a3e0fb 100644
--- a/ftnoir_tracker_hydra/ftnoir_tracker_hydra.cpp
+++ b/ftnoir_tracker_hydra/ftnoir_tracker_hydra.cpp
@@ -66,7 +66,7 @@ void Hydra_Tracker::StartTracker(QFrame*)
}
-bool Hydra_Tracker::GiveHeadPoseData(double *data)
+void Hydra_Tracker::GiveHeadPoseData(double *data)
{
sixenseSetActiveBase(0);
@@ -109,8 +109,6 @@ bool Hydra_Tracker::GiveHeadPoseData(double *data)
if (bEnableRoll) {
data[Roll] = newHeadPose[Roll] * 57.295781f;
}
-
- return true;
}
diff --git a/ftnoir_tracker_hydra/ftnoir_tracker_hydra.h b/ftnoir_tracker_hydra/ftnoir_tracker_hydra.h
index 3daaf239..6e40b710 100644
--- a/ftnoir_tracker_hydra/ftnoir_tracker_hydra.h
+++ b/ftnoir_tracker_hydra/ftnoir_tracker_hydra.h
@@ -12,7 +12,7 @@ public:
~Hydra_Tracker();
void StartTracker(QFrame *) virt_override;
- bool GiveHeadPoseData(double *data) virt_override;
+ void GiveHeadPoseData(double *data) virt_override;
void loadSettings();
volatile bool should_quit;
protected:
diff --git a/ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp b/ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp
index 66138e90..8f5ac162 100644
--- a/ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp
+++ b/ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp
@@ -175,13 +175,13 @@ fail:
qDebug() << "joy init failure";
}
-bool FTNoIR_Tracker::GiveHeadPoseData(double *data)
+void FTNoIR_Tracker::GiveHeadPoseData(double *data)
{
QMutexLocker foo(&mtx);
DIJOYSTATE js = {0};
if( !g_pDI || !g_pJoystick)
- return false;
+ return;
auto hr = g_pJoystick->Poll();
if( FAILED( hr ))
@@ -190,11 +190,11 @@ bool FTNoIR_Tracker::GiveHeadPoseData(double *data)
for (int i = 0; hr == DIERR_INPUTLOST && i < 200; i++)
hr = g_pJoystick->Acquire();
if (hr != DI_OK)
- return false;
+ return;
}
if( FAILED( hr = g_pJoystick->GetDeviceState( sizeof( js ), &js ) ) )
- return false;
+ return;
const LONG values[] = {
js.lRx,
@@ -232,8 +232,6 @@ bool FTNoIR_Tracker::GiveHeadPoseData(double *data)
data[i] = val * limits[i] / (double) (val >= 0 ? max : min);
}
}
-
- return true;
}
void FTNoIR_Tracker::loadSettings() {
diff --git a/ftnoir_tracker_joystick/ftnoir_tracker_joystick.h b/ftnoir_tracker_joystick/ftnoir_tracker_joystick.h
index cdf4fc7b..809d8c73 100644
--- a/ftnoir_tracker_joystick/ftnoir_tracker_joystick.h
+++ b/ftnoir_tracker_joystick/ftnoir_tracker_joystick.h
@@ -42,7 +42,7 @@ public:
~FTNoIR_Tracker();
void StartTracker(QFrame *frame);
- bool GiveHeadPoseData(double *data);
+ void GiveHeadPoseData(double *data);
void loadSettings();
LPDIRECTINPUT8 g_pDI;
LPDIRECTINPUTDEVICE8 g_pJoystick;
diff --git a/ftnoir_tracker_rift/ftnoir_tracker_rift.cpp b/ftnoir_tracker_rift/ftnoir_tracker_rift.cpp
index 4816cea4..c3b313ca 100644
--- a/ftnoir_tracker_rift/ftnoir_tracker_rift.cpp
+++ b/ftnoir_tracker_rift/ftnoir_tracker_rift.cpp
@@ -68,7 +68,7 @@ void Rift_Tracker::StartTracker(QFrame*)
}
-bool Rift_Tracker::GiveHeadPoseData(double *data)
+void Rift_Tracker::GiveHeadPoseData(double *data)
{
if (pSFusion != NULL && pSensor != NULL) {
Quatf hmdOrient = pSFusion->GetOrientation();
@@ -113,7 +113,6 @@ bool Rift_Tracker::GiveHeadPoseData(double *data)
data[Roll] = newHeadPose[Roll] * 57.295781f;
}
}
- return pSensor != NULL;
}
diff --git a/ftnoir_tracker_rift/ftnoir_tracker_rift.h b/ftnoir_tracker_rift/ftnoir_tracker_rift.h
index 7a4533d3..33e6f5cd 100644
--- a/ftnoir_tracker_rift/ftnoir_tracker_rift.h
+++ b/ftnoir_tracker_rift/ftnoir_tracker_rift.h
@@ -15,7 +15,7 @@ public:
virtual ~Rift_Tracker() virt_override;
void StartTracker(QFrame *) virt_override;
- bool GiveHeadPoseData(double *data) virt_override;
+ void GiveHeadPoseData(double *data) virt_override;
void loadSettings();
virtual int preferredHz() virt_override { return 250; }
volatile bool should_quit;
diff --git a/ftnoir_tracker_udp/ftnoir_tracker_udp.cpp b/ftnoir_tracker_udp/ftnoir_tracker_udp.cpp
index 1539707e..d58341a6 100644
--- a/ftnoir_tracker_udp/ftnoir_tracker_udp.cpp
+++ b/ftnoir_tracker_udp/ftnoir_tracker_udp.cpp
@@ -110,7 +110,7 @@ void FTNoIR_Tracker::StartTracker(QFrame*)
return;
}
-bool FTNoIR_Tracker::GiveHeadPoseData(double *data)
+void FTNoIR_Tracker::GiveHeadPoseData(double *data)
{
mutex.lock();
if (bEnableX) {
@@ -132,7 +132,6 @@ bool FTNoIR_Tracker::GiveHeadPoseData(double *data)
data[Roll] = newHeadPose[Roll];
}
mutex.unlock();
- return true;
}
//
diff --git a/ftnoir_tracker_udp/ftnoir_tracker_udp.h b/ftnoir_tracker_udp/ftnoir_tracker_udp.h
index d158630b..7b6c5328 100644
--- a/ftnoir_tracker_udp/ftnoir_tracker_udp.h
+++ b/ftnoir_tracker_udp/ftnoir_tracker_udp.h
@@ -16,7 +16,7 @@ public:
~FTNoIR_Tracker();
void StartTracker(QFrame *);
- bool GiveHeadPoseData(double *data);
+ void GiveHeadPoseData(double *data);
void loadSettings();
volatile bool should_quit;
protected:
diff --git a/opentrack-api/opentrack.h b/opentrack-api/opentrack.h
index 990b6aa4..88ba6cf0 100644
--- a/opentrack-api/opentrack.h
+++ b/opentrack-api/opentrack.h
@@ -50,7 +50,7 @@ OPENTRACK_EXPORT const char** opentrack_enum_trackers(opentrack self);
*/
OPENTRACK_EXPORT opentrack_tracker opentrack_make_tracker(opentrack ctx, const char* name);
OPENTRACK_EXPORT void opentrack_tracker_start(opentrack self, opentrack_tracker tracker);
-OPENTRACK_EXPORT int opentrack_tracker_tick(opentrack_tracker tracker, double* headpose);
+OPENTRACK_EXPORT void opentrack_tracker_tick(opentrack_tracker tracker, double* headpose);
OPENTRACK_EXPORT void opentrack_finalize_tracker(opentrack_tracker tracker);
#ifdef __cplusplus
}
diff --git a/opentrack-api/trackers.cpp b/opentrack-api/trackers.cpp
index 0f698e4c..937f7084 100644
--- a/opentrack-api/trackers.cpp
+++ b/opentrack-api/trackers.cpp
@@ -29,11 +29,10 @@ void OPENTRACK_EXPORT opentrack_tracker_start(opentrack self, opentrack_tracker
return tracker->StartTracker(&self->fake_frame);
}
-int OPENTRACK_EXPORT opentrack_tracker_tick(opentrack_tracker tracker, double* headpose)
+void OPENTRACK_EXPORT opentrack_tracker_tick(opentrack_tracker tracker, double* headpose)
{
- int ret = tracker->GiveHeadPoseData(headpose);
+ tracker->GiveHeadPoseData(headpose);
QApplication::processEvents(0, 5);
- return ret;
}
}