mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-04-06 02:01:58 +02:00
Small clean-up and ignore computed trackers in PoseFrame by default
This commit is contained in:
@@ -37,14 +37,14 @@ public class AutoBoneWindow extends JFrame {
|
||||
|
||||
private EJBox pane;
|
||||
|
||||
private final VRServer server;
|
||||
private final SkeletonConfig skeletonConfig;
|
||||
private final PoseRecorder poseRecorder;
|
||||
private final AutoBone autoBone;
|
||||
private final transient VRServer server;
|
||||
private final transient SkeletonConfig skeletonConfig;
|
||||
private final transient PoseRecorder poseRecorder;
|
||||
private final transient AutoBone autoBone;
|
||||
|
||||
private Thread recordingThread = null;
|
||||
private Thread saveRecordingThread = null;
|
||||
private Thread autoBoneThread = null;
|
||||
private transient Thread recordingThread = null;
|
||||
private transient Thread saveRecordingThread = null;
|
||||
private transient Thread autoBoneThread = null;
|
||||
|
||||
private JButton saveRecordingButton;
|
||||
private JButton adjustButton;
|
||||
@@ -292,7 +292,7 @@ public class AutoBoneWindow extends JFrame {
|
||||
setText("Load...");
|
||||
List<Pair<String, PoseFrame[]>> frameRecordings = loadRecordings();
|
||||
|
||||
if (frameRecordings.size() > 0) {
|
||||
if (!frameRecordings.isEmpty()) {
|
||||
LogManager.log.info("[AutoBone] Done loading frames!");
|
||||
} else {
|
||||
Future<PoseFrame[]> framesFuture = poseRecorder.getFramesAsync();
|
||||
@@ -354,7 +354,7 @@ public class AutoBoneWindow extends JFrame {
|
||||
lengthsLabel.setText(lengthsString);
|
||||
}
|
||||
|
||||
if (heightPercentError.size() > 0) {
|
||||
if (!heightPercentError.isEmpty()) {
|
||||
float mean = 0f;
|
||||
for (float val : heightPercentError) {
|
||||
mean += val;
|
||||
|
||||
@@ -248,8 +248,7 @@ public class SimpleSkeleton {
|
||||
}
|
||||
|
||||
public TransformNode getNode(String node) {
|
||||
TransformNode transformNode = nodes.get(node);
|
||||
return transformNode;
|
||||
return nodes.get(node);
|
||||
}
|
||||
|
||||
public TransformNode getNode(TrackerBodyPosition bodyPosition) {
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.util.List;
|
||||
|
||||
import io.eiren.util.collections.FastList;
|
||||
import io.eiren.vr.processor.TrackerBodyPosition;
|
||||
import io.eiren.vr.trackers.ComputedTracker;
|
||||
import io.eiren.vr.trackers.Tracker;
|
||||
import io.eiren.vr.trackers.TrackerUtils;
|
||||
|
||||
@@ -15,7 +16,12 @@ public final class PoseFrame {
|
||||
this.trackerFrames = trackerFrames;
|
||||
}
|
||||
|
||||
// Ignore computed trackers by default
|
||||
public static PoseFrame fromTrackers(List<Tracker> trackers) {
|
||||
return fromTrackers(trackers, false);
|
||||
}
|
||||
|
||||
public static PoseFrame fromTrackers(List<Tracker> trackers, boolean includeComputed) {
|
||||
if (trackers == null || trackers.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
@@ -23,6 +29,11 @@ public final class PoseFrame {
|
||||
List<TrackerFrame> trackerFrames = new FastList<TrackerFrame>(trackers.size());
|
||||
|
||||
for (Tracker tracker : trackers) {
|
||||
// Ignore computed trackers if they aren't requested
|
||||
if (!includeComputed && tracker.getClass().equals(ComputedTracker.class)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
TrackerFrame trackerFrame = TrackerFrame.fromTracker(tracker);
|
||||
|
||||
if (trackerFrame != null) {
|
||||
|
||||
@@ -7,7 +7,6 @@ import java.io.DataOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.jme3.math.Quaternion;
|
||||
|
||||
Reference in New Issue
Block a user