MulticopterLandDetector: use hysteresis lib

The hysteresis was not properly implemented in the land detector and is
therefore replaced by the library call, both for the freefall detector
and the land detector.
This commit is contained in:
Julian Oes
2016-07-30 12:26:56 +02:00
parent ee1669e174
commit 740bfc0b32
2 changed files with 18 additions and 19 deletions
@@ -53,6 +53,7 @@
#include <uORB/topics/control_state.h>
#include <uORB/topics/vehicle_control_mode.h>
#include <systemlib/param/param.h>
#include <systemlib/hysteresis/hysteresis.h>
namespace landdetection
{
@@ -136,9 +137,10 @@ private:
struct control_state_s _ctrl_state;
struct vehicle_control_mode_s _ctrl_mode;
uint64_t _landTimer; ///< timestamp in microseconds since a possible land was detected
uint64_t _freefallTimer; ///< timestamp in microseconds since a possible freefall was detected
uint64_t _min_trust_start; ///< timestamp when minimum trust was applied first
systemlib::Hysteresis _freefall_hysteresis;
systemlib::Hysteresis _landed_hysteresis;
};
}