ManualSmoothZ: move vel_sp_previous update into class

This commit is contained in:
Dennis Mannhart
2018-04-05 07:30:12 +02:00
committed by Beat Küng
parent ed62056b7c
commit 5cfd93040f
4 changed files with 67 additions and 64 deletions
@@ -58,14 +58,10 @@ void FlightTaskManualAltitudeSmooth::_updateSetpoints()
/* Get yaw, thrust */
FlightTaskManualAltitude::_updateSetpoints();
/* Smooth velocity setpoint */
float vel_sp[2] = {_vel_sp_z, _vel_sp_prev_z};
_smoothing.smoothVelFromSticks(vel_sp, _deltatime);
_vel_sp_z = vel_sp[0];
/* Smooth velocity in z*/
_smoothing.smoothVelFromSticks(_vel_sp_z, _deltatime);
/* Check for altitude lock*/
_updateAltitudeLock();
/* Update previous velocity setpoint for next smoothing iteration */
_vel_sp_prev_z = _vel_sp_z;
}