clang-tidy readability-simplify-boolean-expr

This commit is contained in:
Daniel Agar
2017-06-02 19:35:18 -04:00
parent 3c06641897
commit 64ed96d81a
12 changed files with 36 additions and 95 deletions
@@ -142,16 +142,10 @@ bool FixedwingLandDetector::_get_landed_state()
_accel_horz_lp = _accel_horz_lp * 0.8f + _controlState.horz_acc_mag * 0.18f;
// crude land detector for fixedwing
if (_velocity_xy_filtered < _params.maxVelocity
&& _velocity_z_filtered < _params.maxClimbRate
&& _airspeed_filtered < _params.maxAirSpeed
&& _accel_horz_lp < _params.maxIntVelocity) {
landDetected = true;
} else {
landDetected = false;
}
landDetected = _velocity_xy_filtered < _params.maxVelocity
&& _velocity_z_filtered < _params.maxClimbRate
&& _airspeed_filtered < _params.maxAirSpeed
&& _accel_horz_lp < _params.maxIntVelocity;
} else {
// Control state topic has timed out and we need to assume we're landed.