From af0d63250c691eed1e483e46d7b50f8f38a900d7 Mon Sep 17 00:00:00 2001 From: baumanta Date: Tue, 20 Aug 2019 16:24:48 +0200 Subject: [PATCH] check velocity_setpoint instead of sticks in altitude mode --- .../FlightTaskManualAltitudeSmoothVel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/FlightTasks/tasks/ManualAltitudeSmoothVel/FlightTaskManualAltitudeSmoothVel.cpp b/src/lib/FlightTasks/tasks/ManualAltitudeSmoothVel/FlightTaskManualAltitudeSmoothVel.cpp index a6919c07c6..0243fecdd7 100644 --- a/src/lib/FlightTasks/tasks/ManualAltitudeSmoothVel/FlightTaskManualAltitudeSmoothVel.cpp +++ b/src/lib/FlightTasks/tasks/ManualAltitudeSmoothVel/FlightTaskManualAltitudeSmoothVel.cpp @@ -130,7 +130,7 @@ void FlightTaskManualAltitudeSmoothVel::_updateSetpoints() * is used to set current velocity of the trajectory. */ - if (fabsf(_sticks_expo(2)) > FLT_EPSILON) { + if (fabsf(_velocity_setpoint(2)) > FLT_EPSILON) { if (_position_lock_z_active) { _smoothing.setCurrentVelocity(_velocity_setpoint_feedback( 2)); // Start the trajectory at the current velocity setpoint @@ -159,7 +159,7 @@ void FlightTaskManualAltitudeSmoothVel::_updateSetpoints() if (fabsf(_vel_sp_smooth) < 0.1f && fabsf(_acceleration_setpoint(2)) < .2f && - fabsf(_sticks_expo(2)) <= FLT_EPSILON) { + fabsf(_velocity_setpoint(2)) <= FLT_EPSILON) { _position_lock_z_active = true; }