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/MulticopterLandDetector.cpp | |
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/MulticopterLandDetector.cpp')
-rw-r--r-- | src/modules/land_detector/MulticopterLandDetector.cpp | 6 |
1 files changed, 3 insertions, 3 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; |