mc_pos_control: change sign for close to ground + style fix

This commit is contained in:
Matthias Grob 2017-02-23 19:32:18 +01:00 committed by Lorenz Meier
parent de9d05c292
commit 3a358422c4
1 changed files with 3 additions and 3 deletions

View File

@ -1696,7 +1696,7 @@ MulticopterPositionControl::control_position(float dt)
* for now we use the home altitude and assume that our Z coordinate
* is initialized close to home.
*/
bool close_to_ground = (-_pos(2) - _home_pos.z) < _manual_land_alt.get();
bool close_to_ground = (-_pos(2) + _home_pos.z) < _manual_land_alt.get();
if (close_to_ground && (_vel_sp(2) > _params.land_speed)) {
_vel_sp(2) = _params.land_speed;