aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Gubler <thomasgubler@gmail.com>2014-08-22 23:15:11 +0200
committerThomas Gubler <thomasgubler@gmail.com>2014-08-22 23:15:11 +0200
commit8d3dd7363dbf9a29d88d2abb3364739749894684 (patch)
tree2d1ee477aa47374f69d84087499fb1b7ada75eb4
parentedffb2eede777f3c316bc8a144984d9d12cbd680 (diff)
downloadpx4-firmware-8d3dd7363dbf9a29d88d2abb3364739749894684.tar.gz
px4-firmware-8d3dd7363dbf9a29d88d2abb3364739749894684.tar.bz2
px4-firmware-8d3dd7363dbf9a29d88d2abb3364739749894684.zip
catapult launch detection: fix integration logic
-rw-r--r--src/lib/launchdetection/CatapultLaunchMethod.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/launchdetection/CatapultLaunchMethod.cpp b/src/lib/launchdetection/CatapultLaunchMethod.cpp
index c555a0a69..9d479832f 100644
--- a/src/lib/launchdetection/CatapultLaunchMethod.cpp
+++ b/src/lib/launchdetection/CatapultLaunchMethod.cpp
@@ -66,10 +66,10 @@ void CatapultLaunchMethod::update(float accel_x)
last_timestamp = hrt_absolute_time();
if (accel_x > threshold_accel.get()) {
- integrator += accel_x * dt;
+ integrator += dt;
// warnx("*** integrator %.3f, threshold_accel %.3f, threshold_time %.3f, accel_x %.3f, dt %.3f",
// (double)integrator, (double)threshold_accel.get(), (double)threshold_time.get(), (double)accel_x, (double)dt);
- if (integrator > threshold_accel.get() * threshold_time.get()) {
+ if (integrator > threshold_time.get()) {
launchDetected = true;
}