mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-11-27 04:16:32 -08:00
Handle computed trackers better and handle tracker status in data collection
This commit is contained in:
8 files changed
+43
-3
No files matched your search
@@ -3,9 +3,11 @@ package dev.slimevr.vr.poserecorder;
|
||||
import java.util.List;
|
||||
|
||||
import io.eiren.util.collections.FastList;
|
||||
import io.eiren.vr.processor.ComputedHumanPoseTracker;
|
||||
import io.eiren.vr.processor.TrackerBodyPosition;
|
||||
import io.eiren.vr.trackers.ComputedTracker;
|
||||
import io.eiren.vr.trackers.Tracker;
|
||||
import io.eiren.vr.trackers.TrackerStatus;
|
||||
import io.eiren.vr.trackers.TrackerUtils;
|
||||
|
||||
public final class PoseFrame {
|
||||
@@ -30,7 +32,7 @@ public final class PoseFrame {
|
||||
|
||||
for (Tracker tracker : trackers) {
|
||||
// Ignore computed trackers if they aren't requested
|
||||
if (!includeComputed && tracker.getClass().equals(ComputedTracker.class)) {
|
||||
if (!includeComputed && tracker.isComputed()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -58,14 +58,20 @@ public final class TrackerFrame implements Tracker {
|
||||
return null;
|
||||
}
|
||||
|
||||
// If the tracker is not ready
|
||||
if (tracker.getStatus() != TrackerStatus.OK && tracker.getStatus() != TrackerStatus.OCCLUDED) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Quaternion rotation = null;
|
||||
if (tracker.hasRotation()) {
|
||||
rotation = new Quaternion();
|
||||
tracker.getRotation(rotation);
|
||||
}
|
||||
|
||||
// If the tracker is occluded, don't get the position
|
||||
Vector3f position = null;
|
||||
if (tracker.hasPosition()) {
|
||||
if (tracker.hasPosition() && tracker.getStatus() != TrackerStatus.OCCLUDED) {
|
||||
position = new Vector3f();
|
||||
tracker.getPosition(position);
|
||||
}
|
||||
@@ -168,5 +174,10 @@ public final class TrackerFrame implements Tracker {
|
||||
public boolean hasPosition() {
|
||||
return hasData(TrackerFrameData.POSITION);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isComputed() {
|
||||
return true;
|
||||
}
|
||||
//#endregion
|
||||
}
|
||||
Reference in new issue
Block a user