From 6daf78494a6ed261dd584075f456e5d832fe4b32 Mon Sep 17 00:00:00 2001 From: Dennis Mannhart Date: Wed, 20 Dec 2017 17:30:15 +0100 Subject: [PATCH] TranslationControl: adjust direction based on constrainPIDu inputs --- src/modules/mc_pos_control/TranslationControl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/mc_pos_control/TranslationControl.cpp b/src/modules/mc_pos_control/TranslationControl.cpp index aa7b8c8d73..6ea45d4cc2 100644 --- a/src/modules/mc_pos_control/TranslationControl.cpp +++ b/src/modules/mc_pos_control/TranslationControl.cpp @@ -212,7 +212,7 @@ void TranslationControl::_velocityController(const float &dt) * if (r-y) is greater or smaller than 0 */ float dot_xy = matrix::Vector2f(&vel_err(0)) * matrix::Vector2f(&_vel_sp(0)); - float direction[2] = {dot_xy, vel_err(2)}; + float direction[2] = {dot_xy, -vel_err(2)}; // negative sign because of N-E-D bool saturate[2] = {false, false}; PosControl::constrainPIDu(_thr_sp, saturate, _ThrLimit, direction);