From 758f6417451397bebdee3faf46c09b81b1df0ea7 Mon Sep 17 00:00:00 2001
From: Paul Beuchat <beuchatp@control.ee.ethz.ch>
Date: Mon, 9 Apr 2018 14:54:04 +0200
Subject: [PATCH] bug solved

---
 pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/src/MainWindow.cpp | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/src/MainWindow.cpp b/pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/src/MainWindow.cpp
index 23fc2e7c..18d47630 100644
--- a/pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/src/MainWindow.cpp
+++ b/pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/src/MainWindow.cpp
@@ -709,10 +709,7 @@ void MainWindow::on_customButton_3_clicked()
 Setpoint MainWindow::correctSetpointBox(Setpoint setpoint, CrazyflieContext context)
 {
     Setpoint corrected_setpoint;
-    corrected_setpoint.x =  setpoint.x;
-    corrected_setpoint.y =  setpoint.y;
-    corrected_setpoint.z =  setpoint.z;
-    corrected_setpoint.yaw =  setpoint.yaw;
+    corrected_setpoint =  setpoint;
 
     if(setpoint.x > context.localArea.xmax)
         corrected_setpoint.x = context.localArea.xmax;
@@ -728,6 +725,7 @@ Setpoint MainWindow::correctSetpointBox(Setpoint setpoint, CrazyflieContext cont
     if(setpoint.z < context.localArea.zmin)
         corrected_setpoint.z = context.localArea.zmin;
 
+    return corrected_setpoint;
 }
 
 bool MainWindow::setpointInsideBox(Setpoint setpoint, CrazyflieContext context)
-- 
GitLab