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.
This commit is contained in:
Thomas Gubler
2014-08-23 11:42:53 +02:00
parent 52ffc3bced
commit 5a5617cb59
6 changed files with 91 additions and 48 deletions
+12 -1
View File
@@ -44,11 +44,22 @@
namespace launchdetection
{
enum LaunchDetectionResult {
LAUNCHDETECTION_RES_NONE = 0, /**< No launch has been detected */
LAUNCHDETECTION_RES_DETECTED_ENABLECONTROL = 1, /**< Launch has been detected, the controller should
control the attitude. However any motors should not throttle
up and still be set to 'throttlePreTakeoff'.
For instance this is used to have a delay for the motor
when launching a fixed wing aircraft from a bungee */
LAUNCHDETECTION_RES_DETECTED_ENABLEMOTORS = 2 /**< Launch has been detected, teh controller should control
attitude and also throttle up the motors. */
};
class LaunchMethod
{
public:
virtual void update(float accel_x) = 0;
virtual bool getLaunchDetected() = 0;
virtual LaunchDetectionResult getLaunchDetected() const = 0;
virtual void reset() = 0;
protected: