mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-04-06 02:01:58 +02:00
Adjustmed trackers pass all tests
This commit is contained in:
@@ -5,13 +5,13 @@ import java.io.File;
|
||||
import io.eiren.gui.VRServerGUI;
|
||||
import io.eiren.util.logging.LogManager;
|
||||
|
||||
|
||||
public class Main {
|
||||
|
||||
public static String VERSION = "0.0.10";
|
||||
public static String VERSION = "0.0.11";
|
||||
|
||||
public static VRServer vrServer;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public static void main(String[] args) {
|
||||
System.setProperty("awt.useSystemAAFontSettings", "on");
|
||||
System.setProperty("swing.aatext", "true");
|
||||
|
||||
@@ -46,9 +46,6 @@ public class ReferenceAdjustedTracker<E extends Tracker> implements Tracker {
|
||||
public void resetFull(Quaternion reference) {
|
||||
Quaternion sensorRotation = new Quaternion();
|
||||
tracker.getRotation(sensorRotation);
|
||||
//float[] angles = new float[3];
|
||||
//sensorRotation.toAngles(angles);
|
||||
//sensorRotation.fromAngles(angles[0], 0, angles[2]);
|
||||
adjustmentAttachment.set(sensorRotation).inverseLocal();
|
||||
|
||||
resetYaw(reference);
|
||||
@@ -71,8 +68,7 @@ public class ReferenceAdjustedTracker<E extends Tracker> implements Tracker {
|
||||
|
||||
Quaternion sensorRotation = new Quaternion();
|
||||
tracker.getRotation(sensorRotation);
|
||||
adjustmentAttachment.mult(sensorRotation, sensorRotation);
|
||||
//sensorRotation.multLocal(adjustmentAttachment);
|
||||
sensorRotation.multLocal(adjustmentAttachment);
|
||||
|
||||
sensorRotation.toAngles(angles);
|
||||
sensorRotation.fromAngles(0, angles[1], 0);
|
||||
@@ -83,8 +79,7 @@ public class ReferenceAdjustedTracker<E extends Tracker> implements Tracker {
|
||||
}
|
||||
|
||||
protected void adjustInternal(Quaternion store) {
|
||||
//store.multLocal(adjustmentAttachment);
|
||||
adjustmentAttachment.mult(store, store);
|
||||
store.multLocal(adjustmentAttachment);
|
||||
adjustmentYaw.mult(store, store);
|
||||
}
|
||||
|
||||
|
||||
@@ -162,7 +162,7 @@ public class ReferenceAdjustmentsTests {
|
||||
}
|
||||
|
||||
private static String name(int yaw, int pitch, int roll, float[] angles, float[] anglesAdj, float[] anglesDiff) {
|
||||
return "Rot: " + yaw + "/" + pitch + ". "
|
||||
return "Rot: " + yaw + "/" + pitch + "/" + roll + ". "
|
||||
+ "Angles: " + StringUtils.prettyNumber(angles[0] * FastMath.RAD_TO_DEG, 1) + "/" + StringUtils.prettyNumber(anglesAdj[0] * FastMath.RAD_TO_DEG, 1) + ", "
|
||||
+ StringUtils.prettyNumber(angles[1] * FastMath.RAD_TO_DEG, 1) + "/" + StringUtils.prettyNumber(anglesAdj[1] * FastMath.RAD_TO_DEG, 1) + ", "
|
||||
+ StringUtils.prettyNumber(angles[2] * FastMath.RAD_TO_DEG, 1) + "/" + StringUtils.prettyNumber(anglesAdj[2] * FastMath.RAD_TO_DEG, 1) + ". Diff: "
|
||||
|
||||
Reference in New Issue
Block a user