diff options
author | Johan Jansen <jnsn.johan@gmail.com> | 2015-02-09 18:05:50 +0100 |
---|---|---|
committer | Johan Jansen <jnsn.johan@gmail.com> | 2015-02-09 18:06:29 +0100 |
commit | 9ddb7e72e4a7aa63575cd71f24513a5afec0a47a (patch) | |
tree | ad7251567c7d865f5f76dcf1ab99edb5bdbc15e8 /src/modules/land_detector | |
parent | fe21cb6a1aa0c5ccd9610cb2a93139a91a9e5a72 (diff) | |
download | px4-firmware-9ddb7e72e4a7aa63575cd71f24513a5afec0a47a.tar.gz px4-firmware-9ddb7e72e4a7aa63575cd71f24513a5afec0a47a.tar.bz2 px4-firmware-9ddb7e72e4a7aa63575cd71f24513a5afec0a47a.zip |
LandDetector: Check each rotation angle rather than the magnitude
Diffstat (limited to 'src/modules/land_detector')
-rw-r--r-- | src/modules/land_detector/MulticopterLandDetector.cpp | 6 | ||||
-rw-r--r-- | src/modules/land_detector/land_detector_params.c | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/modules/land_detector/MulticopterLandDetector.cpp b/src/modules/land_detector/MulticopterLandDetector.cpp index 6d7803536..1490232a4 100644 --- a/src/modules/land_detector/MulticopterLandDetector.cpp +++ b/src/modules/land_detector/MulticopterLandDetector.cpp @@ -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; diff --git a/src/modules/land_detector/land_detector_params.c b/src/modules/land_detector/land_detector_params.c index d9ab47456..e3070c115 100644 --- a/src/modules/land_detector/land_detector_params.c +++ b/src/modules/land_detector/land_detector_params.c @@ -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 |