From 618f7ac8f31941fcbb3ed91829de69c0f0be8e0b Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 12 Sep 2015 20:41:37 -0700 Subject: [PATCH] altoslib: Rotation off by factor of two The rotation computation was off by a factor of two when converting the rates to a quaternion (the quaternion needs to be half of the actual rotation amount). This ended up presenting a tilt angle of twice what it should be. Signed-off-by: Keith Packard --- altoslib/AltosRotation.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/altoslib/AltosRotation.java b/altoslib/AltosRotation.java index 9771c166..c4b07f62 100644 --- a/altoslib/AltosRotation.java +++ b/altoslib/AltosRotation.java @@ -28,7 +28,7 @@ public class AltosRotation { } public void rotate(double dt, double x, double y, double z) { - AltosQuaternion rot = AltosQuaternion.half_euler(x * dt, y * dt, z * dt); + AltosQuaternion rot = AltosQuaternion.half_euler(x * dt / 2.0, y * dt / 2.0, z * dt / 2.0); rotation = rot.multiply(rotation).normalize(); } -- 2.30.2