diff options
author | Thomas Gubler <thomasgubler@gmail.com> | 2013-12-30 19:08:09 +0100 |
---|---|---|
committer | Thomas Gubler <thomasgubler@gmail.com> | 2013-12-30 19:08:09 +0100 |
commit | 9cc1fc1cb59255c1390f058f03918b0d105c2d26 (patch) | |
tree | c14d19d79905cdbf6a32ed84ec0383f528bd1323 /src/lib/launchdetection/CatapultLaunchMethod.cpp | |
parent | bd88209f5c2777f1e0c2c30c24b2819424097059 (diff) | |
download | px4-firmware-9cc1fc1cb59255c1390f058f03918b0d105c2d26.tar.gz px4-firmware-9cc1fc1cb59255c1390f058f03918b0d105c2d26.tar.bz2 px4-firmware-9cc1fc1cb59255c1390f058f03918b0d105c2d26.zip |
fixed launchdetection logic, catapult tested in HIL
Diffstat (limited to 'src/lib/launchdetection/CatapultLaunchMethod.cpp')
-rw-r--r-- | src/lib/launchdetection/CatapultLaunchMethod.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib/launchdetection/CatapultLaunchMethod.cpp b/src/lib/launchdetection/CatapultLaunchMethod.cpp index 0a95b46f6..d5c759b17 100644 --- a/src/lib/launchdetection/CatapultLaunchMethod.cpp +++ b/src/lib/launchdetection/CatapultLaunchMethod.cpp @@ -39,6 +39,7 @@ */ #include "CatapultLaunchMethod.h" +#include <systemlib/err.h> CatapultLaunchMethod::CatapultLaunchMethod() : last_timestamp(0), @@ -61,11 +62,15 @@ void CatapultLaunchMethod::update(float accel_x) if (accel_x > threshold_accel.get()) { integrator += accel_x * 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()) { launchDetected = true; } } else { +// 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); /* reset integrator */ integrator = 0.0f; launchDetected = false; |