From 935362b7a369e75c18a7aed267d7b0b304e4c430 Mon Sep 17 00:00:00 2001 From: Thomas Gubler Date: Sat, 8 Mar 2014 19:00:49 +0100 Subject: launchdetection: better integration of Blocks class --- src/lib/launchdetection/CatapultLaunchMethod.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/lib/launchdetection/CatapultLaunchMethod.cpp') diff --git a/src/lib/launchdetection/CatapultLaunchMethod.cpp b/src/lib/launchdetection/CatapultLaunchMethod.cpp index 1039b4a09..12f80c4a3 100644 --- a/src/lib/launchdetection/CatapultLaunchMethod.cpp +++ b/src/lib/launchdetection/CatapultLaunchMethod.cpp @@ -41,12 +41,16 @@ #include "CatapultLaunchMethod.h" #include -CatapultLaunchMethod::CatapultLaunchMethod() : +namespace launchdetection +{ + +CatapultLaunchMethod::CatapultLaunchMethod(SuperBlock *parent) : + SuperBlock(parent, "CAT"), last_timestamp(hrt_absolute_time()), integrator(0.0f), launchDetected(false), - threshold_accel(NULL, "LAUN_CAT_A", false), - threshold_time(NULL, "LAUN_CAT_T", false) + threshold_accel(this, "A"), + threshold_time(this, "T") { } @@ -83,14 +87,11 @@ bool CatapultLaunchMethod::getLaunchDetected() return launchDetected; } -void CatapultLaunchMethod::updateParams() -{ - threshold_accel.update(); - threshold_time.update(); -} void CatapultLaunchMethod::reset() { integrator = 0.0f; launchDetected = false; } + +} -- cgit v1.2.3