diff options
author | Thomas Gubler <thomasgubler@gmail.com> | 2014-08-22 23:15:11 +0200 |
---|---|---|
committer | Thomas Gubler <thomasgubler@gmail.com> | 2014-08-22 23:15:11 +0200 |
commit | 8d3dd7363dbf9a29d88d2abb3364739749894684 (patch) | |
tree | 2d1ee477aa47374f69d84087499fb1b7ada75eb4 /src | |
parent | edffb2eede777f3c316bc8a144984d9d12cbd680 (diff) | |
download | px4-firmware-8d3dd7363dbf9a29d88d2abb3364739749894684.tar.gz px4-firmware-8d3dd7363dbf9a29d88d2abb3364739749894684.tar.bz2 px4-firmware-8d3dd7363dbf9a29d88d2abb3364739749894684.zip |
catapult launch detection: fix integration logic
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/launchdetection/CatapultLaunchMethod.cpp | 4 |
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; } |