mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 20:33:34 +08:00
LandDetector: Check each rotation angle rather than the magnitude
This commit is contained in:
@@ -111,9 +111,9 @@ bool MulticopterLandDetector::update()
|
|||||||
&& _vehicleStatus.condition_global_position_valid;
|
&& _vehicleStatus.condition_global_position_valid;
|
||||||
|
|
||||||
// next look if all rotation angles are not moving
|
// next look if all rotation angles are not moving
|
||||||
bool rotating = sqrtf(_vehicleAttitude.rollspeed*_vehicleAttitude.rollspeed +
|
bool rotating = fabsf(_vehicleAttitude.rollspeed) > _params.maxRotation ||
|
||||||
_vehicleAttitude.pitchspeed*_vehicleAttitude.pitchspeed +
|
fabsf(_vehicleAttitude.pitchspeed) > _params.maxRotation ||
|
||||||
_vehicleAttitude.yawspeed*_vehicleAttitude.yawspeed) > _params.maxRotation;
|
fabsf(_vehicleAttitude.yawspeed) > _params.maxRotation;
|
||||||
|
|
||||||
// check if thrust output is minimal (about half of default)
|
// check if thrust output is minimal (about half of default)
|
||||||
bool minimalThrust = _actuators.control[3] <= _params.maxThrottle;
|
bool minimalThrust = _actuators.control[3] <= _params.maxThrottle;
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ PARAM_DEFINE_FLOAT(LNDMC_XY_VEL_MAX, 1.00f);
|
|||||||
*
|
*
|
||||||
* @group Land Detector
|
* @group Land Detector
|
||||||
*/
|
*/
|
||||||
PARAM_DEFINE_FLOAT(LNDMC_ROT_MAX, 15.0f);
|
PARAM_DEFINE_FLOAT(LNDMC_ROT_MAX, 20.0f);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Multicopter max throttle
|
* Multicopter max throttle
|
||||||
|
|||||||
Reference in New Issue
Block a user