mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 01:53:35 +08:00
Added room in land_detector code for free-fall detection
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user