From d64b59b95ff7933ecab3e776026c4713016fbb39 Mon Sep 17 00:00:00 2001
From: Dennis Mannhart <dennis.mannhart@gmail.com>
Date: Thu, 11 Jan 2018 15:41:54 +0100
Subject: [PATCH] FlightTaskUtility: remove duplicate slewrate

---
 src/lib/FlightTasks/tasks/Utility/ManualSmoothingXY.cpp | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/lib/FlightTasks/tasks/Utility/ManualSmoothingXY.cpp b/src/lib/FlightTasks/tasks/Utility/ManualSmoothingXY.cpp
index 8f70e46a70..c72dcc295a 100644
--- a/src/lib/FlightTasks/tasks/Utility/ManualSmoothingXY.cpp
+++ b/src/lib/FlightTasks/tasks/Utility/ManualSmoothingXY.cpp
@@ -63,6 +63,8 @@ ManualSmoothingXY::smoothVelocity(matrix::Vector2f &vel_sp, const matrix::Vector
 	_updateAcceleration(vel_sp, vel, yaw, yawrate_sp, dt);
 
 	_velocitySlewRate(vel_sp, dt);
+
+	_vel_sp_prev = vel_sp;
 }
 
 void
@@ -106,11 +108,6 @@ ManualSmoothingXY::_updateAcceleration(matrix::Vector2f &vel_sp, const matrix::V
 	 * intention. Jerk is only used for braking.
 	 */
 	_getStateAcceleration(vel_sp, vel, intention, dt);
-
-	/* Smooth velocity setpoint based on acceleration */
-	_velocitySlewRate(vel_sp, dt);
-
-	_vel_sp_prev = vel_sp;
 }
 
 ManualSmoothingXY::Intention
-- 
GitLab