mc_pos_control: if triplet not valid in z ignore it

This commit is contained in:
Dennis Mannhart
2017-06-07 16:43:36 +02:00
parent 2a943f4bd0
commit e0d81b4c5e
@@ -1398,8 +1398,6 @@ void MulticopterPositionControl::control_auto(float dt)
if (PX4_ISFINITE(_pos_sp_triplet.current.alt)) {
_curr_pos_sp(2) = -(_pos_sp_triplet.current.alt - _ref_alt);
} else {
_curr_pos_sp(2) = _pos(2);
}
if (PX4_ISFINITE(_curr_pos_sp(0)) &&
@@ -1552,7 +1550,6 @@ void MulticopterPositionControl::control_auto(float dt)
_att_sp.yaw_body = _pos_sp_triplet.current.yaw;
}
/*
* if we're already near the current takeoff setpoint don't reset in case we switch back to posctl.
* this makes the takeoff finish smoothly.