Skip to content

Commit

Permalink
Adjustmed trackers pass all tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Eirenliel committed Jul 25, 2021
1 parent 89ee978 commit e248cca
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/main/java/io/eiren/vr/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ public void saveConfig(TrackerConfig config) {
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);
Expand All @@ -71,8 +68,7 @@ public void resetYaw(Quaternion reference) {

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);
Expand All @@ -83,8 +79,7 @@ public void resetYaw(Quaternion reference) {
}

protected void adjustInternal(Quaternion store) {
//store.multLocal(adjustmentAttachment);
adjustmentAttachment.mult(store, store);
store.multLocal(adjustmentAttachment);
adjustmentYaw.mult(store, store);
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/java/io/eiren/unit/ReferenceAdjustmentsTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ private void testAdjustedTrackerRotation(Quaternion trackerQuat, int refPitch, i
}

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: "
Expand Down

0 comments on commit e248cca

Please sign in to comment.