diff options
author | Keith Packard <keithp@keithp.com> | 2015-09-12 20:41:37 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2015-10-13 13:54:28 -0700 |
commit | 618f7ac8f31941fcbb3ed91829de69c0f0be8e0b (patch) | |
tree | 9b9c0f77aa1634f0dac85d46492fd7a3993741ea | |
parent | 0afa07d3c1dcb5e301fcb8b4edfecdd961662478 (diff) |
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 <keithp@keithp.com>
-rw-r--r-- | altoslib/AltosRotation.java | 2 |
1 files changed, 1 insertions, 1 deletions
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(); } |