Adjustmed trackers pass all tests

This commit is contained in:
Eiren Rain
2021-07-25 23:04:34 +03:00
parent 89ee97872d
commit e248cca4e7
3 changed files with 5 additions and 10 deletions

View File

@@ -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");

View File

@@ -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);
}

View File

@@ -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: "