summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Reichel <sre@ring0.de>2012-10-29 17:48:10 +0100
committerSebastian Reichel <sre@ring0.de>2012-10-29 17:48:10 +0100
commite28bf1a48f18575b7acb8213e2058dad2ccf7935 (patch)
tree77290e61b9806a1191e82dcb33531d777046ed7b
parent51aca5934487ac7ecf163b8082fdd29d0e96a009 (diff)
downloadmicrocopterd-e28bf1a48f18575b7acb8213e2058dad2ccf7935.tar.bz2
use time from parameter
-rw-r--r--ctrl/kinematics.vala14
1 files changed, 1 insertions, 13 deletions
diff --git a/ctrl/kinematics.vala b/ctrl/kinematics.vala
index 0f07f62..9993582 100644
--- a/ctrl/kinematics.vala
+++ b/ctrl/kinematics.vala
@@ -40,8 +40,6 @@ public class Kinematics {
/* filter tuning constant */
double beta;
- uint i = 0;
-
public Kinematics() {
reset();
@@ -49,15 +47,7 @@ public class Kinematics {
beta = Math.sqrt(3.0 / 4.0) * (Math.PI * (gyroMeasError / 180.0));
}
- public void update(double gx, double gy, double gz, double ax, double ay, double az, double mx, double my, double mz, double time) {
- //var deltat = time/1000000.0;
- //stdout.printf(@"$deltat\n");
- var deltat = 0.01;
-
- i++;
-
- //stdout.printf(@"$i $gx $gy $gz\n");
-
+ public void update(double gx, double gy, double gz, double ax, double ay, double az, double mx, double my, double mz, double deltat) {
/* auxiliary variables to avoid reapeated calcualtions */
var halfSEq_1 = 0.5 * SEq_1;
var halfSEq_2 = 0.5 * SEq_2;
@@ -157,8 +147,6 @@ public class Kinematics {
result[AXIS.X] = phi; /* roll */
result[AXIS.Y] = theta; /* pitch */
result[AXIS.Z] = psi; /* yaw */
-
- stdout.printf(@"$i $(degree(result[AXIS.X]))\t$(degree(result[AXIS.Y]))\t$(degree(result[AXIS.Z]))\n");
}
public double[] get_data() {