LandDetector: Check each rotation angle rather than the magnitude

This commit is contained in:
Johan Jansen
2015-02-09 18:05:50 +01:00
parent fe21cb6a1a
commit 9ddb7e72e4
2 changed files with 4 additions and 4 deletions
@@ -111,9 +111,9 @@ bool MulticopterLandDetector::update()
&& _vehicleStatus.condition_global_position_valid;
// next look if all rotation angles are not moving
bool rotating = sqrtf(_vehicleAttitude.rollspeed*_vehicleAttitude.rollspeed +
_vehicleAttitude.pitchspeed*_vehicleAttitude.pitchspeed +
_vehicleAttitude.yawspeed*_vehicleAttitude.yawspeed) > _params.maxRotation;
bool rotating = fabsf(_vehicleAttitude.rollspeed) > _params.maxRotation ||
fabsf(_vehicleAttitude.pitchspeed) > _params.maxRotation ||
fabsf(_vehicleAttitude.yawspeed) > _params.maxRotation;
// check if thrust output is minimal (about half of default)
bool minimalThrust = _actuators.control[3] <= _params.maxThrottle;
@@ -65,7 +65,7 @@ PARAM_DEFINE_FLOAT(LNDMC_XY_VEL_MAX, 1.00f);
*
* @group Land Detector
*/
PARAM_DEFINE_FLOAT(LNDMC_ROT_MAX, 15.0f);
PARAM_DEFINE_FLOAT(LNDMC_ROT_MAX, 20.0f);
/**
* Multicopter max throttle