Skip to content

Commit b8f614b

Browse files
committed
Use the older BNO query interface on Windows
1 parent a8dadbc commit b8f614b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

libminiscope/miniscope.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -1726,6 +1726,13 @@ void Miniscope::captureThread(void *msPtr)
17261726
// determine device position in space
17271727
std::vector<float> bnoVec(5);
17281728
if (hasHeadOrientationSupport) {
1729+
#ifdef Q_OS_WIN
1730+
// on Windows, PAN/TILT is not properly recognized, so we use the legacy properties
1731+
double w = static_cast<qint16>(d->cam.get(cv::CAP_PROP_SATURATION));
1732+
double x = static_cast<qint16>(d->cam.get(cv::CAP_PROP_HUE));
1733+
double y = static_cast<qint16>(d->cam.get(cv::CAP_PROP_GAIN));
1734+
double z = static_cast<qint16>(d->cam.get(cv::CAP_PROP_BRIGHTNESS));
1735+
#else
17291736
// unpack BNO quaternions
17301737
auto wx = static_cast<quint32>(d->cam.get(cv::CAP_PROP_PAN));
17311738
auto yz = static_cast<quint32>(d->cam.get(cv::CAP_PROP_TILT));
@@ -1734,6 +1741,7 @@ void Miniscope::captureThread(void *msPtr)
17341741
double x = (qint16)((wx >> 16) & 0xFFFF);
17351742
double y = (qint16)(yz & 0xFFFF);
17361743
double z = (qint16)((yz >> 16) & 0xFFFF);
1744+
#endif
17371745

17381746
// BNO output is a unit quaternion after 2^14 division
17391747
double norm = sqrt(w * w + x * x + y * y + z * z);

0 commit comments

Comments
 (0)