Browse Source

LandDetector: Check each rotation angle rather than the magnitude

sbg
Johan Jansen 10 years ago
parent
commit
9ddb7e72e4
  1. 6
      src/modules/land_detector/MulticopterLandDetector.cpp
  2. 2
      src/modules/land_detector/land_detector_params.c

6
src/modules/land_detector/MulticopterLandDetector.cpp

@ -111,9 +111,9 @@ bool MulticopterLandDetector::update() @@ -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;

2
src/modules/land_detector/land_detector_params.c

@ -65,7 +65,7 @@ PARAM_DEFINE_FLOAT(LNDMC_XY_VEL_MAX, 1.00f); @@ -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

Loading…
Cancel
Save