mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 21:17:01 +02:00
add extra debugging to the kinect plugin
This commit is contained in:
parent
a659b73edf
commit
80fb7bc287
2 changed files with 22 additions and 2 deletions
|
@ -239,6 +239,14 @@ void KinectPlugin::init() {
|
||||||
auto preference = new CheckPreference(KINECT_PLUGIN, "Enabled", getter, setter);
|
auto preference = new CheckPreference(KINECT_PLUGIN, "Enabled", getter, setter);
|
||||||
preferences->addPreference(preference);
|
preferences->addPreference(preference);
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
auto debugGetter = [this]()->bool { return _enabled; };
|
||||||
|
auto debugSetter = [this](bool value) {
|
||||||
|
_debug = value; saveSettings();
|
||||||
|
};
|
||||||
|
auto preference = new CheckPreference(KINECT_PLUGIN, "Extra Debugging", debugGetter, debugSetter);
|
||||||
|
preferences->addPreference(preference);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool KinectPlugin::isSupported() const {
|
bool KinectPlugin::isSupported() const {
|
||||||
|
@ -389,9 +397,11 @@ void KinectPlugin::ProcessBody(INT64 time, int bodyCount, IBody** bodies) {
|
||||||
|
|
||||||
if (SUCCEEDED(hr)) {
|
if (SUCCEEDED(hr)) {
|
||||||
auto jointCount = _countof(joints);
|
auto jointCount = _countof(joints);
|
||||||
//qDebug() << __FUNCTION__ << "nBodyCount:" << nBodyCount << "body:" << i << "jointCount:" << jointCount;
|
if (_debug) {
|
||||||
|
qDebug() << __FUNCTION__ << "nBodyCount:" << nBodyCount << "body:" << i << "jointCount:" << jointCount;
|
||||||
|
}
|
||||||
|
|
||||||
for (int j = 0; j < jointCount; ++j) {
|
for (int j = 0; j < jointCount; ++j) {
|
||||||
//QString jointName = kinectJointNames[joints[j].JointType];
|
|
||||||
|
|
||||||
glm::vec3 jointPosition { joints[j].Position.X,
|
glm::vec3 jointPosition { joints[j].Position.X,
|
||||||
joints[j].Position.Y,
|
joints[j].Position.Y,
|
||||||
|
@ -404,6 +414,14 @@ void KinectPlugin::ProcessBody(INT64 time, int bodyCount, IBody** bodies) {
|
||||||
jointOrientations[j].Orientation.y,
|
jointOrientations[j].Orientation.y,
|
||||||
jointOrientations[j].Orientation.z };
|
jointOrientations[j].Orientation.z };
|
||||||
|
|
||||||
|
if (_debug) {
|
||||||
|
QString jointName = kinectJointNames[joints[j].JointType];
|
||||||
|
qDebug() << __FUNCTION__ << "joint[" << j << "]:" << jointName
|
||||||
|
<< "position:" << jointPosition
|
||||||
|
<< "orientation:" << jointOrientation
|
||||||
|
<< "isTracked:" << joints[j].TrackingState != TrackingState_NotTracked;
|
||||||
|
}
|
||||||
|
|
||||||
// filling in the _joints data...
|
// filling in the _joints data...
|
||||||
if (joints[j].TrackingState != TrackingState_NotTracked) {
|
if (joints[j].TrackingState != TrackingState_NotTracked) {
|
||||||
_joints[j].position = jointPosition;
|
_joints[j].position = jointPosition;
|
||||||
|
@ -545,6 +563,7 @@ void KinectPlugin::saveSettings() const {
|
||||||
settings.beginGroup(idString);
|
settings.beginGroup(idString);
|
||||||
{
|
{
|
||||||
settings.setValue(QString("enabled"), _enabled);
|
settings.setValue(QString("enabled"), _enabled);
|
||||||
|
settings.setValue(QString("extraDebug"), _debug);
|
||||||
}
|
}
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,6 +89,7 @@ protected:
|
||||||
static const char* KINECT_ID_STRING;
|
static const char* KINECT_ID_STRING;
|
||||||
|
|
||||||
bool _enabled { false };
|
bool _enabled { false };
|
||||||
|
bool _debug { false };
|
||||||
mutable bool _initialized { false };
|
mutable bool _initialized { false };
|
||||||
|
|
||||||
// copy of data directly from the KinectDataReader SDK
|
// copy of data directly from the KinectDataReader SDK
|
||||||
|
|
Loading…
Reference in a new issue