Added room in land_detector code for free-fall detection

This commit is contained in:
Emmanuel Roussel
2016-04-18 22:27:11 +02:00
committed by Roman
parent e70804c9d0
commit 35110a52f9
10 changed files with 118 additions and 11 deletions
@@ -41,6 +41,9 @@
#include "VtolLandDetector.h"
#include <drivers/drv_hrt.h>
namespace landdetection
{
VtolLandDetector::VtolLandDetector() : MulticopterLandDetector(),
_paramHandle(),
_params(),
@@ -69,7 +72,7 @@ void VtolLandDetector::updateSubscriptions()
orb_update(ORB_ID(airspeed), _airspeedSub, &_airspeed);
}
bool VtolLandDetector::update()
LandDetectionResult VtolLandDetector::update()
{
updateSubscriptions();
updateParameterCache(false);
@@ -94,7 +97,9 @@ bool VtolLandDetector::update()
_was_in_air = !landed;
return landed;
_state = (landed) ? LANDDETECTION_RES_LANDED : LANDDETECTION_RES_FLYING;
return _state;
}
void VtolLandDetector::updateParameterCache(const bool force)
@@ -114,3 +119,5 @@ void VtolLandDetector::updateParameterCache(const bool force)
param_get(_paramHandle.maxAirSpeed, &_params.maxAirSpeed);
}
}
}