mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-17 02:57: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;
|
||||
|
||||
// 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
|
||||
|
||||
Reference in New Issue
Block a user