diff options
author | Thomas Gubler <thomasgubler@gmail.com> | 2014-08-23 11:42:53 +0200 |
---|---|---|
committer | Thomas Gubler <thomasgubler@gmail.com> | 2014-08-23 11:42:53 +0200 |
commit | 5a5617cb597b16b789a6fa175410d667f45cf907 (patch) | |
tree | 073ad2bbb303fdaa5da508304749354b24f955bb /src/lib/launchdetection/CatapultLaunchMethod.h | |
parent | 52ffc3bced314d0d2ed36763e8761696f3c46b5d (diff) | |
download | px4-firmware-5a5617cb597b16b789a6fa175410d667f45cf907.tar.gz px4-firmware-5a5617cb597b16b789a6fa175410d667f45cf907.tar.bz2 px4-firmware-5a5617cb597b16b789a6fa175410d667f45cf907.zip |
launchdetector: return state of detection
The launchdetector now has a intermediate state (controlsenabled) which
is meant to be interpreted by the controller as: "perform attitude
control but do not yet power up the motor". This can be used in the
floating phase during a bungee launch for example.
Diffstat (limited to 'src/lib/launchdetection/CatapultLaunchMethod.h')
-rw-r--r-- | src/lib/launchdetection/CatapultLaunchMethod.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/lib/launchdetection/CatapultLaunchMethod.h b/src/lib/launchdetection/CatapultLaunchMethod.h index a64d482f6..d918c3a76 100644 --- a/src/lib/launchdetection/CatapultLaunchMethod.h +++ b/src/lib/launchdetection/CatapultLaunchMethod.h @@ -57,20 +57,19 @@ public: ~CatapultLaunchMethod(); void update(float accel_x); - bool getLaunchDetected(); + LaunchDetectionResult getLaunchDetected() const; void reset(); private: hrt_abstime last_timestamp; float integrator; - float delayCounter; + float motorDelayCounter; - bool launchDetected; - bool delayPassed; + LaunchDetectionResult state; - control::BlockParamFloat threshold_accel; - control::BlockParamFloat threshold_time; - control::BlockParamFloat delay; + control::BlockParamFloat thresholdAccel; + control::BlockParamFloat thresholdTime; + control::BlockParamFloat motorDelay; }; |